forked from AuroraMiddleware/gtk
GtkWindow: Check for GtkWidget-window-dragging in multipress gesture
This partly reverts 9f5b9c0e07
, which
removed the check for GtkWidget-window-dragging in the multipress
gesture. This check is still needed for widgets which have this style
property set (e.g. menubars and toolbars) can maximize the window on
double click -- but those widgets which have it set to FALSE shouldn't
maximize the window.
This commit is contained in:
parent
0c1cc9832f
commit
92de947d5e
@ -1429,12 +1429,13 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
|
||||
gdouble y,
|
||||
GtkWindow *window)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkWidget *event_widget, *widget;
|
||||
GdkEventSequence *sequence;
|
||||
GtkWindowRegion region;
|
||||
GtkWindowPrivate *priv;
|
||||
const GdkEvent *event;
|
||||
guint button;
|
||||
gboolean window_drag = FALSE;
|
||||
|
||||
widget = GTK_WIDGET (window);
|
||||
priv = gtk_window_get_instance_private (window);
|
||||
@ -1477,12 +1478,25 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
|
||||
else if (button != GDK_BUTTON_PRIMARY)
|
||||
return;
|
||||
|
||||
event_widget = gtk_get_event_widget ((GdkEvent *) event);
|
||||
|
||||
if (region == GTK_WINDOW_REGION_TITLE)
|
||||
gdk_window_raise (_gtk_widget_get_window (widget));
|
||||
|
||||
switch (region)
|
||||
{
|
||||
case GTK_WINDOW_REGION_CONTENT:
|
||||
if (event_widget != widget)
|
||||
gtk_widget_style_get (event_widget, "window-dragging", &window_drag, NULL);
|
||||
|
||||
if (!window_drag)
|
||||
{
|
||||
gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
|
||||
sequence, GTK_EVENT_SEQUENCE_DENIED);
|
||||
return;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
case GTK_WINDOW_REGION_TITLE:
|
||||
if (n_press == 2)
|
||||
gtk_window_titlebar_action (window, event, button, n_press);
|
||||
|
Loading…
Reference in New Issue
Block a user