[evince] ev-view: explicitly require a GtkScrolledWindow as the parent widget



commit 6288e4889ed859cfca90e18912270df0b47ffebf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 11 13:25:17 2014 +0200

    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.

 libview/ev-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 1737139..abeaa24 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -6739,6 +6739,16 @@ ev_view_focus (GtkWidget        *widget,
 }
 
 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);
@@ -6773,6 +6783,7 @@ ev_view_class_init (EvViewClass *class)
        widget_class->query_tooltip = ev_view_query_tooltip;
        widget_class->screen_changed = ev_view_screen_changed;
        widget_class->focus = ev_view_focus;
+       widget_class->parent_set = ev_view_parent_set;
 
        container_class->remove = ev_view_remove;
        container_class->forall = ev_view_forall;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]