diff options
author | ZenWalker <[email protected]> | 2017-08-10 02:02:48 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2017-08-10 02:02:48 +0200 |
commit | 816394c1a6ce9968dba3e1b0ecc884c8ccca4d43 (patch) | |
tree | cc3d7609ed335e979d5d23afcb60609f2f645cbb /src/gs-window-x11.c | |
parent | a96cc1c494032c740b5ebda705992213609fbb18 (diff) | |
download | mate-screensaver-816394c1a6ce9968dba3e1b0ecc884c8ccca4d43.tar.bz2 mate-screensaver-816394c1a6ce9968dba3e1b0ecc884c8ccca4d43.tar.xz |
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'src/gs-window-x11.c')
-rw-r--r-- | src/gs-window-x11.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c index dbdb469..edc36a4 100644 --- a/src/gs-window-x11.c +++ b/src/gs-window-x11.c @@ -1272,8 +1272,12 @@ create_keyboard_socket (GSWindow *window, guint32 id) { int height; + int sc_height; - height = (gdk_screen_get_height (gtk_widget_get_screen (GTK_WIDGET (window)))) / 4; + 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; window->priv->keyboard_socket = gtk_socket_new (); gtk_widget_set_size_request (window->priv->keyboard_socket, -1, height); @@ -2162,12 +2166,17 @@ 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); - min_distance = gdk_screen_get_width (screen) * min_percentage; + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &sc_width, NULL); + + min_distance = sc_width * 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) |