mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-18 06:41:25 +00:00
Don't block on X11 if there are no events
This commit is contained in:
+4
-2
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "x11.h"
|
#include "x11.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "../global.h"
|
|
||||||
#include "../loop.h"
|
#include "../loop.h"
|
||||||
|
|
||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
@@ -46,6 +45,9 @@ static Cursor cursor;
|
|||||||
static bool grabbed = True;
|
static bool grabbed = True;
|
||||||
|
|
||||||
static int x11_handler(int fd) {
|
static int x11_handler(int fd) {
|
||||||
|
if (!XPending(display))
|
||||||
|
return LOOP_OK;
|
||||||
|
|
||||||
XEvent event;
|
XEvent event;
|
||||||
int button = 0;
|
int button = 0;
|
||||||
int motion_x, motion_y;
|
int motion_x, motion_y;
|
||||||
@@ -120,7 +122,7 @@ static int x11_handler(int fd) {
|
|||||||
break;
|
break;
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
if (event.xclient.data.l[0] == wm_deletemessage)
|
if (event.xclient.data.l[0] == wm_deletemessage)
|
||||||
quit();
|
return LOOP_RETURN;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user