From 6f33395c69550e1fad6aa49d52e1284ca89f88c1 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Wed, 22 May 2019 10:56:11 -0400 Subject: Only shadow ARGB windows with a frame outside the frame An ARGB window with a frame is likely something like a transparent terminal. It looks awful (and breaks transparency) to draw a big opaque black shadow under the window, so clip out the region under the terminal from the shadow we draw. Add meta_window_get_frame_bounds() to get a cairo region for the outer bounds of the frame of a window, and modify the frame handling code to notice changes to the frame shape and discard a cached region. meta_frames_apply_shapes() is refactored so we can extract meta_frames_get_frame_bounds() from it. https://bugzilla.gnome.org/show_bug.cgi?id=635268 NOTE: Applied only partially, compositor part is still missing... upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/0f2e32d1 --- src/core/frame.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/core/frame.c') diff --git a/src/core/frame.c b/src/core/frame.c index 25f83ceb..d2f5cfd3 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -316,7 +316,7 @@ meta_frame_calc_borders (MetaFrame *frame, borders); } -static void +static gboolean update_shape (MetaFrame *frame) { if (frame->need_reapply_frame_shape) @@ -327,10 +327,13 @@ update_shape (MetaFrame *frame) frame->rect.height, frame->window->has_shape); frame->need_reapply_frame_shape = FALSE; + return TRUE; } + else + return FALSE; } -void +gboolean meta_frame_sync_to_window (MetaFrame *frame, int resize_gravity, gboolean need_move, @@ -338,8 +341,7 @@ meta_frame_sync_to_window (MetaFrame *frame, { if (!(need_move || need_resize)) { - update_shape (frame); - return; + return update_shape (frame); } meta_topic (META_DEBUG_GEOMETRY, @@ -381,6 +383,16 @@ meta_frame_sync_to_window (MetaFrame *frame, meta_ui_repaint_frame (frame->window->screen->ui, frame->xwindow); } + return need_resize; +} + +cairo_region_t * +meta_frame_get_frame_bounds (MetaFrame *frame) +{ + return meta_ui_get_frame_bounds (frame->window->screen->ui, + frame->xwindow, + frame->rect.width, + frame->rect.height); } void -- cgit v1.2.1