diff options
author | Timm Bäder <mail@baedert.org> | 2016-11-04 10:04:44 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2016-11-05 11:56:36 +0100 |
commit | 846cf681e8602399e172c256a93cd7484708219a (patch) | |
tree | 790059314c7548a9ea10353ddcc72dfbcfdc9133 /gtk | |
parent | 34626eaa161401838445510a64b0edba4713b45e (diff) | |
download | gtk+-846cf681e8602399e172c256a93cd7484708219a.tar.gz |
Remove gtk_widget_set_mapped
Let all the remaining callers chain up.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcontainer.c | 15 | ||||
-rw-r--r-- | gtk/gtklayout.c | 2 | ||||
-rw-r--r-- | gtk/gtkshortcutssection.c | 4 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 4 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 25 | ||||
-rw-r--r-- | gtk/gtkwidget.h | 3 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 4 |
7 files changed, 10 insertions, 47 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 5797aaf29e..a68fa8708c 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -3090,28 +3090,17 @@ gtk_container_map_child (GtkWidget *child, static void gtk_container_map (GtkWidget *widget) { - gtk_widget_set_mapped (widget, TRUE); + GTK_WIDGET_CLASS (parent_class)->map (widget); gtk_container_forall (GTK_CONTAINER (widget), gtk_container_map_child, NULL); - - if (_gtk_widget_get_has_window (widget)) - gdk_window_show (_gtk_widget_get_window (widget)); } static void gtk_container_unmap (GtkWidget *widget) { - gtk_widget_set_mapped (widget, FALSE); - - /* hide our window first so user doesn't see all the child windows - * vanishing one by one. (only matters these days if one of the - * children has an actual native window instead of client-side - * window, e.g. a GtkSocket would) - */ - if (_gtk_widget_get_has_window (widget)) - gdk_window_hide (_gtk_widget_get_window (widget)); + GTK_WIDGET_CLASS (parent_class)->unmap (widget); gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback)gtk_widget_unmap, diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index d43e9c0c9f..fc87e25fd5 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -817,7 +817,7 @@ gtk_layout_map (GtkWidget *widget) GtkLayoutPrivate *priv = layout->priv; GList *tmp_list; - gtk_widget_set_mapped (widget, TRUE); + GTK_WIDGET_CLASS (gtk_layout_parent_class)->map (widget); tmp_list = priv->children; while (tmp_list) diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index 6ffca92356..38c1294bb1 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -192,7 +192,7 @@ gtk_shortcuts_section_map (GtkWidget *widget) if (self->need_reflow) gtk_shortcuts_section_reflow_groups (self); - gtk_widget_set_mapped (widget, TRUE); + GTK_WIDGET_CLASS (gtk_shortcuts_section_parent_class)->map (widget); map_child (GTK_WIDGET (self->stack)); map_child (GTK_WIDGET (self->footer)); @@ -203,7 +203,7 @@ gtk_shortcuts_section_unmap (GtkWidget *widget) { GtkShortcutsSection *self = GTK_SHORTCUTS_SECTION (widget); - gtk_widget_set_mapped (widget, FALSE); + GTK_WIDGET_CLASS (gtk_shortcuts_section_parent_class)->unmap (widget); gtk_widget_unmap (GTK_WIDGET (self->footer)); gtk_widget_unmap (GTK_WIDGET (self->stack)); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 0887f5f9ef..9747b63d19 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2272,7 +2272,7 @@ gtk_tree_view_map (GtkWidget *widget) GtkTreeView *tree_view = GTK_TREE_VIEW (widget); GList *tmp_list; - gtk_widget_set_mapped (widget, TRUE); + GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->map (widget); tmp_list = tree_view->priv->children; while (tmp_list) @@ -2289,8 +2289,6 @@ gtk_tree_view_map (GtkWidget *widget) gdk_window_show (tree_view->priv->bin_window); gtk_tree_view_map_buttons (tree_view); - - gdk_window_show (gtk_widget_get_window (widget)); } static void diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 2335936b82..f74104b0e5 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8295,27 +8295,6 @@ gtk_widget_get_mapped (GtkWidget *widget) } /** - * gtk_widget_set_mapped: - * @widget: a #GtkWidget - * @mapped: %TRUE to mark the widget as mapped - * - * Marks the widget as being realized. - * - * This function should only ever be called in a derived widget's - * “map” or “unmap” implementation. - * - * Since: 2.20 - */ -void -gtk_widget_set_mapped (GtkWidget *widget, - gboolean mapped) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - widget->priv->mapped = mapped; -} - -/** * gtk_widget_set_redraw_on_allocate: * @widget: a #GtkWidget * @redraw_on_allocate: if %TRUE, the entire widget will be redrawn @@ -10684,7 +10663,7 @@ gtk_widget_real_map (GtkWidget *widget) if (!_gtk_widget_get_mapped (widget)) { - gtk_widget_set_mapped (widget, TRUE); + priv->mapped = TRUE; if (_gtk_widget_get_has_window (widget)) gdk_window_show (priv->window); @@ -10706,7 +10685,7 @@ gtk_widget_real_unmap (GtkWidget *widget) if (_gtk_widget_get_mapped (widget)) { - gtk_widget_set_mapped (widget, FALSE); + priv->mapped = FALSE; if (_gtk_widget_get_has_window (widget)) gdk_window_hide (priv->window); diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index f81b4eb003..d2291831b0 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -784,9 +784,6 @@ void gtk_widget_set_realized (GtkWidget *widget, GDK_AVAILABLE_IN_ALL gboolean gtk_widget_get_realized (GtkWidget *widget); GDK_AVAILABLE_IN_ALL -void gtk_widget_set_mapped (GtkWidget *widget, - gboolean mapped); -GDK_AVAILABLE_IN_ALL gboolean gtk_widget_get_mapped (GtkWidget *widget); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 6242c0d5f3..4cbca1eb02 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5973,7 +5973,7 @@ gtk_window_map (GtkWidget *widget) if (priv->initial_fullscreen_monitor > gdk_display_get_n_monitors (display)) priv->initial_fullscreen_monitor = -1; - gtk_widget_set_mapped (widget, TRUE); + GTK_WIDGET_CLASS (gtk_window_parent_class)->map (widget); child = gtk_bin_get_child (&(window->bin)); if (child != NULL && gtk_widget_get_visible (child)) @@ -6120,7 +6120,7 @@ gtk_window_unmap (GtkWidget *widget) gdk_window = _gtk_widget_get_window (widget); - gtk_widget_set_mapped (widget, FALSE); + GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget); gdk_window_withdraw (gdk_window); while (priv->configure_request_count > 0) |