mirror of
https://github.com/swaywm/sway.git
synced 2024-11-18 14:09:14 +00:00
Merge pull request #1836 from emersion/workspace-focus-update-cursor
Update cursor when workspace focus changes
This commit is contained in:
commit
7d43cedc95
|
@ -59,8 +59,7 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor,
|
||||||
// find the output the cursor is on
|
// find the output the cursor is on
|
||||||
struct wlr_output_layout *output_layout =
|
struct wlr_output_layout *output_layout =
|
||||||
root_container.sway_root->output_layout;
|
root_container.sway_root->output_layout;
|
||||||
struct wlr_output *wlr_output =
|
struct wlr_output *wlr_output = wlr_output_layout_output_at(output_layout,
|
||||||
wlr_output_layout_output_at(output_layout,
|
|
||||||
cursor->cursor->x, cursor->cursor->y);
|
cursor->cursor->x, cursor->cursor->y);
|
||||||
if (wlr_output == NULL) {
|
if (wlr_output == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -564,6 +564,12 @@ void seat_set_focus_warp(struct sway_seat *seat,
|
||||||
view_set_activated(view, false);
|
view_set_activated(view, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (last_workspace && last_workspace != new_workspace) {
|
||||||
|
struct timespec now;
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
cursor_send_pointer_motion(seat->cursor, now.tv_nsec / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
seat->has_focus = (container != NULL);
|
seat->has_focus = (container != NULL);
|
||||||
|
|
||||||
update_debug_tree();
|
update_debug_tree();
|
||||||
|
|
Loading…
Reference in a new issue