openbsd-ports/devel/startup-notification/patches/patch-test_test-watch-xmessages-xcb_c
2009-12-25 21:36:22 +00:00

42 lines
1.3 KiB
Plaintext

$OpenBSD: patch-test_test-watch-xmessages-xcb_c,v 1.1 2009/12/25 21:36:22 phessler Exp $
--- test/test-watch-xmessages-xcb.c.orig Fri Dec 25 14:25:33 2009
+++ test/test-watch-xmessages-xcb.c Fri Dec 25 14:26:45 2009
@@ -75,6 +75,10 @@ main (int argc, char **argv)
{
xcb_connection_t *xconnection;
SnDisplay *display;
+ int screen;
+ xcb_screen_t *s;
+ const uint32_t select_input_val[] = { XCB_EVENT_MASK_PROPERTY_CHANGE };
+ xcb_generic_event_t *xevent;
if (argc != 3)
{
@@ -82,7 +86,6 @@ main (int argc, char **argv)
return 1;
}
- int screen;
xconnection = xcb_connect (NULL, &screen);
if (xconnection == NULL)
{
@@ -92,8 +95,7 @@ main (int argc, char **argv)
/* We have to select for property events on one root window
*/
- xcb_screen_t *s = xcb_aux_get_screen (xconnection, screen);
- const uint32_t select_input_val[] = { XCB_EVENT_MASK_PROPERTY_CHANGE };
+ s = xcb_aux_get_screen (xconnection, screen);
xcb_change_window_attributes (xconnection, s->root, XCB_CW_EVENT_MASK,
select_input_val);
@@ -106,7 +108,7 @@ main (int argc, char **argv)
while (TRUE)
{
- xcb_generic_event_t *xevent = xcb_wait_for_event (xconnection);
+ xevent = xcb_wait_for_event (xconnection);
sn_xcb_display_process_event (display, xevent);