Skip to content
Snippets Groups Projects
Commit 91c5d533 authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Updated indicator-applet

parent 78028ba7
No related branches found
No related tags found
No related merge requests found
# Fixes https://bugs.launchpad.net/indicator-applet/+bug/965953 # Fixes https://bugs.launchpad.net/indicator-applet/+bug/965953
--- indicator-applet-12.10.2+14.04.20140403/src/applet-main.c 2014-04-03 01:10:57.000000000 +0000
diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c +++ indicator-applet-12.10.2+14.04.20140403.mod/src/applet-main.c 2014-05-20 21:34:34.856698376 +0000
--- indicator-applet/src/applet-main.c @@ -364,6 +364,24 @@
+++ indicator-applet/src/applet-main.c
@@ -362,6 +362,24 @@ accessible_desc_update (IndicatorObject
return; return;
} }
+static gboolean +static void
+do_menu_reposition(gpointer menu) +do_menu_reposition(gpointer menu)
+{ +{
+ gtk_widget_set_size_request(menu, -1, -1); + gtk_widget_set_size_request(menu, 0,0);
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+ gtk_menu_reposition(menu); + gtk_menu_reposition(menu);
+ g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu); + while (gtk_events_pending ())
+ g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu); + gtk_main_iteration ();
+ return 0;
+} +}
+ +
+static void +static void
+on_menuitem_show (GtkMenuItem *menuitem, gpointer menu) +on_menuitem_show (GtkMenuItem *menuitem, gpointer menu)
+{ +{
+ gtk_widget_set_size_request(menu, -1, 500); + gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL,NULL);
+ gtk_menu_reposition(menu);
+ g_idle_add((GSourceFunc) do_menu_reposition, (gpointer) menu); + g_idle_add((GSourceFunc) do_menu_reposition, (gpointer) menu);
+} +}
+ +
static void static GtkWidget*
entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar) create_menuitem (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)
{ {
@@ -435,6 +450,11 @@ entry_added (IndicatorObject * io, Indic @@ -415,6 +433,7 @@
if (entry->menu != NULL) {
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu)); 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);
} }
+ g_signal_connect(G_OBJECT(entry->menu), "show", G_CALLBACK(on_menuitem_show), entry->menu);
place_in_menu(menubar, menuitem, io, entry); place_in_menu(menubar, menuitem, io, entry);
return menuitem;
#!/bin/sh
#
# Copyright (C) 2008-2010 Rubén Rodríguez <ruben@trisquel.info>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=2
. ./config
# Fixes https://bugs.launchpad.net/indicator-applet/+bug/965953
cat << EOF | patch -p1
--- indicator-applet-12.10.2+14.04.20140403/src/applet-main.c 2014-04-03 01:10:57.000000000 +0000
+++ indicator-applet-12.10.2+14.04.20140403.mod/src/applet-main.c 2014-05-20 21:34:34.856698376 +0000
@@ -364,6 +364,24 @@
return;
}
+static void
+do_menu_reposition(gpointer menu)
+{
+ gtk_widget_set_size_request(menu, 0,0);
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+ gtk_menu_reposition(menu);
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+}
+
+static void
+on_menuitem_show (GtkMenuItem *menuitem, gpointer menu)
+{
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL,NULL);
+ g_idle_add((GSourceFunc) do_menu_reposition, (gpointer) menu);
+}
+
static GtkWidget*
create_menuitem (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)
{
@@ -415,6 +433,7 @@
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));
}
+ g_signal_connect(G_OBJECT(entry->menu), "show", G_CALLBACK(on_menuitem_show), entry->menu);
place_in_menu(menubar, menuitem, io, entry);
return menuitem;
EOF
changelog "Fixes LP:965953"
compile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment