- gprivate->filters = NULL;
- gprivate->children = NULL;
-
- window->user_data = NULL;
-
- if (attributes_mask & GDK_WA_VISUAL)
- visual = attributes->visual;
- else
- visual = gdk_visual_get_system ();
- xvisual = ((GdkVisualPrivate*) visual)->xvisual;
-
- xattributes.event_mask = StructureNotifyMask;
- for (i = 0; i < my_nevent_masks; i++)
- {
- if (attributes->event_mask & (1 << (i + 1)))
- xattributes.event_mask |= my_event_masks_table[i];
- }
-
- if (xattributes.event_mask)
- xattributes_mask |= CWEventMask;
-
- if(attributes_mask & GDK_WA_NOREDIR) {
- xattributes.override_redirect =
- (attributes->override_redirect == FALSE)?False:True;
- xattributes_mask |= CWOverrideRedirect;
- } else
- xattributes.override_redirect = False;
-
- gclass = InputOutput;
- depth = visual->depth;
-
- if (attributes_mask & GDK_WA_COLORMAP)
- gprivate->colormap = attributes->colormap;
- else
- gprivate->colormap = gdk_colormap_get_system ();
-
- xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
- xattributes_mask |= CWColormap;
-
- xparent = gdk_root_window;
-
- xattributes.save_under = True;
- xattributes.override_redirect = True;
- xattributes.cursor = None;
- xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
-
- gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
- x, y, gprivate->width, gprivate->height,
- 0, depth, gclass, xvisual,
- xattributes_mask, &xattributes);
- gdk_window_ref (window);
- gdk_xid_table_insert (&gprivate->xwindow, window);
-
- if (gprivate->colormap)
- gdk_colormap_ref (gprivate->colormap);
-
- XSetWMProtocols (gprivate->xdisplay, gprivate->xwindow, gdk_wm_window_protocols, 2);
-
- size_hints.flags = PSize;
- size_hints.width = gprivate->width;
- size_hints.height = gprivate->height;
-
- wm_hints.flags = InputHint | StateHint | WindowGroupHint;
- wm_hints.window_group = gdk_leader_window;
- wm_hints.input = True;
- wm_hints.initial_state = NormalState;
-
- /* FIXME: Is there any point in doing this? Do any WM's pay
- * attention to PSize, and even if they do, is this the
- * correct value???
- */
- XSetWMNormalHints (gprivate->xdisplay, gprivate->xwindow, &size_hints);
-
- XSetWMHints (gprivate->xdisplay, gprivate->xwindow, &wm_hints);
-
- if (attributes_mask & GDK_WA_TITLE)
- title = attributes->title;
- else
-#if (GTK_MINOR_VERSION == 1)
- title = "Unknown"; // GLH: Well I don't know for the moment what to write here.
-#else
- title = gdk_progname;
-#endif
-
- XmbSetWMProperties (gprivate->xdisplay, gprivate->xwindow,
- title, title,
- NULL, 0,
- NULL, NULL, NULL);
-
- if (attributes_mask & GDK_WA_WMCLASS)
- {
- class_hint = XAllocClassHint ();
- class_hint->res_name = attributes->wmclass_name;
- class_hint->res_class = attributes->wmclass_class;
- XSetClassHint (gprivate->xdisplay, gprivate->xwindow, class_hint);
- XFree (class_hint);
- }
-
- return window;
-}
-
-} // extern "C"