summaryrefslogtreecommitdiff
path: root/src/libxcwm/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxcwm/window.c')
-rw-r--r--src/libxcwm/window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c
index 68c725a..030a27a 100644
--- a/src/libxcwm/window.c
+++ b/src/libxcwm/window.c
@@ -99,6 +99,12 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window,
_xcwm_get_window_attributes(context->conn, new_window);
if ((!attrs) || (attrs->_class == XCB_WINDOW_CLASS_INPUT_ONLY))
return NULL;
+
+ xcb_get_geometry_reply_t *geom;
+ geom = _xcwm_get_window_geometry(context->conn, new_window);
+ if (!geom)
+ return NULL;
+
/* allocate memory for new xcwm_window_t and rectangles */
xcwm_window_t *window = malloc(sizeof(xcwm_window_t));
assert(window);
@@ -109,9 +115,6 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window,
window->sizing = calloc(1, sizeof(*window->sizing));
assert(window->dmg_bounds);;
- xcb_get_geometry_reply_t *geom;
- geom = _xcwm_get_window_geometry(context->conn, new_window);
-
/* set any available values from xcb_create_notify_event_t object pointer
and geom pointer */
window->context = context;