[gtk/matthiasc/surface-state-rework: 52/80] gdk/popup: Remove the popup-layout-changed signal




commit 82e15f161e03db1bfe1a2a5566989275510e0798
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Dec 3 23:20:31 2020 +0100

    gdk/popup: Remove the popup-layout-changed signal
    
    It was replaced with GdkSurface::layout.

 gdk/gdkpopup.c              | 28 ----------------------------
 gdk/macos/gdkmacossurface.c |  2 +-
 gtk/gtkpopover.c            | 12 ------------
 3 files changed, 1 insertion(+), 41 deletions(-)
---
diff --git a/gdk/gdkpopup.c b/gdk/gdkpopup.c
index bcd8c8ed29..6e45e9f93e 100644
--- a/gdk/gdkpopup.c
+++ b/gdk/gdkpopup.c
@@ -38,15 +38,6 @@
 
 G_DEFINE_INTERFACE (GdkPopup, gdk_popup, GDK_TYPE_SURFACE)
 
-enum
-{
-  POPUP_LAYOUT_CHANGED,
-
-  N_SIGNALS
-};
-
-static guint signals[N_SIGNALS] = { 0 };
-
 static gboolean
 gdk_popup_default_present (GdkPopup       *popup,
                            int             width,
@@ -101,25 +92,6 @@ gdk_popup_default_init (GdkPopupInterface *iface)
                            P_("Whether to hide on outside clicks"),
                            FALSE,
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
-
-  /**
-   * GdkPopup::popup-layout-changed
-   * @popup: the #GdkSurface that was laid out
-   *
-   * Emitted when the layout of a popup surface has changed, e.g. if the popup
-   * layout was reactive and after the parent moved causing the popover to end
-   * up partially off-screen.
-   */
-  signals[POPUP_LAYOUT_CHANGED] =
-    g_signal_new (g_intern_static_string ("popup-layout-changed"),
-                  GDK_TYPE_POPUP,
-                  G_SIGNAL_RUN_FIRST,
-                  0,
-                  NULL,
-                  NULL,
-                  NULL,
-                  G_TYPE_NONE,
-                  0);
 }
 
 /**
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 7c441ca478..8ab2fc6115 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -85,7 +85,7 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
     }
 
   if (GDK_IS_POPUP (self) && self->did_initial_present)
-    g_signal_emit_by_name (self, "popup-layout-changed");
+    gdk_surface_request_layout (GDK_SURFACE (self));
 }
 
 static void
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 7fcfac9b66..21e7f2e716 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -766,16 +766,6 @@ surface_event (GdkSurface *surface,
   return TRUE;
 }
 
-static void
-popup_layout_changed (GdkSurface *surface,
-                      GtkWidget  *widget)
-{
-  GtkPopover *popover = GTK_POPOVER (widget);
-  GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
-
-  update_popover_layout (popover, gdk_popup_layout_ref (priv->layout));
-}
-
 static void
 gtk_popover_activate_default (GtkPopover *popover)
 {
@@ -894,7 +884,6 @@ gtk_popover_realize (GtkWidget *widget)
   g_signal_connect_swapped (priv->surface, "notify::mapped", G_CALLBACK (surface_mapped_changed), widget);
   g_signal_connect (priv->surface, "render", G_CALLBACK (surface_render), widget);
   g_signal_connect (priv->surface, "event", G_CALLBACK (surface_event), widget);
-  g_signal_connect (priv->surface, "popup-layout-changed", G_CALLBACK (popup_layout_changed), widget);
 
   GTK_WIDGET_CLASS (gtk_popover_parent_class)->realize (widget);
 
@@ -919,7 +908,6 @@ gtk_popover_unrealize (GtkWidget *widget)
   g_signal_handlers_disconnect_by_func (priv->surface, surface_mapped_changed, widget);
   g_signal_handlers_disconnect_by_func (priv->surface, surface_render, widget);
   g_signal_handlers_disconnect_by_func (priv->surface, surface_event, widget);
-  g_signal_handlers_disconnect_by_func (priv->surface, popup_layout_changed, widget);
   gdk_surface_set_widget (priv->surface, NULL);
   gdk_surface_destroy (priv->surface);
   g_clear_object (&priv->surface);


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