mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
io/router: don't trigger redraw for handler reset events
key.InputOp and pointer.InputOp handlers are reset on first registration
through a key.FocusEvent{false} or pointer.Cancel, respectively.
However, the mere act of registering a handle shouldn't result in a
redraw. This is particularly true for misconfigured handlers where a new
tag is supplied every frame, resulting in continously redrawing.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ func (q *keyQueue) Frame(root *op.Ops, events *handlerEvents) {
|
||||
}
|
||||
} else if h.new && k != focus {
|
||||
// Reset the handler on (each) first appearance, but don't trigger redraw.
|
||||
events.Add(k, key.FocusEvent{Focus: false})
|
||||
events.AddNoRedraw(k, key.FocusEvent{Focus: false})
|
||||
}
|
||||
}
|
||||
if changed && focus != nil {
|
||||
|
||||
Reference in New Issue
Block a user