summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-19 22:18:23 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-19 22:18:23 +0000
commit0e8a7fb48e88c408040a6d422b7f20ecd35271fc (patch)
tree2aad575fc50eafb2eab4b34f0dbbaf6c62814a06 /gtk
parent2268abe48fd5fbfaa25f9468e3843ac1e84d9c89 (diff)
downloadgtk+-0e8a7fb48e88c408040a6d422b7f20ecd35271fc.tar.gz
(Fixes related to #64428, Michael Meeks)
Mon Nov 19 17:11:23 2001 Owen Taylor <otaylor@redhat.com> (Fixes related to #64428, Michael Meeks) * gtk/gtkplug.c (gtk_plug_set_is_child): Unmap the widget, so it gets mapped again properly when we add to a parent. * gtk/gtkplug.c (_gtk_plug_add_to_socket): Set plug->socket_window. * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Set socket_window to NULL, not FALSE.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfixed.c44
-rw-r--r--gtk/gtkfixed.h3
-rw-r--r--gtk/gtkplug.c15
3 files changed, 60 insertions, 2 deletions
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 8f5dd6d4d0..c16aa2300f 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -505,3 +505,47 @@ gtk_fixed_forall (GtkContainer *container,
(* callback) (child->widget, callback_data);
}
}
+
+/**
+ * gtk_fixed_set_has_window:
+ * @fixed: a #GtkFixed
+ * @has_window: %TRUE if a separate window should be created
+ *
+ * Sets whether a #GtkFixed widget is created with a separate
+ * #GdkWindow for widget->window or not. (By default, it will be
+ * created with no separate #GdkWindow). This function must be called
+ * while the is not realized, for instance, immediately after the
+ * window is created.
+ **/
+void
+gtk_fixed_set_has_window (GtkFixed *fixed,
+ gboolean has_window)
+{
+ g_return_if_fail (GTK_IS_FIXED (fixed));
+ g_return_if_fail (!GTK_WIDGET_REALIZED (fixed));
+
+ if (!has_window != GTK_WIDGET_NO_WINDOW (fixed))
+ {
+ if (has_window)
+ GTK_WIDGET_UNSET_FLAGS (fixed, GTK_NO_WINDOW);
+ else
+ GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW);
+ }
+}
+
+/**
+ * gtk_fixed_get_has_window:
+ * @fixed: a #GtkWidget
+ *
+ * Gets whether the #GtkFixed has it's own #GdkWindow.
+ * See gdk_fixed_set_has_window().
+ *
+ * Return value:
+ **/
+gboolean
+gtk_fixed_get_has_window (GtkFixed *fixed)
+{
+ g_return_if_fail (GTK_IS_FIXED (fixed));
+
+ return !GTK_WIDGET_NO_WINDOW (fixed);
+}
diff --git a/gtk/gtkfixed.h b/gtk/gtkfixed.h
index 6e0bc593a4..ba07df8cbb 100644
--- a/gtk/gtkfixed.h
+++ b/gtk/gtkfixed.h
@@ -79,6 +79,9 @@ void gtk_fixed_move (GtkFixed *fixed,
GtkWidget *widget,
gint x,
gint y);
+void gtk_fixed_set_has_window (GtkFixed *fixed,
+ gboolean has_window);
+gboolean gtk_fixed_get_has_window (GtkFixed *fixed);
#ifdef __cplusplus
}
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index f937fa4569..c04aa81ab9 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -180,6 +180,14 @@ gtk_plug_set_is_child (GtkPlug *plug,
plug->modality_group = NULL;
}
+ /* As a toplevel, the MAPPED flag doesn't correspond
+ * to whether the widget->window is mapped; we unmap
+ * here, but don't bother remapping -- we will get mapped
+ * by gtk_widget_set_parent ().
+ */
+ if (GTK_WIDGET_MAPPED (plug))
+ gtk_widget_unmap (GTK_WIDGET (plug));
+
GTK_WIDGET_UNSET_FLAGS (plug, GTK_TOPLEVEL);
gtk_container_set_resize_mode (GTK_CONTAINER (plug), GTK_RESIZE_PARENT);
@@ -218,8 +226,11 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
gtk_plug_set_is_child (plug, TRUE);
plug->same_app = TRUE;
+ socket->same_app = TRUE;
socket->plug_widget = widget;
+ plug->socket_window = GTK_WIDGET (socket)->window;
+
if (GTK_WIDGET_REALIZED (widget))
gdk_window_reparent (widget->window, plug->socket_window, 0, 0);
@@ -229,7 +240,7 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
}
/**
- * _gtk_plug_add_to_socket:
+ * _gtk_plug_remove_from_socket:
* @plug: a #GtkPlug
* @socket: a #GtkSocket
*
@@ -267,7 +278,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug,
socket->same_app = FALSE;
plug->same_app = FALSE;
- plug->socket_window = FALSE;
+ plug->socket_window = NULL;
gtk_plug_set_is_child (plug, FALSE);