Skip to content
Snippets Groups Projects
Commit 777fb6d8 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Actually, don't bother returning a value that's never used.

Still be sure to check the return value of write() though.
parent 00ab0718
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4496 passed
...@@ -1590,14 +1590,14 @@ handle_configuration(int w, int h, bool map) ...@@ -1590,14 +1590,14 @@ handle_configuration(int w, int h, bool map)
handle_resize_event(w, h, map); handle_resize_event(w, h, map);
} }
static bool static void
x11_event(XEvent *ev) x11_event(XEvent *ev)
{ {
bool resize; bool resize;
int x, y, w, h; int x, y, w, h;
if (x11.XFilterEvent(ev, win)) if (x11.XFilterEvent(ev, win))
return false; return;
switch (ev->type) { switch (ev->type) {
case ReparentNotify: case ReparentNotify:
parent = ev->xreparent.parent; parent = ev->xreparent.parent;
...@@ -1605,8 +1605,11 @@ x11_event(XEvent *ev) ...@@ -1605,8 +1605,11 @@ x11_event(XEvent *ev)
case ClientMessage: case ClientMessage:
if (ev->xclient.format == 32 && ev->xclient.data.l[0] == A(WM_DELETE_WINDOW) && A(WM_DELETE_WINDOW) != None) { if (ev->xclient.format == 32 && ev->xclient.data.l[0] == A(WM_DELETE_WINDOW) && A(WM_DELETE_WINDOW) != None) {
uint16_t key=CIO_KEY_QUIT; uint16_t key=CIO_KEY_QUIT;
if (write(key_pipe[1], &key, 2) == -1) // Bow to GCC
return false; if (write(key_pipe[1], &key, 2) == EXIT_FAILURE)
return;
else
return;
} }
else if(ev->xclient.format == 32 && ev->xclient.data.l[0] == A(_NET_WM_PING) && A(_NET_WM_PING) != None) { else if(ev->xclient.format == 32 && ev->xclient.data.l[0] == A(_NET_WM_PING) && A(_NET_WM_PING) != None) {
ev->xclient.window = root; ev->xclient.window = root;
...@@ -1898,8 +1901,11 @@ x11_event(XEvent *ev) ...@@ -1898,8 +1901,11 @@ x11_event(XEvent *ev)
else else
ch = cpchar_from_unicode_cpoint(getcodepage(), wbuf[i], 0); ch = cpchar_from_unicode_cpoint(getcodepage(), wbuf[i], 0);
if (ch) { if (ch) {
if (write(key_pipe[1], &ch, 1) == -1) // Bow to GCC
return false; if (write(key_pipe[1], &ch, 1) == EXIT_SUCCESS)
return;
else
return;
} }
} }
break; break;
...@@ -2109,17 +2115,20 @@ x11_event(XEvent *ev) ...@@ -2109,17 +2115,20 @@ x11_event(XEvent *ev)
uint16_t key=scan; uint16_t key=scan;
if (key < 128) if (key < 128)
key = cpchar_from_unicode_cpoint(getcodepage(), key, key); key = cpchar_from_unicode_cpoint(getcodepage(), key, key);
if(write(key_pipe[1], &key, (scan&0xff)?1:2) == -1) // Bow to GCC
return false; if (write(key_pipe[1], &key, (scan & 0xff) ? 1 : 2) != EXIT_SUCCESS)
return;
else
return;
} }
break; break;
} }
return true; return;
} }
default: default:
break; break;
} }
return false; return;
} }
static void x11_terminate_event_thread(void) static void x11_terminate_event_thread(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment