diff options
| author | Victor Kareh <[email protected]> | 2026-01-13 12:54:59 -0500 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-01-15 07:40:57 -0500 |
| commit | becf37b2e138634415f1d3c5ccbf39c08c9441b8 (patch) | |
| tree | afa910a410f19e79261091eb1da2cdf0be0c2ca5 /applets | |
| parent | 90cb464a6b9ec02159ad8f4696b93696c92d9811 (diff) | |
| download | mate-power-manager-becf37b2e138634415f1d3c5ccbf39c08c9441b8.tar.bz2 mate-power-manager-becf37b2e138634415f1d3c5ccbf39c08c9441b8.tar.xz | |
power-profiles: Fix menu positioning in Wayland
Properly anchor the popup menu to the applet widget to fix the menu
appearing in the center of the screen under Wayland.
Diffstat (limited to 'applets')
| -rw-r--r-- | applets/power-profiles/power-profiles-applet.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/applets/power-profiles/power-profiles-applet.c b/applets/power-profiles/power-profiles-applet.c index 7b3c06d..e3bb810 100644 --- a/applets/power-profiles/power-profiles-applet.c +++ b/applets/power-profiles/power-profiles-applet.c @@ -319,7 +319,7 @@ gpm_applet_popup_cleared_cb (GtkWidget *widget, GpmPowerProfilesApplet *applet) * Display the popup menu. **/ static void -gpm_applet_popup_menu (GpmPowerProfilesApplet *applet, guint32 timestamp) +gpm_applet_popup_menu (GpmPowerProfilesApplet *applet) { GtkMenu *menu; @@ -327,8 +327,10 @@ gpm_applet_popup_menu (GpmPowerProfilesApplet *applet, guint32 timestamp) /* show the menu */ gtk_widget_show_all (GTK_WIDGET (menu)); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, - applet, 1, timestamp); + gtk_menu_popup_at_widget (GTK_MENU (menu), GTK_WIDGET (applet), + GDK_GRAVITY_SOUTH_WEST, + GDK_GRAVITY_NORTH_WEST, + NULL); g_signal_connect (GTK_WIDGET (menu), "hide", G_CALLBACK (gpm_applet_popup_cleared_cb), applet); @@ -348,7 +350,7 @@ gpm_applet_click_cb (GpmPowerProfilesApplet *applet, GdkEventButton *event) return FALSE; } - gpm_applet_popup_menu (applet, gtk_get_current_event_time()); + gpm_applet_popup_menu (applet); gpm_applet_get_power_profile (applet); gpm_applet_update_icon (applet); |
