[metacity] frame: make frame window transparent
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] frame: make frame window transparent
- Date: Tue, 20 Jan 2015 21:38:46 +0000 (UTC)
commit 74db1f11977ec96a478c9caf1f3ea0e6e46e7aba
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Jan 20 00:54:47 2015 +0200
frame: make frame window transparent
src/core/frame.c | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index 7389da1..b03dea5 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]