This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move i3 sync code into sync_respond (for following commits)
- Loading branch information
1 parent
4e0bf58
commit 725ee3c
Showing
5 changed files
with
45 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* vim:ts=4:sw=4:expandtab | ||
* | ||
* i3 - an improved dynamic tiling window manager | ||
* © 2009 Michael Stapelberg and contributors (see also: LICENSE) | ||
* | ||
* sync.c: i3 sync protocol: https://i3wm.org/docs/testsuite.html#i3_sync | ||
* | ||
*/ | ||
#pragma once | ||
|
||
#include <xcb/xcb.h> | ||
|
||
void sync_respond(xcb_window_t window, uint32_t rnd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* vim:ts=4:sw=4:expandtab | ||
* | ||
* i3 - an improved dynamic tiling window manager | ||
* © 2009 Michael Stapelberg and contributors (see also: LICENSE) | ||
* | ||
* sync.c: i3 sync protocol: https://i3wm.org/docs/testsuite.html#i3_sync | ||
* | ||
*/ | ||
#include "all.h" | ||
|
||
void sync_respond(xcb_window_t window, uint32_t rnd) { | ||
DLOG("[i3 sync protocol] Sending random value %d back to X11 window 0x%08x\n", rnd, window); | ||
|
||
void *reply = scalloc(32, 1); | ||
xcb_client_message_event_t *ev = reply; | ||
|
||
ev->response_type = XCB_CLIENT_MESSAGE; | ||
ev->window = window; | ||
ev->type = A_I3_SYNC; | ||
ev->format = 32; | ||
ev->data.data32[0] = window; | ||
ev->data.data32[1] = rnd; | ||
|
||
xcb_send_event(conn, false, window, XCB_EVENT_MASK_NO_EVENT, (char *)ev); | ||
xcb_flush(conn); | ||
free(reply); | ||
} |