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