[nautilus/wip/antoniof/gtk4-preparation-drop-outgoing-api: 47/49] pathbar: Remove event GdkWindow




commit 6e6867162dcd11966d1598b07a664f29cbd965eb
Author: Ernestas Kulik <ernestask gnome org>
Date:   Thu Jul 26 15:05:46 2018 +0300

    pathbar: Remove event GdkWindow
    
    This usage of GdkWindow is a X11'ism that's gone in GTK4.
    
    Removing this doesn't seem to cause any visual or behavorial change at
    the moment.
    
    Rebased and ammended by António Fernandes <antoniof gnome org>

 src/nautilus-pathbar.c | 81 --------------------------------------------------
 1 file changed, 81 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index d3c1f89c7..4741e0ac1 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -87,8 +87,6 @@ struct _NautilusPathBar
 {
     GtkContainer parent_instance;
 
-    GdkWindow *event_window;
-
     GFile *current_path;
     gpointer current_button_data;
 
@@ -434,30 +432,6 @@ nautilus_path_bar_get_preferred_height (GtkWidget *widget,
     }
 }
 
-static void
-nautilus_path_bar_unmap (GtkWidget *widget)
-{
-    NautilusPathBar *self;
-
-    self = NAUTILUS_PATH_BAR (widget);
-
-    gdk_window_hide (self->event_window);
-
-    GTK_WIDGET_CLASS (nautilus_path_bar_parent_class)->unmap (widget);
-}
-
-static void
-nautilus_path_bar_map (GtkWidget *widget)
-{
-    NautilusPathBar *self;
-
-    self = NAUTILUS_PATH_BAR (widget);
-
-    gdk_window_show (self->event_window);
-
-    GTK_WIDGET_CLASS (nautilus_path_bar_parent_class)->map (widget);
-}
-
 #define BUTTON_BOTTOM_SHADOW 1
 
 /* This is a tad complicated */
@@ -625,57 +599,6 @@ nautilus_path_bar_screen_changed (GtkWidget *widget,
     nautilus_path_bar_check_icon_theme (NAUTILUS_PATH_BAR (widget));
 }
 
-static void
-nautilus_path_bar_realize (GtkWidget *widget)
-{
-    NautilusPathBar *self;
-    GtkAllocation allocation;
-    GdkWindow *window;
-    GdkWindowAttr attributes;
-    gint attributes_mask;
-
-    gtk_widget_set_realized (widget, TRUE);
-
-    self = NAUTILUS_PATH_BAR (widget);
-
-    window = gtk_widget_get_parent_window (widget);
-    gtk_widget_set_window (widget, window);
-    g_object_ref (window);
-
-    gtk_widget_get_allocation (widget, &allocation);
-
-    attributes.window_type = GDK_WINDOW_CHILD;
-    attributes.x = allocation.x;
-    attributes.y = allocation.y;
-    attributes.width = allocation.width;
-    attributes.height = allocation.height;
-    attributes.wclass = GDK_INPUT_ONLY;
-    attributes.event_mask = gtk_widget_get_events (widget);
-    attributes.event_mask |=
-        GDK_BUTTON_PRESS_MASK |
-        GDK_BUTTON_RELEASE_MASK |
-        GDK_POINTER_MOTION_MASK;
-    attributes_mask = GDK_WA_X | GDK_WA_Y;
-
-    self->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
-                                         &attributes, attributes_mask);
-    gdk_window_set_user_data (self->event_window, widget);
-}
-
-static void
-nautilus_path_bar_unrealize (GtkWidget *widget)
-{
-    NautilusPathBar *self;
-
-    self = NAUTILUS_PATH_BAR (widget);
-
-    gdk_window_set_user_data (self->event_window, NULL);
-    gdk_window_destroy (self->event_window);
-    self->event_window = NULL;
-
-    GTK_WIDGET_CLASS (nautilus_path_bar_parent_class)->unrealize (widget);
-}
-
 static void
 nautilus_path_bar_add (GtkContainer *container,
                        GtkWidget    *widget)
@@ -854,10 +777,6 @@ nautilus_path_bar_class_init (NautilusPathBarClass *path_bar_class)
 
     widget_class->get_preferred_height = nautilus_path_bar_get_preferred_height;
     widget_class->get_preferred_width = nautilus_path_bar_get_preferred_width;
-    widget_class->realize = nautilus_path_bar_realize;
-    widget_class->unrealize = nautilus_path_bar_unrealize;
-    widget_class->unmap = nautilus_path_bar_unmap;
-    widget_class->map = nautilus_path_bar_map;
     widget_class->size_allocate = nautilus_path_bar_size_allocate;
     widget_class->style_updated = nautilus_path_bar_style_updated;
     widget_class->screen_changed = nautilus_path_bar_screen_changed;


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