summaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <RyanDwyer@users.noreply.github.com>2018-08-02 08:17:25 +1000
committerLibravatar GitHub <noreply@github.com>2018-08-02 08:17:25 +1000
commit4cc0855f21a2704314aa7b8973ceae7a8b463a1a (patch)
tree92d5b04c01c2da2bce20819ade8ed834bf2e420c /sway/input/seat.c
parentMerge pull request #2397 from chr0me-sh/hide-cursor-if-no-pointer (diff)
parentipc: remove extraneous values (diff)
downloadsway-4cc0855f21a2704314aa7b8973ceae7a8b463a1a.tar.gz
sway-4cc0855f21a2704314aa7b8973ceae7a8b463a1a.tar.zst
sway-4cc0855f21a2704314aa7b8973ceae7a8b463a1a.zip
Merge pull request #2264 from ianyfan/ipc
IPC Events (1.0)
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index a4a449e4..fe3cbc53 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -617,7 +617,7 @@ static int handle_urgent_timeout(void *data) {
617} 617}
618 618
619void seat_set_focus_warp(struct sway_seat *seat, 619void 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 }
@@ -739,7 +739,9 @@ void seat_set_focus_warp(struct sway_seat *seat,
739 739
740 if (last_focus) { 740 if (last_focus) {
741 if (last_workspace) { 741 if (last_workspace) {
742 ipc_event_workspace(last_workspace, container, "focus"); 742 if (notify && last_workspace != new_workspace) {
743 ipc_event_workspace(last_workspace, new_workspace, "focus");
744 }
743 if (!workspace_is_visible(last_workspace) 745 if (!workspace_is_visible(last_workspace)
744 && workspace_is_empty(last_workspace)) { 746 && workspace_is_empty(last_workspace)) {
745 if (last_workspace == last_focus) { 747 if (last_workspace == last_focus) {
@@ -766,6 +768,10 @@ void seat_set_focus_warp(struct sway_seat *seat,
766 } 768 }
767 } 769 }
768 770
771 if (container->type == C_VIEW) {
772 ipc_event_window(container, "focus");
773 }
774
769 seat->has_focus = (container != NULL); 775 seat->has_focus = (container != NULL);
770 776
771 update_debug_tree(); 777 update_debug_tree();
@@ -773,7 +779,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
773 779
774void seat_set_focus(struct sway_seat *seat, 780void seat_set_focus(struct sway_seat *seat,
775 struct sway_container *container) { 781 struct sway_container *container) {
776 seat_set_focus_warp(seat, container, true); 782 seat_set_focus_warp(seat, container, true, true);
777} 783}
778 784
779void seat_set_focus_surface(struct sway_seat *seat, 785void seat_set_focus_surface(struct sway_seat *seat,