mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
Simplify XCheckWindowEvent/TypedWindowEvent to instead use XCheckIfEvent and check if event is for game window
This commit is contained in:
parent
a335d7fa06
commit
6c5285e457
@ -1330,11 +1330,8 @@ static Atom Window_GetSelectionProperty(XEvent* e) {
|
|||||||
return e->xselectionrequest.target;
|
return e->xselectionrequest.target;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cc_bool Window_GetPendingEvent(XEvent* e) {
|
static Bool FilterEvent(Display* d, XEvent* e, XPointer w) {
|
||||||
return XCheckWindowEvent(win_display, win_handle, win_eventMask, e) ||
|
return e->xany.window == (Window)w;
|
||||||
XCheckTypedWindowEvent(win_display, win_handle, ClientMessage, e) ||
|
|
||||||
XCheckTypedWindowEvent(win_display, win_handle, SelectionNotify, e) ||
|
|
||||||
XCheckTypedWindowEvent(win_display, win_handle, SelectionRequest, e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HandleWMDestroy(void) {
|
static void HandleWMDestroy(void) {
|
||||||
@ -1356,7 +1353,7 @@ static void HandleWMPing(XEvent* e) {
|
|||||||
void Window_ProcessEvents(void) {
|
void Window_ProcessEvents(void) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
while (Window_Exists) {
|
while (Window_Exists) {
|
||||||
if (!Window_GetPendingEvent(&e)) break;
|
if (!XCheckIfEvent(win_display, &e, FilterEvent, (XPointer)win_handle)) break;
|
||||||
|
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user