summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-04-14 19:58:13 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-04-14 20:30:30 +0300
commitdab0fcb1991f7aecc32df2ae857783bb646c1ddd (patch)
tree8a6d8cdda72012afe7a6fdc15222d99f1687699c
parent933dbae63c717fa9a7d60754640c6e21e60ce98b (diff)
downloadmetacity-dab0fcb1991f7aecc32df2ae857783bb646c1ddd.tar.gz
frame: always use the client window's visual
-rw-r--r--src/core/frame.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/src/core/frame.c b/src/core/frame.c
index 4542f638..7d94c091 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -93,11 +93,7 @@ void
meta_window_ensure_frame (MetaWindow *window)
{
MetaFrame *frame;
- MetaScreen *screen;
XSetWindowAttributes attrs;
- XVisualInfo visual_info;
- Visual *visual;
- int status;
if (window->frame)
return;
@@ -122,52 +118,18 @@ meta_window_ensure_frame (MetaWindow *window)
frame->is_flashing = FALSE;
frame->borders_cached = FALSE;
- 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);
meta_verbose ("Frame geometry %d,%d %dx%d\n",
frame->rect.x, frame->rect.y,
frame->rect.width, frame->rect.height);
- /* 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. NULL means default visual.
- *
- * We look for an ARGB visual if we can find one, otherwise use
- * the default of NULL.
- */
-
- screen = meta_window_get_screen (window);
- status = XMatchVisualInfo (window->display->xdisplay,
- XScreenNumberOfScreen (screen->xscreen),
- 32, TrueColor,
- &visual_info);
-
- if (!status)
- {
- /* Special case for depth 32 windows (assumed to be ARGB),
- * we use the window's visual. Otherwise we just use the system visual.
- */
- if (window->depth == 32)
- visual = window->xvisual;
- else
- visual = NULL;
- }
- else
- visual = visual_info.visual;
-
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay,
- visual,
+ window->xvisual,
frame->rect.x,
frame->rect.y,
- frame->rect.width,
- frame->rect.height,
- frame->window->screen->number);
+ frame->rect.width,
+ frame->rect.height,
+ frame->window->screen->number);
meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
attrs.event_mask = EVENT_MASK;