diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2017-03-11 02:29:37 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2017-03-14 19:41:48 -0700 |
commit | 2373a54d2d52961a841dace71b505d2c20f5c040 (patch) | |
tree | de534cf0e4f7f1e917faf2b8fc07eb80a1749f96 /src/composite.c | |
parent | b99f0728ec7229423cfc65d25711208f6cac1c0e (diff) |
overlays: extricate overlays from vwm internals
- Move vmon_proc_t under vwm_overlay_t.
- Privatize vwm_overlay_t.
- Update xwindow.c to dynamically create and destroy overlays.
- Cease supplying vwm_t to vwm_overlays_create(), now just
pass in the bare vwm_xserver_t.
- Update all vwm_overlay_* functions to operate on vwm_overlays_t and
vwm_overlay_t. Only vwm_overlays_create() receives the xserver,
which it then embeds within the returned vwm_overlay_t.
- Eliminate _xwin_ flavors of overlay functions, largely mechanical
rename eliminating the _xwin_ from the names during the previous
pass of switching from vwm_t & vwm_xwindow_t to vwm_overlays_t &
vwm_overlay_t parameters.
- Change vwm_overlay_compose() to store damage in supplied pointer,
the caller is expected to make use of the damage information now
because the overlay code doesn't know about the window its coordinate
space.
Diffstat (limited to 'src/composite.c')
-rw-r--r-- | src/composite.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/composite.c b/src/composite.c index bdb2b64..3f55863 100644 --- a/src/composite.c +++ b/src/composite.c @@ -79,6 +79,7 @@ void vwm_composite_damage_add(vwm_t *vwm, XserverRegion damage) { if (combined_damage != None) { XFixesUnionRegion(VWM_XDISPLAY(vwm), combined_damage, combined_damage, damage); + /* TODO FIXME: make destroy optional, change callers to reuse a persistent region where practical */ XFixesDestroyRegion(VWM_XDISPLAY(vwm), damage); } else { combined_damage = damage; @@ -224,7 +225,18 @@ void vwm_composite_paint_all(vwm_t *vwm) r.height = xwin->attrs.height + xwin->attrs.border_width * 2; if (XRectInRegion(occluded, r.x, r.y, r.width, r.height) != RectangleIn) { /* the window isn't fully occluded, compose it and add it to occluded */ - if (xwin->monitor && !xwin->attrs.override_redirect) vwm_overlay_xwin_compose(vwm, xwin); + if (xwin->overlay) { + XserverRegion overlay_damage = None; + + vwm_overlay_compose(vwm->overlays, xwin->overlay, &overlay_damage); + if (overlay_damage != None) { + /* the damage region is in overlay coordinate space, translation necessary. */ + XFixesTranslateRegion(VWM_XDISPLAY(vwm), overlay_damage, + xwin->attrs.x + xwin->attrs.border_width, + xwin->attrs.y + xwin->attrs.border_width); + vwm_composite_damage_add(vwm, overlay_damage); + } + } XUnionRectWithRegion(&r, occluded, occluded); xwin->occluded = 0; } else { @@ -256,13 +268,13 @@ void vwm_composite_paint_all(vwm_t *vwm) r.x, r.y, /* dst x, y */ r.width, r.height); - if (xwin->monitor && !xwin->attrs.override_redirect && xwin->overlay.width) { + if (xwin->overlay) { /* draw the monitoring overlay atop the window, note we stay within the window borders here. */ - XRenderComposite(VWM_XDISPLAY(vwm), PictOpOver, xwin->overlay.picture, None, root_buffer, - 0, 0, 0, 0, /* src x,y, maxk x, y */ - xwin->attrs.x + xwin->attrs.border_width, /* dst x */ - xwin->attrs.y + xwin->attrs.border_width, /* dst y */ - xwin->attrs.width, vwm_overlay_xwin_composed_height(vwm, xwin)); /* w, h */ + vwm_overlay_render(vwm->overlays, xwin->overlay, root_buffer, + xwin->attrs.x + xwin->attrs.border_width, + xwin->attrs.y + xwin->attrs.border_width, + xwin->attrs.width, + xwin->attrs.height); } /* subtract the region of the window from the combined damage and update the root_buffer clip region to reflect the remaining damage */ |