[gtksourceview/wip/chergert/gsv-gtk4: 155/197] completion: track surface/window changes



commit bf936baffaef0377397e8a34a954b7c0c7f31e6b
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 16 16:25:16 2020 -0700

    completion: track surface/window changes

 gtksourceview/gtksourcecompletion.c     |  6 ------
 gtksourceview/gtksourcecompletioninfo.c | 25 -------------------------
 2 files changed, 31 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 00ffd57f..0ba43c8a 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -2167,9 +2167,6 @@ init_main_window (GtkSourceCompletion *completion,
                      "margin", 0,
                      NULL);
 
-       gtk_window_set_attached_to (GTK_WINDOW (completion->main_window),
-                                   GTK_WIDGET (completion->view));
-
        g_signal_connect_swapped (completion->main_window,
                                  "size-allocate",
                                  G_CALLBACK (update_window_position),
@@ -2195,9 +2192,6 @@ init_info_window (GtkSourceCompletion *completion)
        completion->info_window = gtk_source_completion_info_new ();
        g_object_ref_sink (completion->info_window);
 
-       gtk_window_set_attached_to (GTK_WINDOW (completion->info_window),
-                                   GTK_WIDGET (completion->main_window));
-
        g_signal_connect_swapped (completion->info_window,
                                  "size-allocate",
                                  G_CALLBACK (update_info_position),
diff --git a/gtksourceview/gtksourcecompletioninfo.c b/gtksourceview/gtksourcecompletioninfo.c
index 0108b4a4..44c567c0 100644
--- a/gtksourceview/gtksourcecompletioninfo.c
+++ b/gtksourceview/gtksourcecompletioninfo.c
@@ -44,14 +44,6 @@
  * gtk_container_add (GTK_CONTAINER (info), scrolled_window);
  *   </programlisting>
  * </example>
- *
- * If the calltip is displayed on top of a certain widget, say a #GtkTextView,
- * you should attach the calltip window to the #GtkTextView with
- * gtk_window_set_attached_to().  By doing this, the calltip will be hidden when
- * the #GtkWidget::focus-out-event signal is emitted by the #GtkTextView. You
- * may also be interested by the #GtkTextBuffer:cursor-position property (when
- * its value is modified). If you use the #GtkSourceCompletionInfo through the
- * #GtkSourceCompletion machinery, you don't need to worry about this.
  */
 
 #include "config.h"
@@ -128,29 +120,13 @@ set_attached_to (GtkSourceCompletionInfo *info,
        info->transient_set = FALSE;
 }
 
-static void
-update_attached_to (GtkSourceCompletionInfo *info)
-{
-       set_attached_to (info, gtk_window_get_attached_to (GTK_WINDOW (info)));
-}
-
 static void
 gtk_source_completion_info_init (GtkSourceCompletionInfo *info)
 {
-       g_signal_connect (info,
-                         "notify::attached-to",
-                         G_CALLBACK (update_attached_to),
-                         NULL);
-
-       update_attached_to (info);
-
        /* Tooltip style */
        gtk_window_set_title (GTK_WINDOW (info), _("Completion Info"));
        gtk_widget_set_name (GTK_WIDGET (info), "gtk-tooltip");
 
-       gtk_window_set_type_hint (GTK_WINDOW (info),
-                                 GDK_SURFACE_TYPE_HINT_COMBO);
-
        g_object_set (info, "margin", 1, NULL);
 }
 
@@ -279,7 +255,6 @@ GtkSourceCompletionInfo *
 gtk_source_completion_info_new (void)
 {
        return g_object_new (GTK_SOURCE_TYPE_COMPLETION_INFO,
-                            "type", GTK_WINDOW_POPUP,
                             "margin", 3,
                             NULL);
 }


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