mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
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:
@@ -43,6 +43,8 @@ type Config struct {
|
||||
CustomRenderer bool
|
||||
// center is a flag used to center the window. Set by option.
|
||||
center bool
|
||||
// Decorated reports whether window decorations are provided automatically.
|
||||
Decorated bool
|
||||
}
|
||||
|
||||
// ConfigEvent is sent whenever the configuration of a Window changes.
|
||||
@@ -177,6 +179,9 @@ type driver interface {
|
||||
|
||||
// Wakeup wakes up the event loop and sends a WakeupEvent.
|
||||
Wakeup()
|
||||
|
||||
// Perform actions on the window.
|
||||
Perform(system.Action)
|
||||
}
|
||||
|
||||
type windowRendezvous struct {
|
||||
@@ -218,3 +223,12 @@ func newWindowRendezvous() *windowRendezvous {
|
||||
|
||||
func (wakeupEvent) ImplementsEvent() {}
|
||||
func (ConfigEvent) ImplementsEvent() {}
|
||||
|
||||
func walkActions(actions system.Action, do func(system.Action)) {
|
||||
for a := system.Action(1); actions != 0; a <<= 1 {
|
||||
if actions&a != 0 {
|
||||
actions &^= a
|
||||
do(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user