diff --git a/clients/window.c b/clients/window.c index 106742ec0..f6e0fedfa 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4937,6 +4937,20 @@ window_set_locked_pointer_motion_handler(struct window *window, window->locked_pointer_motion_handler = handler; } +void +window_set_shadow(struct window *window) +{ + if (window->frame) + frame_unset_flag(window->frame->frame, FRAME_FLAG_NO_SHADOW); +} + +void +window_unset_shadow(struct window *window) +{ + if (window->frame) + frame_set_flag(window->frame->frame, FRAME_FLAG_NO_SHADOW); +} + void window_set_title(struct window *window, const char *title) { diff --git a/clients/window.h b/clients/window.h index a682f9b56..9426fb36b 100644 --- a/clients/window.h +++ b/clients/window.h @@ -530,6 +530,12 @@ void window_set_locked_pointer_motion_handler( struct window *window, window_locked_pointer_motion_handler_t handler); +void +window_set_shadow(struct window *window); + +void +window_unset_shadow(struct window *window); + void window_set_title(struct window *window, const char *title); diff --git a/shared/cairo-util.c b/shared/cairo-util.c index 57288fbcd..47a96e080 100644 --- a/shared/cairo-util.c +++ b/shared/cairo-util.c @@ -556,6 +556,8 @@ theme_render_frame(struct theme *t, if (flags & THEME_FRAME_MAXIMIZED) margin = 0; + else if (flags & THEME_FRAME_NO_SHADOW) + margin = t->margin; else { render_shadow(cr, t->shadow, 2, 2, width + 8, height + 8, diff --git a/shared/cairo-util.h b/shared/cairo-util.h index 59f4b58f9..e19f20088 100644 --- a/shared/cairo-util.h +++ b/shared/cairo-util.h @@ -76,7 +76,8 @@ theme_destroy(struct theme *t); enum { THEME_FRAME_ACTIVE = 1, THEME_FRAME_MAXIMIZED = 2, - THEME_FRAME_NO_TITLE = 4 + THEME_FRAME_NO_TITLE = 4, + THEME_FRAME_NO_SHADOW = 8 }; void @@ -122,7 +123,8 @@ enum frame_status { enum frame_flag { FRAME_FLAG_ACTIVE = 0x1, - FRAME_FLAG_MAXIMIZED = 0x2 + FRAME_FLAG_MAXIMIZED = 0x2, + FRAME_FLAG_NO_SHADOW = 0x4 }; enum { diff --git a/shared/frame.c b/shared/frame.c index 8094b37c1..e8d4cdebe 100644 --- a/shared/frame.c +++ b/shared/frame.c @@ -1067,6 +1067,9 @@ frame_repaint(struct frame *frame, cairo_t *cr) if (frame->flags & FRAME_FLAG_ACTIVE) flags |= THEME_FRAME_ACTIVE; + if (frame->flags & FRAME_FLAG_NO_SHADOW) + flags |= THEME_FRAME_NO_SHADOW; + cairo_save(cr); theme_render_frame(frame->theme, cr, frame->width, frame->height, frame->title, &frame->title_rect,