summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
authorMihai Moldovan <[email protected]>2023-07-28 20:24:57 +0200
committerColomban Wendling <[email protected]>2023-10-24 10:58:13 +0200
commita67e582bc96aac4a779b0fe28e7a005ca166bd03 (patch)
treed8672c01afdadca95e8f0b4bedeb939bf6c38b1a /src/ui/frames.c
parenta938884530839152c9854dd0d8248b36c3c2e3fd (diff)
downloadmarco-a67e582bc96aac4a779b0fe28e7a005ca166bd03.tar.bz2
marco-a67e582bc96aac4a779b0fe28e7a005ca166bd03.tar.xz
ui/frames: check that compositing is not only requested, but also available.
Enabling code that is supposed to be used in compositing conditions is harmful if compositing is not actually available. Just checking the preference is not enough to make sure that compositing is available - the X server might be missing crucial extensions for compositing to work, which in turn correctly disables the internal compositor. The end result is graphical issues like black borders around windows in such situations. Make sure that compositing is both requested AND available to fix this bug.
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index d65dac82..ad7e10c8 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -37,6 +37,7 @@
#include "theme.h"
#include "prefs.h"
#include "ui.h"
+#include "display.h"
#ifdef HAVE_SHAPE
#include <X11/extensions/shape.h>
@@ -1063,11 +1064,12 @@ get_frame_region (int window_width,
#endif /* HAVE_SHAPE */
void
-meta_frames_apply_shapes (MetaFrames *frames,
- Window xwindow,
- int new_window_width,
- int new_window_height,
- gboolean window_has_shape)
+meta_frames_apply_shapes (MetaFrames *frames,
+ MetaDisplay *meta_display,
+ Window xwindow,
+ int new_window_width,
+ int new_window_height,
+ gboolean window_has_shape)
{
#ifdef HAVE_SHAPE
/* Apply shapes as if window had new_window_width, new_window_height */
@@ -1095,7 +1097,9 @@ meta_frames_apply_shapes (MetaFrames *frames,
meta_frames_calc_geometry (frames, frame, &fgeom);
- compositing_manager = meta_prefs_get_compositing_manager ();
+ compositing_manager = meta_prefs_get_compositing_manager () &&
+ meta_display &&
+ !!(meta_display_get_compositor (meta_display));
if (!window_has_shape && compositing_manager)
return;