mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 20:11:58 +00:00
X11: Clean up context lookup
This commit is contained in:
parent
a67d8afbd4
commit
b1b21292b9
@ -231,23 +231,6 @@ static int translateKey(int scancode)
|
|||||||
return _glfw.x11.keycodes[scancode];
|
return _glfw.x11.keycodes[scancode];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the GLFW window corresponding to the specified X11 window
|
|
||||||
//
|
|
||||||
static _GLFWwindow* findWindowByHandle(Window handle)
|
|
||||||
{
|
|
||||||
_GLFWwindow* window;
|
|
||||||
|
|
||||||
if (XFindContext(_glfw.x11.display,
|
|
||||||
handle,
|
|
||||||
_glfw.x11.context,
|
|
||||||
(XPointer*) &window) != 0)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return window;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sends an EWMH or ICCCM event to the window manager
|
// Sends an EWMH or ICCCM event to the window manager
|
||||||
//
|
//
|
||||||
static void sendEventToWM(_GLFWwindow* window, Atom type,
|
static void sendEventToWM(_GLFWwindow* window, Atom type,
|
||||||
@ -1264,8 +1247,10 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = findWindowByHandle(event->xany.window);
|
if (XFindContext(_glfw.x11.display,
|
||||||
if (window == NULL)
|
event->xany.window,
|
||||||
|
_glfw.x11.context,
|
||||||
|
(XPointer*) &window) != 0)
|
||||||
{
|
{
|
||||||
// This is an event for a window that has already been destroyed
|
// This is an event for a window that has already been destroyed
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user