forked from joejulian/gio
widget: [API] change Decorations to leave the user in control of window state
As suggested by ~egonelbre, Decorations should not be the source of truth for the windows state, because external gestures may also change state. This breaking change removes Decorations.Perform and exposes Maximized as a bool which is the user's responsibility to set. Fixes: https://todo.sr.ht/~eliasnaur/gio/600 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -656,6 +656,7 @@ func (w *Window) processEvent(e event.Event) bool {
|
||||
}
|
||||
w.coalesced.view = &e2
|
||||
case ConfigEvent:
|
||||
w.decorations.Decorations.Maximized = e2.Config.Mode == Maximized
|
||||
wasFocused := w.decorations.Config.Focused
|
||||
w.decorations.Config = e2.Config
|
||||
e2.Config = w.effectiveConfig()
|
||||
@@ -801,7 +802,6 @@ func (w *Window) decorate(e FrameEvent, o *op.Ops) image.Point {
|
||||
default:
|
||||
panic(fmt.Errorf("unknown WindowMode %v", m))
|
||||
}
|
||||
deco.Perform(actions)
|
||||
gtx := layout.Context{
|
||||
Ops: o,
|
||||
Now: e.Now,
|
||||
|
||||
Reference in New Issue
Block a user