summaryrefslogtreecommitdiff
path: root/libview/ev-view.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-10 02:53:45 +0100
committerPablo Barciela <[email protected]>2017-12-10 03:12:31 +0100
commitc4911e303edd2352597ec5879df1137fd0a83274 (patch)
tree4fb57ea9e98291b879709b26ce697c86b8d11c2d /libview/ev-view.c
parentdd2c555654cd4beeec3cfc64481024982dbcbaa3 (diff)
downloadatril-c4911e303edd2352597ec5879df1137fd0a83274.tar.bz2
atril-c4911e303edd2352597ec5879df1137fd0a83274.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/atril/commit/d9fffe2dc0e33d6777099c18635b7b75f54d3d35 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r--libview/ev-view.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index efd03006..2e8f686c 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -26,6 +26,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include "ev-mapping-list.h"
@@ -5723,19 +5724,15 @@ show_loading_window_cb (EvView *view)
if (!view->loading_window) {
GtkWindow *parent;
GdkScreen *screen;
- gint sc_width;
- gint sc_height;
parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
view->loading_window = ev_loading_window_new (parent);
/* Show the window off screen to get a valid size asap */
screen = gtk_widget_get_screen (GTK_WIDGET (view));
-
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &sc_width, &sc_height);
-
- gtk_window_move (GTK_WINDOW (view->loading_window), sc_width + 1, sc_height + 1);
+ gtk_window_move (GTK_WINDOW (view->loading_window),
+ WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) + 1,
+ HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) + 1);
gtk_widget_show (view->loading_window);
}