forked from AuroraMiddleware/gtk
csd: Fix invisible border/shadow confusion
We did not set an input shape on the window, so the region outside the invisible border where we draw the outer edges of the shadow were still part of the window, as far as clicks and cursors were concerned. Fix this by setting an input shape that makes all clicks outside of the resize borders go through to the underlying window. https://bugzilla.gnome.org/show_bug.cgi?id=726125
This commit is contained in:
parent
ff0c470e34
commit
5b341e8e6e
@ -6512,6 +6512,16 @@ max_borders (GtkBorder *one,
|
||||
one->left = MAX (one->left, two->left);
|
||||
}
|
||||
|
||||
static void
|
||||
subtract_borders (GtkBorder *one,
|
||||
GtkBorder *two)
|
||||
{
|
||||
one->top -= two->top;
|
||||
one->right -= two->right;
|
||||
one->bottom -= two->bottom;
|
||||
one->left -= two->left;
|
||||
}
|
||||
|
||||
static void
|
||||
add_window_frame_style_class (GtkStyleContext *context)
|
||||
{
|
||||
@ -6834,6 +6844,19 @@ update_border_windows (GtkWindow *window)
|
||||
gdk_window_hide (priv->border_window[GDK_WINDOW_EDGE_WEST]);
|
||||
gdk_window_hide (priv->border_window[GDK_WINDOW_EDGE_EAST]);
|
||||
}
|
||||
|
||||
/* we also update the input shape, which makes it so that clicks
|
||||
* outside the border windows go through
|
||||
*/
|
||||
|
||||
subtract_borders (&window_border, &border);
|
||||
rect.x = window_border.left;
|
||||
rect.y = window_border.top;
|
||||
rect.width = gtk_widget_get_allocated_width (widget) - window_border.left - window_border.right;
|
||||
rect.height = gtk_widget_get_allocated_height (widget) - window_border.top - window_border.bottom;
|
||||
region = cairo_region_create_rectangle (&rect);
|
||||
gtk_widget_input_shape_combine_region (widget, region);
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user