summaryrefslogtreecommitdiff
path: root/typing-break
diff options
context:
space:
mode:
Diffstat (limited to 'typing-break')
-rw-r--r--typing-break/drw-break-window.c14
-rw-r--r--typing-break/drw-utils.c6
-rw-r--r--typing-break/drwright.c10
3 files changed, 13 insertions, 17 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);
diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c
index 53a6493f..8ba53edd 100644
--- a/typing-break/drw-utils.c
+++ b/typing-break/drw-utils.c
@@ -20,6 +20,7 @@
#include <config.h>
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include "drw-utils.h"
@@ -124,9 +125,8 @@ set_pixmap_background (GtkWidget *window)
gtk_widget_realize (window);
screen = gtk_widget_get_screen (window);
-
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &width, &height);
+ width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
+ height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
tmp_pixbuf = gdk_pixbuf_get_from_window (gdk_screen_get_root_window (screen),
0,
diff --git a/typing-break/drwright.c b/typing-break/drwright.c
index 6a7726a6..c0968af0 100644
--- a/typing-break/drwright.c
+++ b/typing-break/drwright.c
@@ -25,6 +25,7 @@
#include <math.h>
#include <glib/gi18n.h>
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
@@ -811,18 +812,15 @@ create_secondary_break_windows (void)
if (screen != gdk_screen_get_default ()) {
/* Handled by DrwBreakWindow. */
- gint sc_width, sc_height;
-
window = gtk_window_new (GTK_WINDOW_POPUP);
windows = g_list_prepend (windows, window);
gtk_window_set_screen (GTK_WINDOW (window), screen);
- 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_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
drw_setup_background (GTK_WIDGET (window));