summaryrefslogtreecommitdiff
path: root/libslab/app-shell.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-06 01:03:11 +0100
committerraveit65 <[email protected]>2017-12-20 20:47:45 +0100
commit8d737c695f37a5bb0ad5ded56a44777249624cea (patch)
tree818759a6696563fdee0297528099302ce8907849 /libslab/app-shell.c
parentcde96bf637600cd257861b84ae39233ab800a9b9 (diff)
downloadmate-control-center-8d737c695f37a5bb0ad5ded56a44777249624cea.tar.bz2
mate-control-center-8d737c695f37a5bb0ad5ded56a44777249624cea.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/mate-control-center/commit/fe782c673262e861334bb48265abf5075ff02680 https://github.com/mate-desktop/mate-control-center/commit/061f3780a3af6224a804d239f9b9dfc5c81873f6 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height gdk_screen_width gdk_screen_height
Diffstat (limited to 'libslab/app-shell.c')
-rw-r--r--libslab/app-shell.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index 2c7ec9fc..78e1b6a9 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -25,6 +25,7 @@
#include <libmate-desktop/mate-desktop-item.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -256,7 +257,6 @@ 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;
@@ -266,13 +266,10 @@ 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 (sc_width <= SIZING_SCREEN_WIDTH_LARGE)
+ if (WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) <= SIZING_SCREEN_WIDTH_LARGE)
{
- if (sc_width <= SIZING_SCREEN_WIDTH_MEDIUM)
+ if (WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) <= SIZING_SCREEN_WIDTH_MEDIUM)
num_cols = SIZING_SCREEN_WIDTH_SMALL_NUMCOLS;
else
num_cols = SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS;