aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/desktop
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-24 19:38:52 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-24 19:38:52 +1000
commitbdae625cb344209424841a7c5f0c0967773c8c10 (patch)
tree754adb52ec2e2eb9d336d1c826bab62ea96e6c52 /include/sway/desktop
parentMerge pull request #2933 from Snaipe/xwayland-window-properties (diff)
downloadsway-bdae625cb344209424841a7c5f0c0967773c8c10.tar.gz
sway-bdae625cb344209424841a7c5f0c0967773c8c10.tar.zst
sway-bdae625cb344209424841a7c5f0c0967773c8c10.zip
Rebase the cursor after mapping a view
I originally put the rebase at the end of view_map, but at this point the view is still at its native size and will ignore the motion event if it falls outside of its native size. The only way to do this properly is to rebase the cursor later - either after sending the configure, after the view commits with the new size, or after applying the transaction. I chose to do it after applying the transaction for simplicity. I then attempted to just call cursor_rebase after applying every transaction, but this causes crashes when exiting sway (and possibly other places) because cursor_rebase assumes the tree is in a valid state. So my chosen solution introduces transaction_commit_dirty_with_callback which allows handle_map to register a callback which will run when the transaction is applied.
Diffstat (limited to 'include/sway/desktop')
-rw-r--r--include/sway/desktop/transaction.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h
index 66e8c9a2..f38f033c 100644
--- a/include/sway/desktop/transaction.h
+++ b/include/sway/desktop/transaction.h
@@ -29,6 +29,13 @@ struct sway_view;
29void transaction_commit_dirty(void); 29void transaction_commit_dirty(void);
30 30
31/** 31/**
32 * Same as above, but runs the specific callback when the transaction is
33 * applied.
34 */
35void transaction_commit_dirty_with_callback(
36 void (*callback)(void *data), void *data);
37
38/**
32 * Notify the transaction system that a view is ready for the new layout. 39 * Notify the transaction system that a view is ready for the new layout.
33 * 40 *
34 * When all views in the transaction are ready, the layout will be applied. 41 * When all views in the transaction are ready, the layout will be applied.