From c3d42c4c2caec6bd3a868d0623b78336bd93fc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rodr=C3=ADguez?= <ruben@trisquel.info> Date: Thu, 15 Nov 2012 20:00:29 +0100 Subject: [PATCH] Fixed indicator applet menu scrolling --- .../indicator-applet-scroll-arrows.patch | 13 ++++++++++--- helpers/make-indicator-applet | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/helpers/DATA/indicator-applet/indicator-applet-scroll-arrows.patch b/helpers/DATA/indicator-applet/indicator-applet-scroll-arrows.patch index 38850063..a6fb9ce5 100644 --- a/helpers/DATA/indicator-applet/indicator-applet-scroll-arrows.patch +++ b/helpers/DATA/indicator-applet/indicator-applet-scroll-arrows.patch @@ -3,7 +3,7 @@ diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c --- indicator-applet/src/applet-main.c +++ indicator-applet/src/applet-main.c -@@ -362,6 +362,21 @@ accessible_desc_update (IndicatorObject +@@ -362,6 +362,24 @@ accessible_desc_update (IndicatorObject return; } @@ -11,25 +11,32 @@ diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c +do_menu_reposition(gpointer menu) +{ + gtk_widget_set_size_request(menu, -1, -1); ++ gtk_menu_reposition(menu); ++ g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu); + g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu); + return 0; +} + +static void +on_menuitem_show (GtkMenuItem *menuitem, gpointer menu) -+{ ++{ + gtk_widget_set_size_request(menu, -1, 500); ++ gtk_menu_reposition(menu); + g_idle_add((GSourceFunc) do_menu_reposition, (gpointer) menu); +} + static void entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar) { -@@ -435,6 +450,7 @@ entry_added (IndicatorObject * io, Indic +@@ -435,6 +450,11 @@ entry_added (IndicatorObject * io, Indic if (entry->menu != NULL) { gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu)); + g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(on_menuitem_show), entry->menu); ++ gtk_menu_set_reserve_toggle_size(entry->menu, TRUE); ++ gtk_widget_set_size_request(entry->menu, -1, -1); ++ gtk_widget_set_size_request(entry->menu, -1, 500); ++ gtk_menu_reposition(entry->menu); } place_in_menu(menubar, menuitem, io, entry); diff --git a/helpers/make-indicator-applet b/helpers/make-indicator-applet index fbae43e1..80683568 100644 --- a/helpers/make-indicator-applet +++ b/helpers/make-indicator-applet @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -VERSION=1 +VERSION=2 . ./config -- GitLab