forked from joejulian/gio
op: change Defer to only restore transformation state
It turns out restoring all operation state from the moment Defer is executed is too much; for example, a right-click pop-up needs the transformation, but not the current clip. Change Defer to only restore the transformation, and reset all other state. Other combinations may be needed in future; we'll deal with them then, possibly by exposing the load state mask. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-2
@@ -140,7 +140,7 @@ func (q *keyQueue) resolveFocus(events *handlerEvents) resolveState {
|
||||
q.states[id] = state
|
||||
state = resolveState{}
|
||||
case opconst.TypeLoad:
|
||||
id := ops.DecodeLoad(encOp.Data)
|
||||
id, mask := ops.DecodeLoad(encOp.Data)
|
||||
restored := q.states[id]
|
||||
if state.keyboard > restored.keyboard {
|
||||
restored.keyboard = state.keyboard
|
||||
@@ -148,7 +148,9 @@ func (q *keyQueue) resolveFocus(events *handlerEvents) resolveState {
|
||||
if state.pri.replaces(restored.pri) {
|
||||
restored.tag, restored.pri = state.tag, state.pri
|
||||
}
|
||||
state = restored
|
||||
if mask != 0 {
|
||||
state = restored
|
||||
}
|
||||
}
|
||||
}
|
||||
return state
|
||||
|
||||
Reference in New Issue
Block a user