diff options
author | lukefromdc <[email protected]> | 2023-10-01 16:48:48 -0400 |
---|---|---|
committer | Luke from DC <[email protected]> | 2023-10-02 23:35:02 +0000 |
commit | cf544b717345dc405b2e2f189d53d69a79120e8b (patch) | |
tree | 383f919efae4bb58abd5b5c0086d72af642967e6 | |
parent | f229fdc5f590f2e586a3e45c650794b6ce2f378b (diff) | |
download | mate-panel-cf544b717345dc405b2e2f189d53d69a79120e8b.tar.bz2 mate-panel-cf544b717345dc405b2e2f189d53d69a79120e8b.tar.xz |
Hidpi x11: center panel force-quit popup window
-rw-r--r-- | mate-panel/panel-force-quit.c | 7 |
1 files 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)); |