mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
app: really do deliver top-level key events
This is a fixup of 0dba85f52e.
See discussion at
https://lists.sr.ht/~eliasnaur/gio-patches/%3C20230201160926.240528-1-alessandro.arzilli%40gmail.com%3E#%3C20230404144001.n2pndo5r5aqk46gq@x1%3E
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+9
-8
@@ -604,8 +604,6 @@ func (w *Window) moveFocus(dir router.FocusDirection, d driver) {
|
|||||||
dist := v.Mul(int(w.metric.Dp(scrollABit)))
|
dist := v.Mul(int(w.metric.Dp(scrollABit)))
|
||||||
w.queue.q.ScrollFocus(dist)
|
w.queue.q.ScrollFocus(dist)
|
||||||
}
|
}
|
||||||
w.setNextFrame(time.Time{})
|
|
||||||
w.updateAnimation(d)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *callbacks) ClickFocus() {
|
func (c *callbacks) ClickFocus() {
|
||||||
@@ -914,10 +912,8 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
|
|||||||
w.out <- e2
|
w.out <- e2
|
||||||
case event.Event:
|
case event.Event:
|
||||||
handled := w.queue.q.Queue(e2)
|
handled := w.queue.q.Queue(e2)
|
||||||
if handled {
|
if e, ok := e.(key.Event); ok && !handled {
|
||||||
w.setNextFrame(time.Time{})
|
if e.State == key.Press {
|
||||||
w.updateAnimation(d)
|
|
||||||
} else if e, ok := e.(key.Event); ok && e.State == key.Press {
|
|
||||||
handled = true
|
handled = true
|
||||||
isMobile := runtime.GOOS == "ios" || runtime.GOOS == "android"
|
isMobile := runtime.GOOS == "ios" || runtime.GOOS == "android"
|
||||||
switch {
|
switch {
|
||||||
@@ -937,12 +933,17 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
|
|||||||
handled = false
|
handled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// As a sepcial case, the top-most input handler receives all unhandled
|
// As a special case, the top-most input handler receives all unhandled
|
||||||
// events.
|
// events.
|
||||||
if e, ok := e.(key.Event); ok && !handled {
|
if !handled {
|
||||||
handled = w.queue.q.QueueTopmost(e)
|
handled = w.queue.q.QueueTopmost(e)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
w.updateCursor(d)
|
w.updateCursor(d)
|
||||||
|
if handled {
|
||||||
|
w.setNextFrame(time.Time{})
|
||||||
|
w.updateAnimation(d)
|
||||||
|
}
|
||||||
return handled
|
return handled
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user