mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
app: call driver Perform and Configure after idling
Before this change, Perform and Configure could be called during the event processing where additional events would be queued. However, a Maximize animation on macOS works by repeatedly sending draw requests, and they must not be postponed. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+19
-19
@@ -450,9 +450,6 @@ func (c *callbacks) Event(e event.Event) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
c.busy = true
|
c.busy = true
|
||||||
defer func() {
|
|
||||||
c.busy = false
|
|
||||||
}()
|
|
||||||
var handled bool
|
var handled bool
|
||||||
for len(c.waitEvents) > 0 {
|
for len(c.waitEvents) > 0 {
|
||||||
e := c.waitEvents[0]
|
e := c.waitEvents[0]
|
||||||
@@ -460,10 +457,29 @@ func (c *callbacks) Event(e event.Event) bool {
|
|||||||
c.waitEvents = c.waitEvents[:len(c.waitEvents)-1]
|
c.waitEvents = c.waitEvents[:len(c.waitEvents)-1]
|
||||||
handled = c.w.processEvent(c.d, e)
|
handled = c.w.processEvent(c.d, e)
|
||||||
}
|
}
|
||||||
|
c.busy = false
|
||||||
select {
|
select {
|
||||||
case <-c.w.dead:
|
case <-c.w.dead:
|
||||||
|
return handled
|
||||||
default:
|
default:
|
||||||
|
}
|
||||||
c.w.updateState(c.d)
|
c.w.updateState(c.d)
|
||||||
|
if _, ok := e.(wakeupEvent); ok {
|
||||||
|
select {
|
||||||
|
case opts := <-c.w.options:
|
||||||
|
cnf := Config{Decorated: c.w.decorations.enabled}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(c.w.metric, &cnf)
|
||||||
|
}
|
||||||
|
c.w.decorations.enabled = cnf.Decorated
|
||||||
|
c.d.Configure(opts)
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
select {
|
||||||
|
case acts := <-c.w.actions:
|
||||||
|
c.d.Perform(acts)
|
||||||
|
default:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return handled
|
return handled
|
||||||
}
|
}
|
||||||
@@ -858,22 +874,6 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
|
|||||||
case ViewEvent:
|
case ViewEvent:
|
||||||
w.out <- e2
|
w.out <- e2
|
||||||
w.waitAck(d)
|
w.waitAck(d)
|
||||||
case wakeupEvent:
|
|
||||||
select {
|
|
||||||
case opts := <-w.options:
|
|
||||||
cnf := Config{Decorated: w.decorations.enabled}
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(w.metric, &cnf)
|
|
||||||
}
|
|
||||||
w.decorations.enabled = cnf.Decorated
|
|
||||||
d.Configure(opts)
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
select {
|
|
||||||
case acts := <-w.actions:
|
|
||||||
d.Perform(acts)
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
case ConfigEvent:
|
case ConfigEvent:
|
||||||
w.decorations.Config = e2.Config
|
w.decorations.Config = e2.Config
|
||||||
if !w.fallbackDecorate() {
|
if !w.fallbackDecorate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user