summaryrefslogtreecommitdiff
path: root/typing-break/drw-break-window.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 /typing-break/drw-break-window.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 'typing-break/drw-break-window.c')
-rw-r--r--typing-break/drw-break-window.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index e8e03952..b7e57385 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -25,6 +25,7 @@
#include <math.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <gio/gio.h>
@@ -130,8 +131,6 @@ drw_break_window_init (DrwBreakWindow *window)
GdkDisplay *display;
#endif
GdkRectangle monitor;
- gint sc_width;
- gint sc_height;
gint right_padding;
gint bottom_padding;
GSettings *settings;
@@ -159,17 +158,16 @@ drw_break_window_init (DrwBreakWindow *window)
gdk_screen_get_monitor_geometry (screen, root_monitor, &monitor);
#endif
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &sc_width, &sc_height);
-
- gtk_window_set_default_size (GTK_WINDOW (window), sc_width, sc_height);
+ gtk_window_set_default_size (GTK_WINDOW (window),
+ WidthOfScreen (gdk_x11_screen_get_xscreen (screen)),
+ HeightOfScreen (gdk_x11_screen_get_xscreen (screen)));
gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
drw_setup_background (GTK_WIDGET (window));
- right_padding = sc_width - monitor.width - monitor.x;
- bottom_padding = sc_height - monitor.height - monitor.y;
+ right_padding = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - monitor.width - monitor.x;
+ bottom_padding = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - monitor.height - monitor.y;
outer_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_hexpand (outer_vbox, TRUE);