[gtk+] window: Remove _gtk_window_set_is_toplevel
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Remove _gtk_window_set_is_toplevel
- Date: Fri, 31 Mar 2017 07:55:42 +0000 (UTC)
commit cc05fc574c44f8446a07efc86d832cfb5e3773e3
Author: Timm Bäder <mail baedert org>
Date: Wed Feb 8 14:13:23 2017 +0100
window: Remove _gtk_window_set_is_toplevel
All GtkWindow instances are toplevels.
gtk/gtkwidget.c | 8 +----
gtk/gtkwindow.c | 72 ------------------------------------------------
gtk/gtkwindowprivate.h | 3 --
3 files changed, 1 insertions(+), 82 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ff1527e..2912371 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9161,6 +9161,7 @@ gtk_widget_set_parent_window (GtkWidget *widget,
GdkWindow *old_parent_window;
g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (!GTK_IS_WINDOW (widget));
old_parent_window = g_object_get_qdata (G_OBJECT (widget),
quark_parent_window);
@@ -9173,13 +9174,6 @@ gtk_widget_set_parent_window (GtkWidget *widget,
g_object_unref (old_parent_window);
if (parent_window)
g_object_ref (parent_window);
-
- /* Unset toplevel flag when adding a parent window to a widget,
- * this is the primary entry point to allow toplevels to be
- * embeddable.
- */
- if (GTK_IS_WINDOW (widget))
- _gtk_window_set_is_toplevel (GTK_WINDOW (widget), parent_window == NULL);
}
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 59ab521..33218c7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -10667,78 +10667,6 @@ _gtk_window_set_is_active (GtkWindow *window,
}
/**
- * _gtk_window_set_is_toplevel:
- * @window: a #GtkWindow
- * @is_toplevel: %TRUE if the window is still a real toplevel (nominally a
- * child of the root window); %FALSE if it is not (for example, for an
- * in-process, parented GtkPlug)
- *
- * Internal function used by #GtkPlug when it gets parented/unparented by a
- * #GtkSocket. This keeps the @window’s #GTK_WINDOW_TOPLEVEL flag in sync
- * with the global list of toplevel windows.
- */
-void
-_gtk_window_set_is_toplevel (GtkWindow *window,
- gboolean is_toplevel)
-{
- GtkWidget *widget;
- GtkWidget *toplevel;
-
- widget = GTK_WIDGET (window);
-
- if (_gtk_widget_is_toplevel (widget))
- g_assert (g_slist_find (toplevel_list, window) != NULL);
- else
- g_assert (g_slist_find (toplevel_list, window) == NULL);
-
- if (is_toplevel == _gtk_widget_is_toplevel (widget))
- return;
-
- if (is_toplevel)
- {
- /* Pass through regular pathways of an embedded toplevel
- * to go through unmapping and hiding the widget before
- * becomming a toplevel again.
- *
- * We remain hidden after becomming toplevel in order to
- * avoid problems during an embedded toplevel's dispose cycle
- * (When a toplevel window is shown it tries to grab focus again,
- * this causes problems while disposing).
- */
- gtk_widget_hide (widget);
-
- /* Save the toplevel this widget was previously anchored into before
- * propagating a hierarchy-changed.
- *
- * Usually this happens by way of gtk_widget_unparent() and we are
- * already unanchored at this point, just adding this clause incase
- * things happen differently.
- */
- toplevel = _gtk_widget_get_toplevel (widget);
- if (!_gtk_widget_is_toplevel (toplevel))
- toplevel = NULL;
-
- _gtk_widget_set_is_toplevel (widget, TRUE);
-
- /* When a window becomes toplevel after being embedded and anchored
- * into another window we need to unset its anchored flag so that
- * the hierarchy changed signal kicks in properly.
- */
- _gtk_widget_set_anchored (widget, FALSE);
- _gtk_widget_propagate_hierarchy_changed (widget, toplevel);
-
- toplevel_list = g_slist_prepend (toplevel_list, window);
- }
- else
- {
- _gtk_widget_set_is_toplevel (widget, FALSE);
- toplevel_list = g_slist_remove (toplevel_list, window);
- _gtk_widget_propagate_hierarchy_changed (widget, widget);
- }
- gtk_window_update_debugging ();
-}
-
-/**
* gtk_window_set_auto_startup_notification:
* @setting: %TRUE to automatically do startup notification
*
diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h
index ce1383b..604c297 100644
--- a/gtk/gtkwindowprivate.h
+++ b/gtk/gtkwindowprivate.h
@@ -52,9 +52,6 @@ void _gtk_window_unset_focus_and_default (GtkWindow *window,
void _gtk_window_set_is_active (GtkWindow *window,
gboolean is_active);
-void _gtk_window_set_is_toplevel (GtkWindow *window,
- gboolean is_toplevel);
-
void _gtk_window_set_allocation (GtkWindow *window,
const GtkAllocation *allocation,
GtkAllocation *allocation_out);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]