summaryrefslogtreecommitdiff
path: root/src/compositor/compositor-xrender.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-24 13:38:54 +0200
committerinfirit <[email protected]>2014-10-24 15:40:43 +0200
commit470fed7e80a741e43e53f2e2186f9470db132983 (patch)
tree3c364aae98f80d74e073cda5da26e5fa444bec57 /src/compositor/compositor-xrender.c
parent13741f524e5f8b780a96872f534237186fa78741 (diff)
downloadmarco-470fed7e80a741e43e53f2e2186f9470db132983.tar.bz2
marco-470fed7e80a741e43e53f2e2186f9470db132983.tar.xz
don't show shadow for maximized windows
based on metacity commit: 72d1c6a6b9a85391444bb5ff8c5de1e3aabd3fd9 From: Alberts Muktupāvels <[email protected]>
Diffstat (limited to 'src/compositor/compositor-xrender.c')
-rw-r--r--src/compositor/compositor-xrender.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 9bf9d8d1..68898257 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -905,6 +905,13 @@ window_has_shadow (MetaCompWindow *cw)
as the frame might be the reason the window is shaped */
if (cw->window)
{
+ /* Do not add shadows for maximized windows */
+ if (meta_window_is_maximized (cw->window))
+ {
+ meta_verbose ("Window has no shadow because it is maximized\n");
+ return FALSE;
+ }
+
if (meta_window_get_frame (cw->window)) {
meta_verbose ("Window has shadow because it has a frame\n");
return TRUE;
@@ -3011,6 +3018,38 @@ xrender_set_active_window (MetaCompositor *compositor,
#endif
}
+static void
+xrender_maximize_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+#ifdef HAVE_COMPOSITE_EXTENSIONS
+ MetaFrame *frame = meta_window_get_frame (window);
+ Window xid = frame ? meta_frame_get_xwindow (frame) : meta_window_get_xwindow (window);
+ MetaCompWindow *cw = find_window_in_display (meta_window_get_display (window), xid);
+
+ if (!cw)
+ return;
+
+ cw->needs_shadow = window_has_shadow (cw);
+#endif
+}
+
+static void
+xrender_unmaximize_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+#ifdef HAVE_COMPOSITE_EXTENSIONS
+ MetaFrame *frame = meta_window_get_frame (window);
+ Window xid = frame ? meta_frame_get_xwindow (frame) : meta_window_get_xwindow (window);
+ MetaCompWindow *cw = find_window_in_display (meta_window_get_display (window), xid);
+
+ if (!cw)
+ return;
+
+ cw->needs_shadow = window_has_shadow (cw);
+#endif
+}
+
static MetaCompositor comp_info = {
xrender_destroy,
xrender_manage_screen,
@@ -3020,7 +3059,9 @@ static MetaCompositor comp_info = {
xrender_set_updates,
xrender_process_event,
xrender_get_window_pixmap,
- xrender_set_active_window
+ xrender_set_active_window,
+ xrender_maximize_window,
+ xrender_unmaximize_window,
};
MetaCompositor *