summaryrefslogtreecommitdiff
path: root/applets/notification_area
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-10-16 00:08:41 -0400
committerlukefromdc <[email protected]>2017-10-16 00:08:41 -0400
commit6c6b662131c17f6e19835c32151ad17068118f11 (patch)
tree5faa31c35168e2cb7f113c4043bcf64d92da609e /applets/notification_area
parent42c22dccba296dae429a2bd60adfcba615308932 (diff)
downloadmate-panel-6c6b662131c17f6e19835c32151ad17068118f11.tar.bz2
mate-panel-6c6b662131c17f6e19835c32151ad17068118f11.tar.xz
Apply position fix on popup to GTK 3.20 and earlier
Diffstat (limited to 'applets/notification_area')
-rw-r--r--applets/notification_area/status-notifier/sn-dbus-menu.c6
-rw-r--r--applets/notification_area/status-notifier/sn-item.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/applets/notification_area/status-notifier/sn-dbus-menu.c b/applets/notification_area/status-notifier/sn-dbus-menu.c
index a9075bd6..855c2569 100644
--- a/applets/notification_area/status-notifier/sn-dbus-menu.c
+++ b/applets/notification_area/status-notifier/sn-dbus-menu.c
@@ -111,7 +111,6 @@ layout_update_item (SnDBusMenu *menu,
{
sn_dbus_menu_item_update_props (item, props);
}
-
return item->submenu;
}
@@ -179,8 +178,11 @@ get_layout_cb (GObject *source_object,
g_hash_table_remove_all (menu->items);
layout_parse (menu, layout, GTK_MENU (menu));
- /*Reposition to accomodate size change if necessary*/
+#if GTK_CHECK_VERSION (3, 22, 0)
+ /* Reposition menu to accomodate any size changes */
+ /* Menu size never changes with GTK 3.20 or earlier */
gtk_menu_reposition(GTK_MENU(menu));
+#endif
g_variant_unref (layout);
}
diff --git a/applets/notification_area/status-notifier/sn-item.c b/applets/notification_area/status-notifier/sn-item.c
index 3bba668a..e305fdad 100644
--- a/applets/notification_area/status-notifier/sn-item.c
+++ b/applets/notification_area/status-notifier/sn-item.c
@@ -277,6 +277,8 @@ sn_item_button_press_event (GtkWidget *widget,
gtk_menu_popup (priv->menu, NULL, NULL,
sn_item_popup_menu_position_func, widget,
event->button, event->time);
+ /*Fix positioning if size changed since last shown*/
+ gtk_menu_reposition(priv->menu);
#endif
}
else
@@ -329,6 +331,8 @@ sn_item_popup_menu (GtkWidget *widget)
gtk_menu_popup (priv->menu, NULL, NULL,
sn_item_popup_menu_position_func, widget,
button, active_time);
+ /*Fix positioning if size changed since last shown*/
+ gtk_menu_reposition(priv->menu);
#endif
}
else