summaryrefslogtreecommitdiff
path: root/src/gs-window-x11.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-11 20:02:10 +0100
committerraveit65 <[email protected]>2017-12-19 13:15:06 +0100
commit65094d38e0982e735bfd966854f8a106e4001a16 (patch)
treeaf5c670ad4b0ef06e7f2dab5bc8d26f755175f07 /src/gs-window-x11.c
parent02cddedebbfa962fdeba0324e2786bd221459ad5 (diff)
downloadmate-screensaver-65094d38e0982e735bfd966854f8a106e4001a16.tar.bz2
mate-screensaver-65094d38e0982e735bfd966854f8a106e4001a16.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/mate-screensaver/commit/816394c1a6ce9968dba3e1b0ecc884c8ccca4d43 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height
Diffstat (limited to 'src/gs-window-x11.c')
-rw-r--r--src/gs-window-x11.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index edc36a4..114d372 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -1272,12 +1272,8 @@ create_keyboard_socket (GSWindow *window,
guint32 id)
{
int height;
- int sc_height;
- gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (GTK_WIDGET (window))),
- NULL, NULL, NULL, &sc_height);
-
- height = sc_height / 4;
+ height = (HeightOfScreen (gdk_x11_screen_get_xscreen (gtk_widget_get_screen (GTK_WIDGET (window))))) / 4;
window->priv->keyboard_socket = gtk_socket_new ();
gtk_widget_set_size_request (window->priv->keyboard_socket, -1, height);
@@ -2166,17 +2162,12 @@ gs_window_real_motion_notify_event (GtkWidget *widget,
gdouble min_percentage = 0.1;
GdkDisplay *display;
GdkScreen *screen;
- gint sc_width;
window = GS_WINDOW (widget);
display = gs_window_get_display (window);
screen = gdk_display_get_default_screen (display);
-
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &sc_width, NULL);
-
- min_distance = sc_width * min_percentage;
+ min_distance = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) * min_percentage;
/* if the last position was not set then don't detect motion */
if (window->priv->last_x < 0 || window->priv->last_y < 0)