diff options
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 53a92989..869560af 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -393,7 +393,6 @@ struct sway_seat *seat_create(struct sway_input_manager *input, | |||
393 | WL_SEAT_CAPABILITY_POINTER | | 393 | WL_SEAT_CAPABILITY_POINTER | |
394 | WL_SEAT_CAPABILITY_TOUCH); | 394 | WL_SEAT_CAPABILITY_TOUCH); |
395 | 395 | ||
396 | seat_configure_xcursor(seat); | ||
397 | 396 | ||
398 | wl_list_insert(&input->seats, &seat->link); | 397 | wl_list_insert(&input->seats, &seat->link); |
399 | 398 | ||
@@ -438,6 +437,7 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
438 | 437 | ||
439 | static void seat_configure_pointer(struct sway_seat *seat, | 438 | static void seat_configure_pointer(struct sway_seat *seat, |
440 | struct sway_seat_device *sway_device) { | 439 | struct sway_seat_device *sway_device) { |
440 | seat_configure_xcursor(seat); | ||
441 | wlr_cursor_attach_input_device(seat->cursor->cursor, | 441 | wlr_cursor_attach_input_device(seat->cursor->cursor, |
442 | sway_device->input_device->wlr_device); | 442 | sway_device->input_device->wlr_device); |
443 | seat_apply_input_config(seat, sway_device); | 443 | seat_apply_input_config(seat, sway_device); |
@@ -617,7 +617,7 @@ static int handle_urgent_timeout(void *data) { | |||
617 | } | 617 | } |
618 | 618 | ||
619 | void seat_set_focus_warp(struct sway_seat *seat, | 619 | void seat_set_focus_warp(struct sway_seat *seat, |
620 | struct sway_container *container, bool warp) { | 620 | struct sway_container *container, bool warp, bool notify) { |
621 | if (seat->focused_layer) { | 621 | if (seat->focused_layer) { |
622 | return; | 622 | return; |
623 | } | 623 | } |
@@ -737,9 +737,18 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
737 | } | 737 | } |
738 | } | 738 | } |
739 | 739 | ||
740 | // Close any popups on the old focus | ||
741 | if (last_focus && last_focus != container) { | ||
742 | if (last_focus->type == C_VIEW) { | ||
743 | view_close_popups(last_focus->sway_view); | ||
744 | } | ||
745 | } | ||
746 | |||
740 | if (last_focus) { | 747 | if (last_focus) { |
741 | if (last_workspace) { | 748 | if (last_workspace) { |
742 | ipc_event_workspace(last_workspace, container, "focus"); | 749 | if (notify && last_workspace != new_workspace) { |
750 | ipc_event_workspace(last_workspace, new_workspace, "focus"); | ||
751 | } | ||
743 | if (!workspace_is_visible(last_workspace) | 752 | if (!workspace_is_visible(last_workspace) |
744 | && workspace_is_empty(last_workspace)) { | 753 | && workspace_is_empty(last_workspace)) { |
745 | if (last_workspace == last_focus) { | 754 | if (last_workspace == last_focus) { |
@@ -766,6 +775,10 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
766 | } | 775 | } |
767 | } | 776 | } |
768 | 777 | ||
778 | if (container->type == C_VIEW) { | ||
779 | ipc_event_window(container, "focus"); | ||
780 | } | ||
781 | |||
769 | seat->has_focus = (container != NULL); | 782 | seat->has_focus = (container != NULL); |
770 | 783 | ||
771 | update_debug_tree(); | 784 | update_debug_tree(); |
@@ -773,7 +786,7 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
773 | 786 | ||
774 | void seat_set_focus(struct sway_seat *seat, | 787 | void seat_set_focus(struct sway_seat *seat, |
775 | struct sway_container *container) { | 788 | struct sway_container *container) { |
776 | seat_set_focus_warp(seat, container, true); | 789 | seat_set_focus_warp(seat, container, true, true); |
777 | } | 790 | } |
778 | 791 | ||
779 | void seat_set_focus_surface(struct sway_seat *seat, | 792 | void seat_set_focus_surface(struct sway_seat *seat, |