f07537335a5e282391b168ae565336f291db8379 — Elias Naur 2 years ago bd7f504
app: clip client area

On Wayland, app.Window provides fallback window decorations but clients
are not prohibited from drawing over the decorations or capturing events.
This change adds a clip operation to ensure no unwanted interaction between
client content and decorations.

Fixes issue described in


Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 3 insertions(+), 0 deletions(-)

M app/window.go
M app/window.go => app/window.go +3 -0
@@ 25,6 25,7 @@ import (

@@ 799,7 800,9 @@ func (w *Window) processEvent(d driver, e event.Event) {
		e2.FrameEvent.Size = w.decorate(d, e2.FrameEvent, wrapper)
		w.out <- e2.FrameEvent
		frame, gotFrame := w.waitFrame(d)
		cl := clip.Rect(image.Rectangle{Max: e2.FrameEvent.Size}).Push(wrapper)
		ops.AddCall(&wrapper.Internal, &frame.Internal, ops.PC{}, ops.PCFor(&frame.Internal))
		err := w.validateAndProcess(d, size, e2.Sync, wrapper)
		if gotFrame {
			// We're done with frame, let the client continue.