From cf544b717345dc405b2e2f189d53d69a79120e8b Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 1 Oct 2023 16:48:48 -0400 Subject: Hidpi x11: center panel force-quit popup window --- mate-panel/panel-force-quit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c index 5e38a1d2..cf9580b1 100644 --- a/mate-panel/panel-force-quit.c +++ b/mate-panel/panel-force-quit.c @@ -58,7 +58,7 @@ display_popup_window (GdkScreen *screen) GtkWidget *image; GtkWidget *frame; GtkWidget *label; - int screen_width, screen_height; + int screen_width, screen_height, scale; GtkAllocation allocation; retval = gtk_window_new (GTK_WINDOW_POPUP); @@ -93,14 +93,15 @@ display_popup_window (GdkScreen *screen) gtk_widget_realize (retval); + scale = gtk_widget_get_scale_factor (retval); screen_width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)); screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)); gtk_widget_get_allocation (retval, &allocation); gtk_window_move (GTK_WINDOW (retval), - (screen_width - allocation.width) / 2, - (screen_height - allocation.height) / 2); + (screen_width - (allocation.width * scale)) / (2 * scale), + (screen_height - (allocation.height * scale)) / (2 * scale)); gtk_widget_show (GTK_WIDGET (retval)); -- cgit v1.2.1