Fix a problem with window dragging

Dragging windows was not working on widgets in the titlebar
region unless they had the window-dragging style property
set. Fix this by looking at the region for motion notify
events as well as for buton press events.
This commit is contained in:
Matthias Clasen 2014-02-15 20:41:58 -05:00
parent 3c981d23dc
commit 8bd94a9515

View File

@ -7687,6 +7687,8 @@ gtk_window_motion_notify_event (GtkWidget *widget,
GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv; GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
GtkWidget *src; GtkWidget *src;
gboolean window_drag; gboolean window_drag;
gint x, y;
GtkWindowRegion region;
if (!priv->drag_possible) if (!priv->drag_possible)
return FALSE; return FALSE;
@ -7697,6 +7699,17 @@ gtk_window_motion_notify_event (GtkWidget *widget,
gtk_widget_style_get (GTK_WIDGET (src), gtk_widget_style_get (GTK_WIDGET (src),
"window-dragging", &window_drag, "window-dragging", &window_drag,
NULL); NULL);
gtk_widget_translate_coordinates (src, widget, event->x, event->y, &x, &y);
}
else
{
x = event->x;
y = event->y;
}
region = get_active_region_type (GTK_WINDOW (widget), (GdkEventAny*)event, x, y);
if (region == GTK_WINDOW_REGION_CONTENT)
{
if (!window_drag) if (!window_drag)
{ {
priv->drag_possible = FALSE; priv->drag_possible = FALSE;