summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2023-08-07 00:41:32 -0400
committerLuke from DC <[email protected]>2023-08-09 23:25:08 +0000
commitb35bbb991536b7cc21b4c77ba993954a40316dd9 (patch)
tree1173ad410b529ecad5594d6140a3e0ced394514c
parente99f157740660e6ef28f1bba7560cb9d52d5d1ad (diff)
downloadmate-control-center-b35bbb991536b7cc21b4c77ba993954a40316dd9.tar.bz2
mate-control-center-b35bbb991536b7cc21b4c77ba993954a40316dd9.tar.xz
Wayland: remove xisms from screen width detection
*This permits the control center to run on wayland and simplifies to code
-rw-r--r--libslab/app-shell.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index 116194cd..0c0aafb4 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -265,9 +265,19 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar *
right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
num_cols = SIZING_SCREEN_WIDTH_LARGE_NUMCOLS;
- if (WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) <= SIZING_SCREEN_WIDTH_LARGE)
+
+ GdkRectangle geometry = {0};
+
+ GdkDisplay *display;
+ GdkMonitor *monitor;
+
+ display= gdk_screen_get_display (gdk_screen_get_default ());
+ monitor = gdk_display_get_monitor (display, 0);
+ gdk_monitor_get_geometry (monitor, &geometry);
+
+ if (geometry.width <= SIZING_SCREEN_WIDTH_LARGE)
{
- if (WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) <= SIZING_SCREEN_WIDTH_MEDIUM)
+ if (geometry.width <= SIZING_SCREEN_WIDTH_MEDIUM)
num_cols = SIZING_SCREEN_WIDTH_SMALL_NUMCOLS;
else
num_cols = SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS;