mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
If no valid display has been fetched on linux, return no input supported
This commit is contained in:
@@ -70,15 +70,6 @@ void Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
#if ENABLED(RDOC_XCB) || ENABLED(RDOC_XLIB) || ENABLED(RDOC_WAYLAND)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
|
||||
Display *CurrentXDisplay = NULL;
|
||||
@@ -91,6 +82,11 @@ void UseXlibDisplay(Display *dpy)
|
||||
CurrentXDisplay = XOpenDisplay(XDisplayString(dpy));
|
||||
}
|
||||
|
||||
bool HasXlibInput()
|
||||
{
|
||||
return CurrentXDisplay != NULL;
|
||||
}
|
||||
|
||||
bool GetXlibKeyState(int key)
|
||||
{
|
||||
if(CurrentXDisplay == NULL)
|
||||
@@ -158,6 +154,11 @@ void UseXlibDisplay(Display *dpy)
|
||||
{
|
||||
}
|
||||
|
||||
bool HasXlibInput()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetXlibKeyState(int key)
|
||||
{
|
||||
return false;
|
||||
@@ -176,6 +177,11 @@ void UseXcbConnection(xcb_connection_t *conn)
|
||||
symbols = xcb_key_symbols_alloc(conn);
|
||||
}
|
||||
|
||||
bool HasXCBInput()
|
||||
{
|
||||
return symbols != NULL;
|
||||
}
|
||||
|
||||
bool GetXCBKeyState(int key)
|
||||
{
|
||||
if(symbols == NULL)
|
||||
@@ -259,6 +265,11 @@ bool GetXCBKeyState(int key)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasXCBInput()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(RDOC_WAYLAND)
|
||||
@@ -480,6 +491,12 @@ void RemoveWaylandInputWindow(wl_surface *wnd)
|
||||
surfaces.erase(wnd);
|
||||
}
|
||||
|
||||
bool HasWaylandInput()
|
||||
{
|
||||
SCOPED_LOCK(waylandLock);
|
||||
return !displays.empty();
|
||||
}
|
||||
|
||||
bool GetWaylandKeyState(int key)
|
||||
{
|
||||
SCOPED_LOCK(waylandLock);
|
||||
@@ -500,6 +517,11 @@ void RemoveWaylandInputWindow(wl_surface *wnd)
|
||||
{
|
||||
}
|
||||
|
||||
bool HasWaylandInput()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetWaylandKeyState(int key)
|
||||
{
|
||||
return false;
|
||||
@@ -553,6 +575,11 @@ void RemoveInputWindow(WindowingSystem windowSystem, void *wnd)
|
||||
}
|
||||
}
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
return HasXCBInput() || HasXlibInput() || HasWaylandInput();
|
||||
}
|
||||
|
||||
bool GetKeyState(int key)
|
||||
{
|
||||
return GetXCBKeyState(key) || GetXlibKeyState(key) || GetWaylandKeyState(key);
|
||||
|
||||
Reference in New Issue
Block a user