summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-01-20 00:54:47 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-01-20 04:01:54 +0200
commit6b31f76594fe55018ca84b818a8d69b893f01bb8 (patch)
tree53ac49e61819756d539da62c9190abd03deacc94
parent7935223bbddee062b1dffb4c8c73bc4ae718beea (diff)
downloadmetacity-6b31f76594fe55018ca84b818a8d69b893f01bb8.tar.gz
frame: make frame window transparent
-rw-r--r--src/core/frame.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/core/frame.c b/src/core/frame.c
index 7389da1c..b03dea56 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -64,8 +64,11 @@ void
meta_window_ensure_frame (MetaWindow *window)
{
MetaFrame *frame;
+ MetaScreen *screen;
XSetWindowAttributes attrs;
+ XVisualInfo visual_info;
Visual *visual;
+ int status;
if (window->frame)
return;
@@ -108,13 +111,24 @@ meta_window_ensure_frame (MetaWindow *window)
* the default of NULL.
*/
- /* 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;
+ 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 = NULL;
+ visual = visual_info.visual;
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay,