Commit 332d1892 authored by Ian Ray's avatar Ian Ray Committed by Daniel Stone

xwm: do not include shadow in input region

The window frame was created with position and size which include
an offset for margins and shadow.  Set the input region to ignore
shadow.

[daniels: Fixed type mismatch, removed unused variable.]
Signed-off-by: default avatarIan Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
Tested-by: Scott Moreau's avatarScott Moreau <oreaus@gmail.com>
parent 8564a0d1
......@@ -641,6 +641,20 @@ weston_wm_window_get_child_position(struct weston_wm_window *window,
}
}
static void
weston_wm_window_get_input_rect(struct weston_wm_window *window,
int32_t *x, int32_t *y,
int32_t *width, int32_t *height)
{
if (!window->decorate) {
weston_wm_window_get_child_position(window, x, y);
*width = window->width;
*height = window->height;
} else {
frame_input_rect(window->frame, x, y, width, height);
}
}
static void
weston_wm_window_send_configure_notify(struct weston_wm_window *window)
{
......@@ -966,6 +980,7 @@ weston_wm_window_create_frame(struct weston_wm_window *window)
{
struct weston_wm *wm = window->wm;
uint32_t values[3];
xcb_rectangle_t rect;
int x, y, width, height;
int buttons = FRAME_BUTTON_CLOSE;
......@@ -1020,6 +1035,25 @@ weston_wm_window_create_frame(struct weston_wm_window *window)
&wm->format_rgba,
width, height);
weston_wm_window_get_input_rect(window, &x, &y, &width, &height);
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
/* The window frame was created with position and size which include
* an offset for margins and shadow. Set the input region to ignore
* shadow. */
xcb_shape_rectangles(wm->conn,
XCB_SHAPE_SO_SET,
XCB_SHAPE_SK_INPUT,
0,
window->frame_id,
0,
0,
1,
&rect);
hash_table_insert(wm->window_hash, window->frame_id, window);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment