summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 13:08:13 -0400
committerVictor Kareh <[email protected]>2019-06-05 10:49:37 -0400
commit74a74246ea975400f4b876240d3040bba6e82a7a (patch)
treeb3058d925cd0500955e6539386d1eeff411f807f
parentb52aff0da9140a03159bf8da83e45da3baad7fc1 (diff)
downloadmarco-74a74246ea975400f4b876240d3040bba6e82a7a.tar.bz2
marco-74a74246ea975400f4b876240d3040bba6e82a7a.tar.xz
frame: make frame window transparent
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/74db1f11
-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 4b0b112f..07837c19 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -66,8 +66,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;
@@ -110,13 +113,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,