diff options
author | 2018-04-21 14:44:11 +0200 | |
---|---|---|
committer | 2018-04-21 14:44:11 +0200 | |
commit | 7d43cedc95a76cc4d466f76f0023383abd6ddab0 (patch) | |
tree | 9fae75ffb8943c72eabb2f17ea96b4ac6826c6bb /sway | |
parent | Merge pull request #1830 from bpinto/swaylock/install-pam-module (diff) | |
parent | Update cursor when workspace focus changes (diff) | |
download | sway-7d43cedc95a76cc4d466f76f0023383abd6ddab0.tar.gz sway-7d43cedc95a76cc4d466f76f0023383abd6ddab0.tar.zst sway-7d43cedc95a76cc4d466f76f0023383abd6ddab0.zip |
Merge pull request #1836 from emersion/workspace-focus-update-cursor
Update cursor when workspace focus changes
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/cursor.c | 5 | ||||
-rw-r--r-- | sway/input/seat.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index a19f0752..5ed4f1f7 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -59,9 +59,8 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor, | |||
59 | // find the output the cursor is on | 59 | // find the output the cursor is on |
60 | struct wlr_output_layout *output_layout = | 60 | struct wlr_output_layout *output_layout = |
61 | root_container.sway_root->output_layout; | 61 | root_container.sway_root->output_layout; |
62 | struct wlr_output *wlr_output = | 62 | struct wlr_output *wlr_output = wlr_output_layout_output_at(output_layout, |
63 | wlr_output_layout_output_at(output_layout, | 63 | cursor->cursor->x, cursor->cursor->y); |
64 | cursor->cursor->x, cursor->cursor->y); | ||
65 | if (wlr_output == NULL) { | 64 | if (wlr_output == NULL) { |
66 | return NULL; | 65 | return NULL; |
67 | } | 66 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 8bba7d8f..631a273f 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -564,6 +564,12 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
564 | view_set_activated(view, false); | 564 | view_set_activated(view, false); |
565 | } | 565 | } |
566 | 566 | ||
567 | if (last_workspace && last_workspace != new_workspace) { | ||
568 | struct timespec now; | ||
569 | clock_gettime(CLOCK_MONOTONIC, &now); | ||
570 | cursor_send_pointer_motion(seat->cursor, now.tv_nsec / 1000); | ||
571 | } | ||
572 | |||
567 | seat->has_focus = (container != NULL); | 573 | seat->has_focus = (container != NULL); |
568 | 574 | ||
569 | update_debug_tree(); | 575 | update_debug_tree(); |