+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
+Tue Oct 23 17:31:42 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
+ set window->parent (except or the root window itself); if
+ the window's parent is not a GdkWindow, or is a window of
+ type GDK_WINDOW_FOREIGN, set window->parent to the root parent.
+
+ * gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
+ windows of type GDK_WINDOW_FOREIGN.
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
private->bg_pixmap = NULL;
}
- if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+ if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_FOREIGN)
+ g_assert (private->children == NULL);
+ else
{
children = tmp = private->children;
private->children = NULL;
tmp_list = ((GdkWindowObject *)_gdk_parent_root)->children;
while (tmp_list)
{
- new_list = g_list_prepend (new_list, tmp_list->data);
+ if (GDK_WINDOW_TYPE (tmp_list->data) != GDK_WINDOW_FOREIGN)
+ new_list = g_list_prepend (new_list, tmp_list->data);
tmp_list = tmp_list->next;
}
{
GdkWindow *window;
GdkWindowObject *private;
- GdkWindowObject *parent_private;
GdkWindowImplWin32 *impl;
GdkDrawableImplWin32 *draw_impl;
(attributes->window_type == GDK_WINDOW_TEMP ? "TEMP" :
"???"))))));
- parent_private = (GdkWindowObject*) parent;
if (GDK_WINDOW_DESTROYED (parent))
return NULL;
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
+ /* Windows with a foreign parent are treated as if they are children
+ * of the root window, except for actual creation.
+ */
+ if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
+ parent = _gdk_parent_root;
+
private->parent = (GdkWindowObject *)parent;
if (attributes_mask & GDK_WA_X)
impl->event_mask = GDK_STRUCTURE_MASK | attributes->event_mask;
- if (parent_private && parent_private->guffaw_gravity)
+ if (private->parent && private->parent->guffaw_gravity)
{
/* XXX ??? */
}
GDK_NOTE (MISC, g_print ("...GDK_INPUT_ONLY, system colormap\n"));
}
- if (parent_private)
- parent_private->children = g_list_prepend (parent_private->children, window);
+ if (private->parent)
+ private->parent->children = g_list_prepend (private->parent->children, window);
switch (private->window_type)
{
{
GdkWindow *window;
GdkWindowObject *private;
- GdkWindowObject *parent_private;
GdkWindowImplWin32 *impl;
GdkDrawableImplWin32 *draw_impl;
parent = GetParent ((HWND)anid);
private->parent = gdk_win32_handle_table_lookup ((GdkNativeWindow) parent);
+ if (!private->parent || GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_FOREIGN)
+ private->parent = (GdkWindowObject *)_gdk_parent_root;
- parent_private = (GdkWindowObject *)private->parent;
-
- if (parent_private)
- parent_private->children = g_list_prepend (parent_private->children, window);
+ private->parent->children = g_list_prepend (private->parent->children, window);
draw_impl->handle = (HWND) anid;
GetClientRect ((HWND) anid, &rect);
x, y, impl->width, impl->height, TRUE))
WIN32_API_FAILED ("MoveWindow");
}
+
+ /* From here on, we treat parents of type GDK_WINDOW_FOREIGN like
+ * the root window
+ */
+ if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
+ new_parent = _gdk_parent_root;
window_private->parent = (GdkWindowObject *)new_parent;
{
GdkWindow *window;
GdkWindowObject *private;
- GdkWindowObject *parent_private;
GdkWindowImplX11 *impl;
GdkDrawableImplX11 *draw_impl;
g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
- parent_private = (GdkWindowObject*) parent;
if (GDK_WINDOW_DESTROYED (parent))
return NULL;
impl = GDK_WINDOW_IMPL_X11 (private->impl);
draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
-
+
xdisplay = draw_impl->xdisplay = GDK_WINDOW_XDISPLAY (parent);
+
+ /* Windows with a foreign parent are treated as if they are children
+ * of the root window, except for actual creation.
+ */
+ if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
+ parent = _gdk_parent_root;
private->parent = (GdkWindowObject *)parent;
* attributes->window_type for input-only windows
* before
*/
- if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT &&
- GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
+ if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT)
private->window_type = GDK_WINDOW_TEMP;
else
private->window_type = GDK_WINDOW_CHILD;
else
xattributes.override_redirect = False;
- if (parent_private && parent_private->guffaw_gravity)
+ if (private->parent && private->parent->guffaw_gravity)
{
xattributes.win_gravity = StaticGravity;
xattributes_mask |= CWWinGravity;
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
- if (GDK_WINDOW_TYPE (parent) != GDK_WINDOW_ROOT &&
- GDK_WINDOW_TYPE (parent) != GDK_WINDOW_FOREIGN)
+ if (GDK_WINDOW_TYPE (parent) != GDK_WINDOW_ROOT)
{
g_warning (G_STRLOC "Toplevel windows must be created as children of\n"
"of a window of type GDK_WINDOW_ROOT or GDK_WINDOW_FOREIGN");
(attributes->cursor) :
NULL));
- if (parent_private)
- parent_private->children = g_list_prepend (parent_private->children, window);
+ if (private->parent)
+ private->parent->children = g_list_prepend (private->parent->children, window);
switch (GDK_WINDOW_TYPE (private))
{
{
GdkWindow *window;
GdkWindowObject *private;
- GdkWindowObject *parent_private;
GdkWindowImplX11 *impl;
GdkDrawableImplX11 *draw_impl;
XWindowAttributes attrs;
draw_impl->wrapper = GDK_DRAWABLE (window);
private->parent = gdk_xid_table_lookup (parent);
+ if (!private->parent || GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_FOREIGN)
+ private->parent = (GdkWindowObject *)_gdk_parent_root;
- parent_private = (GdkWindowObject *)private->parent;
-
- if (parent_private)
- parent_private->children = g_list_prepend (parent_private->children, window);
+ private->parent->children = g_list_prepend (private->parent->children, window);
draw_impl->xid = anid;
draw_impl->xdisplay = gdk_display;
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (new_parent),
x, y);
+
+ /* From here on, we treat parents of type GDK_WINDOW_FOREIGN like
+ * the root window
+ */
+ if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
+ new_parent = _gdk_parent_root;
window_private->parent = (GdkWindowObject *)new_parent;