summaryrefslogtreecommitdiff
path: root/libview/ev-view.c
diff options
context:
space:
mode:
authorClement Lefebvre <[email protected]>2017-03-14 14:21:14 +0000
committerraveit65 <[email protected]>2017-08-18 21:18:30 +0200
commit3bd070a5580f2d6d678c266af88b7dc0b816f4db (patch)
tree01bcaf87d15338298e8cf8c78d126c31350cff88 /libview/ev-view.c
parent42768626e77556ca28a627e18db87ff7e3d4a61e (diff)
downloadatril-3bd070a5580f2d6d678c266af88b7dc0b816f4db.tar.bz2
atril-3bd070a5580f2d6d678c266af88b7dc0b816f4db.tar.xz
ev-view: explicitly require a GtkScrolledWindow as the parent widget
This is implicitly needed in a few places in code, so make the requirement explicit on ::parent-set. Upstream commit by garnacho on 11 Aug 2014: https://github.com/GNOME/evince/commit/6288e48
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r--libview/ev-view.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 77851234..4bd3b23c 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4757,6 +4757,16 @@ ev_view_forall (GtkContainer *container,
}
static void
+ev_view_parent_set (GtkWidget *widget,
+ GtkWidget *previous_parent)
+{
+ GtkWidget *parent;
+
+ parent = gtk_widget_get_parent (widget);
+ g_assert (!parent || GTK_IS_SCROLLED_WINDOW (parent));
+}
+
+static void
ev_view_class_init (EvViewClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
@@ -4788,6 +4798,7 @@ ev_view_class_init (EvViewClass *class)
widget_class->drag_motion = ev_view_drag_motion;
widget_class->popup_menu = ev_view_popup_menu;
widget_class->query_tooltip = ev_view_query_tooltip;
+ widget_class->parent_set = ev_view_parent_set;
object_class->dispose = ev_view_dispose;