summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJess VanDerwalker <washu@sonic.net>2012-07-26 13:09:49 -0700
committerJess VanDerwalker <washu@sonic.net>2012-07-26 22:23:14 -0700
commit9dec87ed128568216ef244640484c294bcb3d776 (patch)
tree3a070b641c971dd3fa220f9143e9c45b27ffcb1e
parent6433adaa86b8f3c187bf5cca5bd7789209881558 (diff)
libxcwm: Configure requests for unmanaged windows accepted.
The configure requests for unmanaged windows are passed on and accepted with a call to xcb_configure_window in _xcwm_resize_window. Added x and y position information to _xcwm_resize_window and its call to xcb_configure_window. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
-rw-r--r--src/libxcwm/event_loop.c19
-rw-r--r--src/libxcwm/window.c24
-rw-r--r--src/libxcwm/xcwm_internal.h8
3 files changed, 21 insertions, 30 deletions
diff --git a/src/libxcwm/event_loop.c b/src/libxcwm/event_loop.c
index 6d55a71..24efd90 100644
--- a/src/libxcwm/event_loop.c
+++ b/src/libxcwm/event_loop.c
@@ -341,15 +341,16 @@ run_event_loop(void *thread_arg_struct)
{
xcb_configure_request_event_t *request =
(xcb_configure_request_event_t *)evt;
- printf("Got configure request: ");
- printf("x = %i, y = %i, w = %i, h = %i\n", request->x,
- request->y,
- request->width,
- request->height);
-
- /* Change the size of the window, but not its position */
- _xcwm_resize_window(event_conn, request->window,
- request->width, request->height);
+ xcwm_window_t *window =
+ _xcwm_get_window_node_by_window_id(request->window);
+ if (!window) {
+ /* Passing on requests for windows we aren't
+ * managing seems to speed window future mapping
+ * of window */
+ _xcwm_resize_window(event_conn, request->window,
+ request->x, request->y,
+ request->width, request->height);
+ }
break;
}
diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c
index 140673a..7877fb8 100644
--- a/src/libxcwm/window.c
+++ b/src/libxcwm/window.c
@@ -200,25 +200,11 @@ xcwm_window_configure(xcwm_window_t *window, int x, int y,
window->bounds->width = width;
window->bounds->height = height;
- uint32_t values[] = {
- (uint32_t)x, (uint32_t)y,
- (uint32_t)width, (uint32_t)height
- };
-
- xcb_configure_window(window->context->conn,
- window->window_id,
- XCB_CONFIG_WINDOW_X |
- XCB_CONFIG_WINDOW_Y |
- XCB_CONFIG_WINDOW_WIDTH |
- XCB_CONFIG_WINDOW_HEIGHT,
- values);
-
+ _xcwm_resize_window(window->context->conn, window->window_id,
+ x, y, width, height);
/* Set the damage area to the new window size so its redrawn properly */
window->dmg_bounds->width = width;
window->dmg_bounds->height = height;
-
- xcb_flush(window->context->conn);
- return;
}
void
@@ -395,13 +381,15 @@ xcwm_window_get_sizing(xcwm_window_t const *window)
/* Resize the window on server side */
void
_xcwm_resize_window(xcb_connection_t *conn, xcb_window_t window,
- int width, int height)
+ int x, int y, int width, int height)
{
- uint32_t values[2] = { width, height };
+ uint32_t values[] = { x, y, width, height };
xcb_configure_window(conn,
window,
+ XCB_CONFIG_WINDOW_X |
+ XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH |
XCB_CONFIG_WINDOW_HEIGHT,
values);
diff --git a/src/libxcwm/xcwm_internal.h b/src/libxcwm/xcwm_internal.h
index 19478df..b853d6f 100644
--- a/src/libxcwm/xcwm_internal.h
+++ b/src/libxcwm/xcwm_internal.h
@@ -267,15 +267,17 @@ void
_xcwm_window_release(xcwm_window_t *window);
/**
- * Resize the window to given width and height.
+ * Resize the window to given x, y, width and height.
* @param conn The connection
* @param window The id of window to resize
+ * @param x The new x position of window, relative to root.
+ * @param y The new y position of window, relative to root.
* @param width The new width
* @param height The new height
*/
void
-_xcwm_resize_window(xcb_connection_t *conn, xcb_window_t window, int width,
- int height);
+_xcwm_resize_window(xcb_connection_t *conn, xcb_window_t window,
+ int x, int y, int width, int height);
/**
* Map the given window.