summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-11-07 21:50:19 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-11-21 14:03:06 +0000
commitcab5f3eebfe11d10677e9ed0acd5ae10000effbf (patch)
tree5e042f11db7527e708693250aa7955b68e4a66e5
parent400235ac9aae4ca4e632cd8db037e9c37b3fd1b2 (diff)
Make sure we handle a NULL return from xcwm_window_create() in MAP_REQUEST
It's not nice to fail to call xcb_map_window() in XCB_MAP_REQUEST, it leaves a window which tries to map in the unmapped state...
-rw-r--r--src/libxcwm/event_loop.c7
-rw-r--r--src/libxcwm/window.c8
-rw-r--r--src/libxcwm/xcwm_internal.h8
3 files changed, 6 insertions, 17 deletions
diff --git a/src/libxcwm/event_loop.c b/src/libxcwm/event_loop.c
index 758fd46..bf49c38 100644
--- a/src/libxcwm/event_loop.c
+++ b/src/libxcwm/event_loop.c
@@ -395,6 +395,11 @@ run_event_loop(void *thread_arg_struct)
{
xcb_map_request_event_t *request =
(xcb_map_request_event_t *)evt;
+
+ /* Map the window */
+ xcb_map_window(context->conn, request->window);
+ xcb_flush(context->conn);
+
return_evt = malloc(sizeof(xcwm_event_t));
return_evt->window =
_xcwm_window_create(context, request->window,
@@ -403,7 +408,7 @@ run_event_loop(void *thread_arg_struct)
free(return_evt);
break;
}
- _xcwm_map_window(event_conn, return_evt->window);
+
return_evt->event_type = XCWM_EVENT_WINDOW_CREATE;
callback_ptr(return_evt);
break;
diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c
index e17fb94..4f3550c 100644
--- a/src/libxcwm/window.c
+++ b/src/libxcwm/window.c
@@ -554,14 +554,6 @@ _xcwm_resize_window(xcb_connection_t *conn, xcb_window_t window,
}
void
-_xcwm_map_window(xcb_connection_t *conn, xcwm_window_t *window)
-{
- /* Map the window. May want to handle other things here */
- xcb_map_window(conn, window->window_id);
- xcb_flush(conn);
-}
-
-void
set_window_event_masks(xcb_connection_t *conn, xcwm_window_t *window)
{
uint32_t values[1] = { XCB_EVENT_MASK_PROPERTY_CHANGE };
diff --git a/src/libxcwm/xcwm_internal.h b/src/libxcwm/xcwm_internal.h
index 38c3834..698a19c 100644
--- a/src/libxcwm/xcwm_internal.h
+++ b/src/libxcwm/xcwm_internal.h
@@ -268,14 +268,6 @@ void
_xcwm_resize_window(xcb_connection_t *conn, xcb_window_t window,
int x, int y, int width, int height);
-/**
- * Map the given window.
- * @param conn The connection to xserver
- * @param window The window to map
- */
-void
-_xcwm_map_window(xcb_connection_t *conn, xcwm_window_t *window);
-
/****************
* atoms.c