diff options
author | ZenWalker <[email protected]> | 2017-08-12 02:13:26 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-15 17:20:58 +0200 |
commit | fe782c673262e861334bb48265abf5075ff02680 (patch) | |
tree | cb268405284f379a0f24d7dde24fe09e241e35f3 | |
parent | b2c80db482ccba74a92e1bb588c9c0f4fcfc3f66 (diff) | |
download | mate-control-center-fe782c673262e861334bb48265abf5075ff02680.tar.bz2 mate-control-center-fe782c673262e861334bb48265abf5075ff02680.tar.xz |
libslab: avoid deprecated gdk_screen_width/height
-rw-r--r-- | libslab/app-shell.c | 8 | ||||
-rw-r--r-- | libslab/shell-window.c | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libslab/app-shell.c b/libslab/app-shell.c index c71b7f5b..2c7ec9fc 100644 --- a/libslab/app-shell.c +++ b/libslab/app-shell.c @@ -256,6 +256,7 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * GtkWidget *left_vbox; GtkWidget *right_vbox; gint num_cols; + gint sc_width; GtkWidget *sw; GtkAdjustment *adjustment; @@ -265,10 +266,13 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), + NULL, NULL, &sc_width, NULL); + num_cols = SIZING_SCREEN_WIDTH_LARGE_NUMCOLS; - if (gdk_screen_width () <= SIZING_SCREEN_WIDTH_LARGE) + if (sc_width <= SIZING_SCREEN_WIDTH_LARGE) { - if (gdk_screen_width () <= SIZING_SCREEN_WIDTH_MEDIUM) + if (sc_width <= SIZING_SCREEN_WIDTH_MEDIUM) num_cols = SIZING_SCREEN_WIDTH_SMALL_NUMCOLS; else num_cols = SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS; diff --git a/libslab/shell-window.c b/libslab/shell-window.c index 75201d58..0b6df1cb 100644 --- a/libslab/shell-window.c +++ b/libslab/shell-window.c @@ -113,8 +113,13 @@ shell_window_handle_size_request (GtkWidget * widget, GtkRequisition * requisiti height = child_requisiton.height + 10; if (height > requisition->height) { + gint sc_height; + + gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), + NULL, NULL, NULL, &sc_height); + requisition->height = - MIN (((gfloat) gdk_screen_height () * SIZING_HEIGHT_PERCENT), height); + MIN (((gfloat) sc_height * SIZING_HEIGHT_PERCENT), height); } } |