xdg-activation: fix race with transaction system

This code could allows the view to be focused and urgent at the
same time if the request to activate the view is received just after
the pending focus has been set but before the transaction completes.
This commit is contained in:
Isaac Freund
2024-01-03 16:31:30 -06:00
parent 28dcd8320a
commit ebb6d1bdd1

View File

@ -289,7 +289,7 @@ fn handleRequestActivate(
const node_data = SceneNodeData.fromSurface(event.surface) orelse return; const node_data = SceneNodeData.fromSurface(event.surface) orelse return;
switch (node_data.data) { switch (node_data.data) {
.view => |view| if (view.current.focus == 0) { .view => |view| if (view.pending.focus == 0) {
view.pending.urgent = true; view.pending.urgent = true;
server.root.applyPending(); server.root.applyPending();
}, },