aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-25 23:30:09 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-25 23:37:40 +1000
commit60a1d79de71660949f7a6fc83e242d9d95c75187 (patch)
tree821502ef188985ee023df3f24b9e4e468eb96aef /sway/desktop/xwayland.c
parentMerge pull request #2950 from emersion/presentation-time (diff)
downloadsway-60a1d79de71660949f7a6fc83e242d9d95c75187.tar.gz
sway-60a1d79de71660949f7a6fc83e242d9d95c75187.tar.zst
sway-60a1d79de71660949f7a6fc83e242d9d95c75187.zip
Rebase the cursor after applying transactions
This approaches cursor rebasing from a different angle. Rather than littering the codebase with cursor_rebase calls and using transaction callbacks, this just runs cursor_rebase after applying every transaction - but only if there's outputs connected, because otherwise it causes a crash during shutdown. There is one known case where we still need to call cursor_rebase directly, and that's when running `seat seat0 cursor move ...`. This command doesn't set anything as dirty so no transaction occurs.
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 95275937..0c41d960 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -391,11 +391,6 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
391 wl_list_remove(&xwayland_view->commit.link); 391 wl_list_remove(&xwayland_view->commit.link);
392} 392}
393 393
394static void do_rebase(void *data) {
395 struct sway_cursor *cursor = data;
396 cursor_rebase(cursor);
397}
398
399static void handle_map(struct wl_listener *listener, void *data) { 394static void handle_map(struct wl_listener *listener, void *data) {
400 struct sway_xwayland_view *xwayland_view = 395 struct sway_xwayland_view *xwayland_view =
401 wl_container_of(listener, xwayland_view, map); 396 wl_container_of(listener, xwayland_view, map);
@@ -422,8 +417,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
422 // Put it back into the tree 417 // Put it back into the tree
423 view_map(view, xsurface->surface, xsurface->fullscreen, false); 418 view_map(view, xsurface->surface, xsurface->fullscreen, false);
424 419
425 struct sway_seat *seat = input_manager_current_seat(); 420 transaction_commit_dirty();
426 transaction_commit_dirty_with_callback(do_rebase, seat->cursor);
427} 421}
428 422
429static void handle_request_configure(struct wl_listener *listener, void *data) { 423static void handle_request_configure(struct wl_listener *listener, void *data) {