summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-09-09 03:44:42 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-09-09 03:44:42 +0000
commit936adc6ea50c495937dbd8e447737c105adcc4c6 (patch)
tree3df42c4f9e885a213448d0b3a6d8f2391e5f877d /src/frame.c
parentbc787fc1f3f90453171a04ec37437aa3fd3855e2 (diff)
downloadmetacity-936adc6ea50c495937dbd8e447737c105adcc4c6.tar.gz
don't use gdk_display_name
2001-09-08 Havoc Pennington <hp@pobox.com> * src/ui.c (meta_ui_init): don't use gdk_display_name * src/frame.c (meta_window_ensure_frame): create frame with screen default visual, rather than client window visual; for DRI games, the client window visual was not allowed to be a child of another window with the same visual, apparently. Anyhow now we copy twm, etc. so it must be correct. * src/place.c (meta_window_place): if a transient is placed and its parent has focus, focus the transient.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/frame.c b/src/frame.c
index 563d8528..7d9f5e9e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -56,6 +56,19 @@ meta_window_ensure_frame (MetaWindow *window)
frame->mapped = FALSE;
attrs.event_mask = EVENT_MASK;
+
+ meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n",
+ window->desc,
+ XVisualIDFromVisual (window->xvisual) ==
+ XVisualIDFromVisual (window->screen->default_xvisual) ?
+ "is" : "is not",
+ window->depth, window->screen->default_depth);
+
+ /* Default depth/visual handles clients with weird visuals; they can
+ * always be children of the root depth/visual obviously, but
+ * e.g. DRI games can't be children of a parent that has the same
+ * visual as the client.
+ */
frame->xwindow = XCreateWindow (window->display->xdisplay,
window->screen->xroot,
@@ -64,9 +77,9 @@ meta_window_ensure_frame (MetaWindow *window)
frame->rect.width,
frame->rect.height,
0,
- window->depth,
- InputOutput,
- window->xvisual,
+ window->screen->default_depth,
+ CopyFromParent,
+ window->screen->default_xvisual,
CWEventMask,
&attrs);
@@ -90,15 +103,17 @@ meta_window_ensure_frame (MetaWindow *window)
* we don't want to take that as a withdraw
*/
window->unmaps_pending += 1;
+ /* window was reparented to this position */
window->rect.x = 0;
window->rect.y = 0;
+
XReparentWindow (window->display->xdisplay,
window->xwindow,
frame->xwindow,
window->rect.x,
window->rect.y);
meta_error_trap_pop (window->display);
-
+
/* stick frame to the window */
window->frame = frame;