toytoolkit: Recalculate input region if client has modified it's size.
If a client changes it's width/height values in it's widget resize handler, the input region will be wrong because of the assumptions toytoolkit makes in frame_resize_handler(). So far, gears is the only client that does this.
This commit is contained in:
committed by
Kristian Høgsberg
parent
79b5652de6
commit
f7e498cb89
+11
-10
@@ -1175,13 +1175,6 @@ frame_resize_handler(struct widget *widget,
|
|||||||
allocation.width = width - decoration_width;
|
allocation.width = width - decoration_width;
|
||||||
allocation.height = height - decoration_height;
|
allocation.height = height - decoration_height;
|
||||||
|
|
||||||
widget->window->input_region =
|
|
||||||
wl_compositor_create_region(display->compositor);
|
|
||||||
wl_region_add(widget->window->input_region,
|
|
||||||
frame->margin, frame->margin,
|
|
||||||
width - 2 * frame->margin,
|
|
||||||
height - 2 * frame->margin);
|
|
||||||
|
|
||||||
opaque_margin = frame->margin + display->frame_radius;
|
opaque_margin = frame->margin + display->frame_radius;
|
||||||
|
|
||||||
wl_list_for_each(button, &frame->buttons_list, link)
|
wl_list_for_each(button, &frame->buttons_list, link)
|
||||||
@@ -1209,9 +1202,17 @@ frame_resize_handler(struct widget *widget,
|
|||||||
allocation.height,
|
allocation.height,
|
||||||
child->user_data);
|
child->user_data);
|
||||||
|
|
||||||
widget_set_allocation(widget, 0, 0,
|
width = child->allocation.width + decoration_width;
|
||||||
child->allocation.width + decoration_width,
|
height = child->allocation.height + decoration_height;
|
||||||
child->allocation.height + decoration_height);
|
|
||||||
|
widget->window->input_region =
|
||||||
|
wl_compositor_create_region(display->compositor);
|
||||||
|
wl_region_add(widget->window->input_region,
|
||||||
|
frame->margin, frame->margin,
|
||||||
|
width - 2 * frame->margin,
|
||||||
|
height - 2 * frame->margin);
|
||||||
|
|
||||||
|
widget_set_allocation(widget, 0, 0, width, height);
|
||||||
|
|
||||||
if (child->opaque) {
|
if (child->opaque) {
|
||||||
widget->window->opaque_region =
|
widget->window->opaque_region =
|
||||||
|
|||||||
Reference in New Issue
Block a user