app: use material.Decorations on undecorated platforms

This patch implements a mechanism for customizing window
decorations.
If a window is configured with app.Decorated(true), then
the widget/material.Decorations are applied. On Wayland,
the option is automatically set when the server does not
provide window decorations.

Server side decorations are no longer requested.
The Decorated flag is set according to the
server's requests.

Wayland is now the default driver for UNIX platforms.

References: https://todo.sr.ht/~eliasnaur/gio/318
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2022-01-23 21:54:14 +01:00
committed by Elias Naur
parent 90ad0010ec
commit 5ce1e98282
12 changed files with 246 additions and 16 deletions
+8
View File
@@ -1166,6 +1166,9 @@ func (w *window) Configure(options []Option) {
prev := w.config
cnf := w.config
cnf.apply(unit.Metric{}, options)
// Decorations are never disabled.
cnf.Decorated = true
if prev.Orientation != cnf.Orientation {
w.config.Orientation = cnf.Orientation
setOrientation(env, w.view, cnf.Orientation)
@@ -1188,12 +1191,17 @@ func (w *window) Configure(options []Option) {
w.config.Mode = Windowed
}
}
if cnf.Decorated != prev.Decorated {
w.config.Decorated = cnf.Decorated
}
if w.config != prev {
w.callbacks.Event(ConfigEvent{Config: w.config})
}
})
}
func (w *window) Perform(system.Action) {}
func (w *window) Raise() {}
func (w *window) SetCursor(name pointer.CursorName) {