|
|
f95c2c |
diff -up gtk+-2.24.7/gtk/gtkmenushell.c.window-dragging gtk+-2.24.7/gtk/gtkmenushell.c
|
|
|
f95c2c |
--- gtk+-2.24.7/gtk/gtkmenushell.c.window-dragging 2011-08-15 22:30:52.000000000 -0400
|
|
|
f95c2c |
+++ gtk+-2.24.7/gtk/gtkmenushell.c 2011-10-17 19:50:52.180468086 -0400
|
|
|
f95c2c |
@@ -589,18 +589,45 @@ gtk_menu_shell_button_press (GtkWidget
|
|
|
f95c2c |
|
|
|
f95c2c |
if (!menu_shell->active || !menu_shell->button)
|
|
|
f95c2c |
{
|
|
|
f95c2c |
- _gtk_menu_shell_activate (menu_shell);
|
|
|
f95c2c |
+ gboolean initially_active = menu_shell->active;
|
|
|
f95c2c |
|
|
|
f95c2c |
menu_shell->button = event->button;
|
|
|
f95c2c |
|
|
|
f95c2c |
- if (menu_item && _gtk_menu_item_is_selectable (menu_item) &&
|
|
|
f95c2c |
- menu_item->parent == widget &&
|
|
|
f95c2c |
- menu_item != menu_shell->active_menu_item)
|
|
|
f95c2c |
+ if (menu_item)
|
|
|
f95c2c |
{
|
|
|
f95c2c |
- if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
|
|
|
f95c2c |
+ if (_gtk_menu_item_is_selectable (menu_item) &&
|
|
|
f95c2c |
+ menu_item->parent == widget &&
|
|
|
f95c2c |
+ menu_item != menu_shell->active_menu_item)
|
|
|
f95c2c |
{
|
|
|
f95c2c |
- menu_shell->activate_time = event->time;
|
|
|
f95c2c |
- gtk_menu_shell_select_item (menu_shell, menu_item);
|
|
|
f95c2c |
+ _gtk_menu_shell_activate (menu_shell);
|
|
|
f95c2c |
+ menu_shell->button = event->button;
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ menu_shell->activate_time = event->time;
|
|
|
f95c2c |
+ gtk_menu_shell_select_item (menu_shell, menu_item);
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
+ else
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ if (!initially_active)
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ gboolean window_drag = FALSE;
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ gtk_widget_style_get (widget,
|
|
|
f95c2c |
+ "window-dragging", &window_drag,
|
|
|
f95c2c |
+ NULL);
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ if (window_drag)
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ gtk_menu_shell_deactivate (menu_shell);
|
|
|
f95c2c |
+ gtk_window_begin_move_drag (GTK_WINDOW (gtk_widget_get_toplevel (widget)),
|
|
|
f95c2c |
+ event->button,
|
|
|
f95c2c |
+ event->x_root,
|
|
|
f95c2c |
+ event->y_root,
|
|
|
f95c2c |
+ event->time);
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
}
|
|
|
f95c2c |
}
|
|
|
f95c2c |
}
|
|
|
f95c2c |
diff -up gtk+-2.24.7/gtk/gtktoolbar.c.window-dragging gtk+-2.24.7/gtk/gtktoolbar.c
|
|
|
f95c2c |
--- gtk+-2.24.7/gtk/gtktoolbar.c.window-dragging 2011-10-01 11:29:06.000000000 -0400
|
|
|
f95c2c |
+++ gtk+-2.24.7/gtk/gtktoolbar.c 2011-10-17 19:52:56.104463657 -0400
|
|
|
f95c2c |
@@ -2701,6 +2701,8 @@ static gboolean
|
|
|
f95c2c |
gtk_toolbar_button_press (GtkWidget *toolbar,
|
|
|
f95c2c |
GdkEventButton *event)
|
|
|
f95c2c |
{
|
|
|
f95c2c |
+ GtkWidget *window;
|
|
|
f95c2c |
+
|
|
|
f95c2c |
if (_gtk_button_event_triggers_context_menu (event))
|
|
|
f95c2c |
{
|
|
|
f95c2c |
gboolean return_value;
|
|
|
f95c2c |
@@ -2711,7 +2713,29 @@ gtk_toolbar_button_press (GtkWidget
|
|
|
f95c2c |
|
|
|
f95c2c |
return return_value;
|
|
|
f95c2c |
}
|
|
|
f95c2c |
-
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ window = gtk_widget_get_toplevel (toolbar);
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ if (window)
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ gboolean window_drag = FALSE;
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ gtk_widget_style_get (toolbar,
|
|
|
f95c2c |
+ "window-dragging", &window_drag,
|
|
|
f95c2c |
+ NULL);
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ if (window_drag)
|
|
|
f95c2c |
+ {
|
|
|
f95c2c |
+ gtk_window_begin_move_drag (GTK_WINDOW (window),
|
|
|
f95c2c |
+ event->button,
|
|
|
f95c2c |
+ event->x_root,
|
|
|
f95c2c |
+ event->y_root,
|
|
|
f95c2c |
+ event->time);
|
|
|
f95c2c |
+
|
|
|
f95c2c |
+ return TRUE;
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
+ }
|
|
|
f95c2c |
+
|
|
|
f95c2c |
return FALSE;
|
|
|
f95c2c |
}
|
|
|
f95c2c |
|
|
|
f95c2c |
diff -up gtk+-2.24.7/gtk/gtkwidget.c.window-dragging gtk+-2.24.7/gtk/gtkwidget.c
|
|
|
f95c2c |
--- gtk+-2.24.7/gtk/gtkwidget.c.window-dragging 2011-10-17 19:50:52.175468086 -0400
|
|
|
f95c2c |
+++ gtk+-2.24.7/gtk/gtkwidget.c 2011-10-17 19:50:52.184468086 -0400
|
|
|
f95c2c |
@@ -2467,6 +2467,13 @@ gtk_widget_class_init (GtkWidgetClass *k
|
|
|
f95c2c |
0.0, 1.0, 0.04,
|
|
|
f95c2c |
GTK_PARAM_READABLE));
|
|
|
f95c2c |
|
|
|
f95c2c |
+ gtk_widget_class_install_style_property (klass,
|
|
|
f95c2c |
+ g_param_spec_boolean ("window-dragging",
|
|
|
f95c2c |
+ P_("Window dragging"),
|
|
|
f95c2c |
+ P_("Window dragging"),
|
|
|
f95c2c |
+ FALSE,
|
|
|
f95c2c |
+ GTK_PARAM_READWRITE));
|
|
|
f95c2c |
+
|
|
|
f95c2c |
/**
|
|
|
f95c2c |
* GtkWidget:draw-border:
|
|
|
f95c2c |
*
|