Hello community,

here is the log from the commit of package atril for openSUSE:Factory checked 
in at 2019-05-16 22:02:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/atril (Old)
 and      /work/SRC/openSUSE:Factory/.atril.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "atril"

Thu May 16 22:02:51 2019 rev:25 rq:682542 version:1.22.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/atril/atril.changes      2018-12-18 
14:58:02.622282943 +0100
+++ /work/SRC/openSUSE:Factory/.atril.new.5148/atril.changes    2019-05-16 
22:02:57.270673009 +0200
@@ -1,0 +2,30 @@
+Tue Mar  5 15:19:33 UTC 2019 - [email protected]
+
+- Update to version 1.22.0:
+  * Disable deprecation warnings for distcheck.
+  * shell: Don't dist generated files.
+  * presentation: Avoid deprecated
+    "gtk_style_context_set_background".
+  * ev-sidebar-bookmarks: Use NULL instead of an uninitialised
+    variable.
+  * Avoid deprecated gtk_menu_popup.
+  * libview: Replace deprecated gdk_flush.
+  * thumbnailer: Remove unused code.
+  * Add update-authors.pl script which helps to update atril.about.
+  * Read authors (updated) from atril.about gresource.
+  * [ephy-zoom-control] Avoid deprecated g_type_class_add_private.
+  * [ephy-zoom-action] Avoid deprecated g_type_class_add_private.
+  * Add pixbuf, tiff and xps TypeDescription to POTFILES.in.
+  * eggsmclient: Avoid deprecated 'g_type_class_add_private'.
+  * Move appdata to the metainfo/ directory.
+  * message-area: Set a11y object name from actual icon name.
+  * shell: Remove duplicate condition check.
+  * tiff: Fix possible NULL pointer dereference.
+  * pdf: Add missing break statement.
+  * libdocument: Drop useless freeing of a NULL pointer.
+  * comics: Fix incorrect mimetype saying to open and thumbnail all
+    rarfiles.
+  * Update translations.
+- Rebase atril-gtk-3.20.patch.
+
+-------------------------------------------------------------------

Old:
----
  atril-1.20.3.tar.xz

New:
----
  atril-1.22.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ atril.spec ++++++
--- /var/tmp/diff_new_pack.2wKmCp/_old  2019-05-16 22:02:58.070672506 +0200
+++ /var/tmp/diff_new_pack.2wKmCp/_new  2019-05-16 22:02:58.070672506 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package atril
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,17 +16,17 @@
 #
 
 
-%define sover   3
-%define _version 1.20
 %define typelib1 typelib-1_0-AtrilDocument-1_5_0
 %define typelib2 typelib-1_0-AtrilView-1_5_0
+%define sover   3
+%define _version 1.22
 Name:           atril
-Version:        1.20.3
+Version:        1.22.0
 Release:        0
 Summary:        MATE Desktop document viewer
 License:        GPL-2.0-only AND LGPL-2.0-only
 Group:          System/GUI/Other
-Url:            https://mate-desktop.org/
+URL:            https://mate-desktop.org/
 Source:         
http://pub.mate-desktop.org/releases/%{_version}/%{name}-%{version}.tar.xz
 # PATCH-FEATURE-OPENSUSE atril-gtk-3.20.patch -- Restore GLib 2.48 and GTK+ 
3.20 support.
 Patch0:         atril-gtk-3.20.patch
@@ -207,11 +207,7 @@
 %endif
 
 %files
-%if 0%{?suse_version} >= 1500
 %license COPYING
-%else
-%doc COPYING
-%endif
 %doc AUTHORS README
 %{_bindir}/%{name}
 %{_bindir}/%{name}-previewer
@@ -225,26 +221,18 @@
 %{_datadir}/glib-2.0/schemas/*.xml
 %{_datadir}/help/C/%{name}/
 %{_datadir}/applications/%{name}.desktop
-%dir %{_datadir}/appdata/
-%{_datadir}/appdata/%{name}.appdata.xml
+%dir %{_datadir}/metainfo/
+%{_datadir}/metainfo/%{name}.appdata.xml
 %{_datadir}/icons/hicolor/*/*/*
 %{_mandir}/man?/*.?%{?ext_man}
 
 %files -n libatrilview%{sover}
-%if 0%{?suse_version} >= 1500
 %license COPYING
-%else
-%doc COPYING
-%endif
 %doc AUTHORS README
 %{_libdir}/libatrilview.so.%{sover}*
 
 %files -n libatrildocument%{sover}
-%if 0%{?suse_version} >= 1500
 %license COPYING
-%else
-%doc COPYING
-%endif
 %doc AUTHORS README
 %{_libdir}/libatrildocument.so.%{sover}*
 
@@ -266,11 +254,7 @@
 %{_libdir}/girepository-1.0/AtrilView-1.5.0.typelib
 
 %files backends
-%if 0%{?suse_version} >= 1500
 %license COPYING
-%else
-%doc COPYING
-%endif
 %doc AUTHORS README
 %{_libdir}/%{name}/%{sover}/backends/
 

++++++ atril-1.20.3.tar.xz -> atril-1.22.0.tar.xz ++++++
++++ 112930 lines of diff (skipped)

++++++ atril-gtk-3.20.patch ++++++
--- /var/tmp/diff_new_pack.2wKmCp/_old  2019-05-16 22:02:59.006671918 +0200
+++ /var/tmp/diff_new_pack.2wKmCp/_new  2019-05-16 22:02:59.006671918 +0200
@@ -11,6 +11,32 @@
  WEBKIT_REQUIRED=2.4.3
  LIBSECRET_REQUIRED=0.5
  LIBXML_REQUIRED=2.5.0
+--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
++++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+@@ -367,7 +367,11 @@ popup_context_menu_cb (GtkWidget
+       menu = GTK_MENU (gtk_ui_manager_get_widget (etoolbar->priv->manager,
+                                                 etoolbar->priv->popup_path));
+       g_return_if_fail (menu != NULL);
++#if GTK_CHECK_VERSION (3, 22, 0)
+       gtk_menu_popup_at_pointer (menu, NULL);
++#else
++      gtk_menu_popup (menu, NULL, NULL, NULL, NULL, button_number, 
GDK_CURRENT_TIME);
++#endif
+       g_signal_connect_object (menu, "selection-done",
+                              G_CALLBACK (popup_context_deactivate),
+                              etoolbar, 0);
+@@ -401,7 +405,11 @@ button_press_event_cb (GtkWidget *widget
+       menu = GTK_MENU (gtk_ui_manager_get_widget (etoolbar->priv->manager,
+                                                 etoolbar->priv->popup_path));
+       g_return_val_if_fail (menu != NULL, FALSE);
++#if GTK_CHECK_VERSION (3, 22, 0)
+       gtk_menu_popup_at_pointer (menu, (const GdkEvent*) event);
++#else
++      gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, 
event->time);
++#endif
+       g_signal_connect_object (menu, "selection-done",
+                              G_CALLBACK (popup_context_deactivate),
+                              etoolbar, 0);
 --- a/libdocument/ev-document-misc.c
 +++ b/libdocument/ev-document-misc.c
 @@ -339,7 +339,11 @@ ev_document_misc_invert_pixbuf (GdkPixbu
@@ -20,7 +46,7 @@
 +#if GTK_CHECK_VERSION (3, 22, 0)
  ev_document_misc_get_screen_dpi (GdkScreen *screen, GdkMonitor *monitor)
 +#else
-+ev_document_misc_get_screen_dpi (GdkScreen *screen, int monitor)
++ev_document_misc_get_screen_dpi (GdkScreen *screen, gint monitor)
 +#endif
  {
        gdouble dp, di;
@@ -48,21 +74,21 @@
 +#if GTK_CHECK_VERSION (3, 22, 0)
  gdouble          ev_document_misc_get_screen_dpi (GdkScreen *screen, 
GdkMonitor *monitor);
 +#else
-+gdouble          ev_document_misc_get_screen_dpi (GdkScreen *screen, int 
monitor);
++gdouble          ev_document_misc_get_screen_dpi (GdkScreen *screen, gint 
monitor);
 +#endif
  
  gchar           *ev_document_misc_format_date (GTime utime);
  
 --- a/libview/ev-annotation-window.c
 +++ b/libview/ev-annotation-window.c
-@@ -97,13 +97,20 @@ static gdouble
+@@ -97,12 +97,20 @@ static gdouble
  get_screen_dpi (EvAnnotationWindow *window)
  {
        GdkScreen  *screen;
 +#if GTK_CHECK_VERSION (3, 22, 0)
        GdkMonitor *monitor;
 +#else
-+      int         monitor;
++      gint        monitor;
 +#endif
        GdkDisplay *display;
  
@@ -70,13 +96,12 @@
        display = gdk_screen_get_display (screen);
 +#if GTK_CHECK_VERSION (3, 22, 0)
        monitor = gdk_display_get_primary_monitor (display);
--
 +#else
 +      monitor = gdk_screen_get_primary_monitor (screen);
 +#endif
+ 
        return ev_document_misc_get_screen_dpi (screen, monitor);
  }
- 
 --- a/libview/ev-view.c
 +++ b/libview/ev-view.c
 @@ -495,7 +495,11 @@ is_dual_page (EvView   *view,
@@ -86,7 +111,7 @@
 +#if GTK_CHECK_VERSION (3, 22, 0)
                GdkMonitor *monitor;
 +#else
-+              int         monitor;
++              gint        monitor;
 +#endif
                GdkDisplay *display;
                double        scale;
@@ -103,19 +128,19 @@
                scale = ev_document_misc_get_screen_dpi (screen, monitor) / 
72.0;
  
                ev_document_get_max_page_size (view->document, &doc_width, 
&doc_height);
-@@ -7101,7 +7109,11 @@ zoom_for_size_automatic (GdkScreen *scre
+@@ -7111,7 +7119,11 @@ zoom_for_size_automatic (GdkScreen *scre
                         int        target_width,
                         int        target_height)
  {
 +#if GTK_CHECK_VERSION (3, 22, 0)
        GdkMonitor *monitor;
 +#else
-+      int         monitor;
++      gint        monitor;
 +#endif
        GdkDisplay *display;
        double fit_width_scale;
        double scale;
-@@ -7117,7 +7129,11 @@ zoom_for_size_automatic (GdkScreen *scre
+@@ -7127,7 +7139,11 @@ zoom_for_size_automatic (GdkScreen *scre
                double actual_scale;
  
                display = gdk_screen_get_display (screen);
@@ -129,7 +154,7 @@
        }
 --- a/libview/ev-view-presentation.c
 +++ b/libview/ev-view-presentation.c
-@@ -1253,11 +1253,20 @@ static void
+@@ -1255,11 +1255,20 @@ static void
  ev_view_presentation_update_monitor_geometry (EvViewPresentation *pview)
  {
        GdkDisplay          *display = gtk_widget_get_display (GTK_WIDGET 
(pview));
@@ -142,7 +167,7 @@
 +#else
 +      GdkScreen           *screen = gdk_display_get_default_screen (display);
 +      GdkRectangle        monitor;
-+      int                 monitor_num;
++      gint                monitor_num;
 +
 +      monitor_num = gdk_screen_get_monitor_at_window (screen, 
gtk_widget_get_window (GTK_WIDGET (pview)));
 +      gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
@@ -159,7 +184,7 @@
 +#if GTK_CHECK_VERSION (3, 22, 0)
        GdkMonitor *monitor;
 +#else
-+      int         monitor;
++      gint        monitor;
 +#endif
        GdkDisplay *display;
  
@@ -175,86 +200,297 @@
  }
 --- a/shell/ev-navigation-action-widget.c
 +++ b/shell/ev-navigation-action-widget.c
-@@ -131,18 +131,32 @@ menu_position_func (GtkMenu           *m
-       GtkTextDirection direction;
-       GdkWindow *gdk_window;
-       GdkRectangle monitor;
-+#if GTK_CHECK_VERSION (3, 22, 0)
-       GdkMonitor *monitor_num;
-+#else
-+      int monitor_num;
-+      GdkScreen *screen;
-+#endif
-       GdkDisplay *display;
+@@ -118,6 +118,56 @@ ev_navigation_action_widget_set_menu(EvN
+       }
+ }
  
-       gtk_widget_get_preferred_size (GTK_WIDGET (button->menu), &menu_req, 
NULL);
-       direction = gtk_widget_get_direction (widget);
-       display = gtk_widget_get_display (GTK_WIDGET (menu));
 +#if !GTK_CHECK_VERSION (3, 22, 0)
-+      screen = gdk_display_get_default_screen (display);
++static void
++popup_menu_position_func (GtkMenu                  *menu,
++                          gint                     *x,
++                          gint                     *y,
++                          gboolean                 *push_in,
++                          EvNavigationActionWidget *button)
++{
++      GdkScreen       *screen;
++      GdkWindow       *window;
++      gint             monitor_num;
++      GdkRectangle     monitor;
++      GtkAllocation    allocation;
++      GtkTextDirection direction;
++      GtkRequisition   menu_req;
++
++      screen = gtk_widget_get_screen (GTK_WIDGET (menu));
++      window = gtk_widget_get_window (GTK_WIDGET (button));
++
++      monitor_num = gdk_screen_get_monitor_at_window (screen, window);
++      if (monitor_num > 0)
++              monitor_num = 0;
++      gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
++      gdk_window_get_origin (window, x, y);
++
++      gtk_widget_get_allocation (GTK_WIDGET (button), &allocation);
++      *x += allocation.x;
++      *y += allocation.y;
++
++      direction = gtk_widget_get_direction (GTK_WIDGET (button));
++      gtk_widget_get_preferred_size (GTK_WIDGET (button->menu), &menu_req, 
NULL);
++
++      if (direction == GTK_TEXT_DIR_LTR)
++              *x += MAX (allocation.width - menu_req.width, 0);
++      else if (menu_req.width > allocation.width)
++              *x -= menu_req.width - allocation.width;
++
++      if ((*y + allocation.height + menu_req.height) <= monitor.y + 
monitor.height)
++              *y += allocation.height;
++      else if ((*y - menu_req.height) >= monitor.y)
++              *y -= menu_req.height;
++      else if (monitor.y + monitor.height - (*y + allocation.height) > *y)
++              *y += allocation.height;
++      else
++              *y -= menu_req.height;
++
++      *push_in = FALSE;
++}
 +#endif
++
+ static void
+ popup_menu_under_arrow (EvNavigationActionWidget *button,
+                         GdkEventButton    *event)
+@@ -127,8 +177,16 @@ popup_menu_under_arrow (EvNavigationActi
+       if (!button->menu)
+               return;
  
-       gdk_window = gtk_widget_get_window (widget);
 +#if GTK_CHECK_VERSION (3, 22, 0)
-       monitor_num = gdk_display_get_monitor_at_window (display, gdk_window);
-       if (monitor_num == NULL)
-               monitor_num = gdk_display_get_monitor (display, 0);
-       gdk_monitor_get_geometry (monitor_num, &monitor);
-+#else
-+      monitor_num = gdk_screen_get_monitor_at_window (screen, gdk_window);
-+      monitor_num = monitor_num > 0 ? monitor_num : 0;
-+      gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+       gtk_menu_popup_at_pointer (button->menu,
+                                  (const GdkEvent*) event);
++#else
++      gtk_menu_popup (button->menu, NULL, NULL,
++                      (GtkMenuPositionFunc) popup_menu_position_func,
++                      button,
++                      event != NULL ? event->button : 0,
++                      event != NULL ? event->time : GDK_CURRENT_TIME);
 +#endif
+ }
  
-       gdk_window_get_origin (gdk_window, x, y);
-       gtk_widget_get_allocation (widget, &allocation);
---- a/shell/ev-utils.c
-+++ b/shell/ev-utils.c
-@@ -26,6 +26,7 @@
- #include <string.h>
- #include <glib/gi18n.h>
- 
-+#if GTK_CHECK_VERSION(3, 22, 0)
- static int
- _gtk_get_monitor_num (GdkMonitor *monitor)
- {
-@@ -42,6 +43,7 @@ _gtk_get_monitor_num (GdkMonitor *monito
+ static void
+--- a/shell/ev-sidebar-bookmarks.c
++++ b/shell/ev-sidebar-bookmarks.c
+@@ -354,7 +354,16 @@ ev_sidebar_bookmarks_popup_menu_show (Ev
+         if (!priv->popup)
+                 priv->popup = gtk_ui_manager_get_widget (priv->ui_manager, 
"/BookmarksPopup");
+ 
++#if GTK_CHECK_VERSION (3, 22, 0)
+         gtk_menu_popup_at_pointer (GTK_MENU (priv->popup), NULL);
++#else
++        gtk_menu_popup (GTK_MENU (priv->popup),
++                        NULL, NULL,
++                        keyboard_mode ? ev_gui_menu_position_tree_selection : 
NULL,
++                        keyboard_mode ? tree_view : NULL,
++                        keyboard_mode ? 0 : 3,
++                        GDK_CURRENT_TIME);
++#endif
+         return TRUE;
+ }
  
-       return -1;
+--- a/shell/ev-sidebar.c
++++ b/shell/ev-sidebar.c
+@@ -192,6 +192,32 @@ ev_sidebar_class_init (EvSidebarClass *e
+                                                             
G_PARAM_READWRITE));
  }
+ 
++#if !GTK_CHECK_VERSION (3, 22, 0)
++static void
++ev_sidebar_menu_position_under (GtkMenu  *menu,
++                              gint     *x,
++                              gint     *y,
++                              gboolean *push_in,
++                              gpointer  user_data)
++{
++      GtkWidget    *widget;
++      GtkAllocation allocation;
++
++      g_return_if_fail (GTK_IS_BUTTON (user_data));
++      g_return_if_fail (!gtk_widget_get_has_window (GTK_WIDGET (user_data)));
++
++      widget = GTK_WIDGET (user_data);
++
++      gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
++      gtk_widget_get_allocation (widget, &allocation);
++
++      *x += allocation.x;
++      *y += allocation.y + allocation.height;
++
++      *push_in = FALSE;
++}
++#endif
++
+ static gboolean
+ ev_sidebar_select_button_press_cb (GtkWidget      *widget,
+                                  GdkEventButton *event,
+@@ -214,11 +240,18 @@ ev_sidebar_select_button_press_cb (GtkWi
+               gtk_widget_grab_focus (widget);
+                        
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
++#if GTK_CHECK_VERSION (3, 22, 0)
+               gtk_menu_popup_at_widget (GTK_MENU (ev_sidebar->priv->menu),
+                                         widget,
+                                         GDK_GRAVITY_SOUTH_WEST,
+                                         GDK_GRAVITY_NORTH_WEST,
+                                         (const GdkEvent*) event);
++#else
++              gtk_menu_popup (GTK_MENU (ev_sidebar->priv->menu),
++                              NULL, NULL,
++                              ev_sidebar_menu_position_under, widget,
++                              event->button, event->time);
 +#endif
  
- static void
- ev_gui_sanitise_popup_position (GtkMenu *menu,
-@@ -50,7 +52,12 @@ ev_gui_sanitise_popup_position (GtkMenu
-                               gint *y)
+               return TRUE;
+       }
+@@ -238,11 +271,18 @@ ev_sidebar_select_button_key_press_cb (G
+           event->keyval == GDK_KEY_Return ||
+           event->keyval == GDK_KEY_KP_Enter) {
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
++#if GTK_CHECK_VERSION (3, 22, 0)
+               gtk_menu_popup_at_widget (GTK_MENU (ev_sidebar->priv->menu),
+                                         widget,
+                                         GDK_GRAVITY_SOUTH_WEST,
+                                         GDK_GRAVITY_NORTH_WEST,
+                                         (const GdkEvent*) event);
++#else
++              gtk_menu_popup (GTK_MENU (ev_sidebar->priv->menu),
++                              NULL, NULL,
++                              ev_sidebar_menu_position_under, widget,
++                              1, event->time);
++#endif
+               return TRUE;
+       }
+ 
+--- a/shell/ev-sidebar-links.c
++++ b/shell/ev-sidebar-links.c
+@@ -347,7 +347,14 @@ popup_menu_cb (GtkWidget *treeview, EvSi
  {
-       GdkDisplay *display = gtk_widget_get_display (widget);
+       GtkMenu *menu = build_popup_menu (sidebar);
+ 
 +#if GTK_CHECK_VERSION (3, 22, 0)
-       GdkMonitor *monitor_num;
+       gtk_menu_popup_at_pointer (menu, NULL);
 +#else
-+      GdkScreen  *screen = gdk_display_get_default_screen (display);
-+      int         monitor_num;
++      gtk_menu_popup (menu, NULL, NULL,
++                      ev_gui_menu_position_tree_selection,
++                      sidebar->priv->tree_view, 0,
++                      GDK_CURRENT_TIME);
 +#endif
-       GdkRectangle monitor;
-       GtkRequisition req;
- 
-@@ -58,9 +65,15 @@ ev_gui_sanitise_popup_position (GtkMenu
- 
-       gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
+       gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
+ }
  
+@@ -366,8 +373,14 @@ button_press_cb (GtkWidget *treeview,
+                                                  NULL, NULL, NULL)) {
+                       gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview),
+                                                 path, NULL, FALSE);
 +#if GTK_CHECK_VERSION (3, 22, 0)
-       monitor_num = gdk_display_get_monitor_at_point (display, *x, *y);
-       gtk_menu_set_monitor (menu, _gtk_get_monitor_num (monitor_num));
-       gdk_monitor_get_geometry (monitor_num, &monitor);
+                       gtk_menu_popup_at_pointer (build_popup_menu (sidebar),
+                                                  (const GdkEvent*) event);
 +#else
++                      gtk_menu_popup (build_popup_menu (sidebar), NULL,
++                                      NULL, NULL, NULL, event->button,
++                                      GDK_CURRENT_TIME);
++#endif
+                       gtk_tree_path_free (path);
+ 
+                       return TRUE;
+--- a/shell/ev-utils.c
++++ b/shell/ev-utils.c
+@@ -107,3 +107,74 @@ get_gdk_pixbuf_format_by_extension (gcha
+       g_slist_free (pixbuf_formats);
+       return NULL;
+ }
++
++#if !GTK_CHECK_VERSION (3, 22, 0)
++static void
++ev_gui_menu_position_tree_selection_sanitize (GtkMenu   *menu,
++                                              GtkWidget *widget,
++                                              gint      *x,
++                                              gint      *y)
++{
++      GdkScreen     *screen = gtk_widget_get_screen (widget);
++      gint           monitor_num;
++      GdkRectangle   monitor;
++      GtkRequisition req;
++
++      gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
 +      monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
 +      gtk_menu_set_monitor (menu, monitor_num);
 +      gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
++
++      *x = CLAMP (*x, monitor.x,
++                  monitor.x + MAX (0, monitor.width - req.width));
++      *y = CLAMP (*y, monitor.y,
++                  monitor.y + MAX (0, monitor.height - req.height));
++}
++
++void
++ev_gui_menu_position_tree_selection (GtkMenu  *menu,
++                                     gint     *x,
++                                     gint     *y,
++                                     gboolean *push_in,
++                                     gpointer  user_data)
++{
++      GtkTreeView      *tree_view = GTK_WIDGET (user_data);
++      GtkTreeSelection *selection;
++      GList            *selected_rows;
++      GtkTreeModel     *model;
++      GtkRequisition    req;
++      GtkAllocation     allocation;
++      GdkRectangle      visible;
++
++      g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
++
++      gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
++      gdk_window_get_origin (gtk_widget_get_window (tree_view), x, y);
++      gtk_widget_get_allocation (tree_view, &allocation);
++
++      *x += (allocation.width - req.width) / 2;
++      /* Add on height for the treeview title */
++      gtk_tree_view_get_visible_rect (GTK_TREE_VIEW (tree_view), &visible);
++      *y += allocation.height - visible.height;
++
++      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
++      selected_rows = gtk_tree_selection_get_selected_rows (selection,
++                                                            &model);
++
++      if (selected_rows != NULL) {
++              GdkRectangle cell_rect;
++              gtk_tree_view_get_cell_area (GTK_TREE_VIEW (tree_view),
++                                           selected_rows->data,
++                                           NULL,
++                                           &cell_rect);
++              *y += CLAMP (cell_rect.y + cell_rect.height, 0,
++                           visible.height);
++              g_list_foreach (selected_rows,
++                              (GFunc) gtk_tree_path_free,
++                              NULL);
++              g_list_free (selected_rows);
++      }
++
++      ev_gui_menu_position_tree_selection_sanitize (menu, tree_view, x, y);
++}
++#endif
+--- a/shell/ev-utils.h
++++ b/shell/ev-utils.h
+@@ -28,6 +28,13 @@ G_BEGIN_DECLS
+ 
+ void                          file_chooser_dialog_add_writable_pixbuf_formats 
(GtkFileChooser *chooser);
+ GdkPixbufFormat*      get_gdk_pixbuf_format_by_extension (gchar *uri);
++#if !GTK_CHECK_VERSION (3, 22, 0)
++void                    ev_gui_menu_position_tree_selection (GtkMenu  *menu,
++                                                             gint     *x,
++                                                             gint     *y,
++                                                             gboolean 
*push_in,
++                                                             gpointer  
user_data);
 +#endif
  
-       *x = CLAMP (*x, monitor.x, monitor.x + MAX (0, monitor.width - 
req.width));
-       *y = CLAMP (*y, monitor.y, monitor.y + MAX (0, monitor.height - 
req.height));
+ G_END_DECLS
+ 
 --- a/shell/ev-window.c
 +++ b/shell/ev-window.c
 @@ -398,12 +398,20 @@ static gdouble
@@ -264,7 +500,7 @@
 +#if GTK_CHECK_VERSION (3, 22, 0)
        GdkMonitor *monitor;
 +#else
-+      int         monitor;
++      gint        monitor;
 +#endif
        GdkDisplay *display;
  
@@ -278,7 +514,7 @@
  
        return ev_document_misc_get_screen_dpi (screen, monitor);
  }
-@@ -5014,10 +5022,17 @@ ev_window_cmd_help_contents (GtkAction *
+@@ -5031,10 +5039,17 @@ ev_window_cmd_help_contents (GtkAction *
  {
        GError  *error = NULL;
  
@@ -296,3 +532,33 @@
  
        if (error) {
                ev_window_error_message (ev_window, error, 
+@@ -5602,8 +5617,14 @@ view_menu_popup_cb (EvView   *view,
+       if (!has_annot)
+               view_menu_annot_popup (ev_window, NULL);
+ 
++#if GTK_CHECK_VERSION (3, 22, 0)
+       gtk_menu_popup_at_pointer (GTK_MENU (ev_window->priv->view_popup),
+                                  NULL);
++#else
++      gtk_menu_popup (GTK_MENU (ev_window->priv->view_popup),
++                      NULL, NULL, NULL, NULL, 3,
++                      GDK_CURRENT_TIME);
++#endif
+       return TRUE;
+ }
+ 
+@@ -5626,8 +5647,14 @@ attachment_bar_menu_popup_cb (EvSidebarA
+       
+       popup = ev_window->priv->attachment_popup;
+ 
++#if GTK_CHECK_VERSION (3, 22, 0)
+       gtk_menu_popup_at_pointer (GTK_MENU (popup),
+                                  NULL);
++#else
++      gtk_menu_popup (GTK_MENU (popup),
++                      NULL, NULL, NULL, NULL, 3,
++                      GDK_CURRENT_TIME);
++#endif
+       return TRUE;
+ }
+ 


Reply via email to