mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 23:54:37 +00:00
X11: remove _glfwProcessPendingEvents
Remove _glfwProcessPendingEvents, do not call event handlers from glfwCreateWindow. It is dangerous. Do not wait for MapNotify event in glfwCreateWindow under X11.
This commit is contained in:
parent
585a840329
commit
99031a43a2
@ -43,16 +43,6 @@
|
|||||||
#define Button6 6
|
#define Button6 6
|
||||||
#define Button7 7
|
#define Button7 7
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Checks whether the event is a MapNotify for the specified window
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
static Bool isMapNotify(Display* d, XEvent* e, char* arg)
|
|
||||||
{
|
|
||||||
return (e->type == MapNotify) && (e->xmap.window == (Window)arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Translates an X Window key to internal coding
|
// Translates an X Window key to internal coding
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -94,7 +84,6 @@ static int translateChar(XKeyEvent* event)
|
|||||||
static GLboolean createWindow(_GLFWwindow* window,
|
static GLboolean createWindow(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig)
|
const _GLFWwndconfig* wndconfig)
|
||||||
{
|
{
|
||||||
XEvent event;
|
|
||||||
unsigned long wamask;
|
unsigned long wamask;
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
XVisualInfo* visual = _glfwGetContextVisual(window);
|
XVisualInfo* visual = _glfwGetContextVisual(window);
|
||||||
@ -243,8 +232,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
|
|
||||||
// Make sure the window is mapped before proceeding
|
// Make sure the window is mapped before proceeding
|
||||||
XMapWindow(_glfwLibrary.X11.display, window->X11.handle);
|
XMapWindow(_glfwLibrary.X11.display, window->X11.handle);
|
||||||
XPeekIfEvent(_glfwLibrary.X11.display, &event, isMapNotify,
|
XFlush(_glfwLibrary.X11.display);
|
||||||
(char*) window->X11.handle);
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
@ -887,24 +875,6 @@ static void processSingleEvent(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
////// GLFW internal API //////
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Processes all pending events
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
void _glfwProcessPendingEvents(void)
|
|
||||||
{
|
|
||||||
int i, count = XPending(_glfwLibrary.X11.display);
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
processSingleEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
////// GLFW platform API //////
|
////// GLFW platform API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@ -942,9 +912,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
enterFullscreenMode(window);
|
enterFullscreenMode(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the window map event and any other that may have arrived
|
|
||||||
_glfwProcessPendingEvents();
|
|
||||||
|
|
||||||
// Retrieve and set initial cursor position
|
// Retrieve and set initial cursor position
|
||||||
{
|
{
|
||||||
Window cursorWindow, cursorRoot;
|
Window cursorWindow, cursorRoot;
|
||||||
|
Loading…
Reference in New Issue
Block a user