Skip to content

Commit

Permalink
Fixed XCB uninitialized bytes in wakeupconnection(), dwm.c (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerjenigeUberMensch authored Jul 3, 2024
1 parent 1baf1bb commit 7af9d7c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,14 +1589,15 @@ wakeupconnection(XCBDisplay *display, int screen)
{ DEBUG0("No connection avaible");
return;
}
XCBClientMessageEvent ev;
memset(&ev, 0, sizeof(XCBClientMessageEvent));
ev.type = wmatom[WMProtocols];
ev.response_type = XCB_CLIENT_MESSAGE;
ev.window = _wm.root;
ev.format = 32;
ev.data.data32[0] = wmatom[WMDeleteWindow];
ev.data.data32[1] = XCB_CURRENT_TIME;
XCBGenericEvent ev;
XCBClientMessageEvent *cev = (XCBClientMessageEvent *)&ev;
memset(&ev, 0, sizeof(XCBGenericEvent));
cev->type = wmatom[WMProtocols];
cev->response_type = XCB_CLIENT_MESSAGE;
cev->window = _wm.root;
cev->format = 32;
cev->data.data32[0] = wmatom[WMDeleteWindow];
cev->data.data32[1] = XCB_CURRENT_TIME;
/* XCB_EVENT_MASK_NO_EVENT legit does nothing lol */
XCBSendEvent(display, XCBRootWindow(display, screen), False, XCB_EVENT_MASK_STRUCTURE_NOTIFY, (const char *)&ev);
/* make sure display gets the event (duh) */
Expand Down

0 comments on commit 7af9d7c

Please sign in to comment.