diff options
author | ZenWalker <[email protected]> | 2017-08-19 01:40:38 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-20 17:00:09 +0200 |
commit | d9fffe2dc0e33d6777099c18635b7b75f54d3d35 (patch) | |
tree | 534278c6d1090d27cb6fe05f9ab73078cb15df2b | |
parent | 4650fb05e46e144be986a11a666a47add39b3799 (diff) | |
download | atril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.bz2 atril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.xz |
avoid deprecated gdk_screen_get_width/height
-rw-r--r-- | libdocument/ev-document-misc.c | 6 | ||||
-rw-r--r-- | libview/ev-view-presentation.c | 10 | ||||
-rw-r--r-- | libview/ev-view.c | 10 | ||||
-rw-r--r-- | shell/ev-window.c | 10 |
4 files changed, 27 insertions, 9 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index fc47a9ee..e59eb354 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -375,9 +375,13 @@ gdouble ev_document_misc_get_screen_dpi (GdkScreen *screen, gint monitor) { gdouble dp, di; + gint sc_width, sc_height; + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &sc_width, &sc_height); /*diagonal in pixels*/ - dp = hypot (gdk_screen_get_width (screen), gdk_screen_get_height (screen)); + dp = hypot (sc_width, sc_height); /*diagonal in inches*/ di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4; diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c index 74ce60ee..40dea3ea 100644 --- a/libview/ev-view-presentation.c +++ b/libview/ev-view-presentation.c @@ -720,12 +720,16 @@ ev_view_presentation_goto_window_send_key_event (EvViewPresentation *pview, { GdkEventKey *new_event; GdkScreen *screen; + gint sc_width; + gint sc_height; /* Move goto window off screen */ screen = gtk_widget_get_screen (GTK_WIDGET (pview)); - gtk_window_move (GTK_WINDOW (pview->goto_window), - gdk_screen_get_width (screen) + 1, - gdk_screen_get_height (screen) + 1); + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &sc_width, &sc_height); + + gtk_window_move (GTK_WINDOW (pview->goto_window), sc_width + 1, sc_height + 1); gtk_widget_show (pview->goto_window); new_event = (GdkEventKey *) gdk_event_copy (event); diff --git a/libview/ev-view.c b/libview/ev-view.c index 2007dd56..2340d0a9 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -4449,15 +4449,19 @@ 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)); - gtk_window_move (GTK_WINDOW (view->loading_window), - gdk_screen_get_width (screen) + 1, - gdk_screen_get_height (screen) + 1); + + 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_widget_show (view->loading_window); } diff --git a/shell/ev-window.c b/shell/ev-window.c index b82d137f..ca906be3 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1299,6 +1299,8 @@ setup_document_from_metadata (EvWindow *window) GdkScreen *screen; gint request_width; gint request_height; + gint sc_width; + gint sc_height; ev_document_get_max_page_size (window->priv->document, &document_width, &document_height); @@ -1307,9 +1309,13 @@ setup_document_from_metadata (EvWindow *window) request_height = (gint)(height_ratio * document_height + 0.5); screen = gtk_window_get_screen (GTK_WINDOW (window)); + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &sc_width, &sc_height); + if (screen) { - request_width = MIN (request_width, gdk_screen_get_width (screen)); - request_height = MIN (request_height, gdk_screen_get_height (screen)); + request_width = MIN (request_width, sc_width); + request_height = MIN (request_height, sc_height); } if (request_width > 0 && request_height > 0) { |