aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands/focus.c7
-rw-r--r--sway/tree/container.c2
-rw-r--r--sway/tree/view.c2
-rw-r--r--sway/tree/workspace.c3
4 files changed, 13 insertions, 1 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 668a0c7b..d63077e6 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -3,6 +3,7 @@
3#include "log.h" 3#include "log.h"
4#include "sway/commands.h" 4#include "sway/commands.h"
5#include "sway/input/input-manager.h" 5#include "sway/input/input-manager.h"
6#include "sway/input/cursor.h"
6#include "sway/input/seat.h" 7#include "sway/input/seat.h"
7#include "sway/output.h" 8#include "sway/output.h"
8#include "sway/tree/arrange.h" 9#include "sway/tree/arrange.h"
@@ -180,6 +181,7 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws,
180 } 181 }
181 if (new_focus) { 182 if (new_focus) {
182 seat_set_focus_container(seat, new_focus); 183 seat_set_focus_container(seat, new_focus);
184 cursor_send_pointer_motion(seat->cursor, 0, true);
183 } else { 185 } else {
184 return cmd_results_new(CMD_FAILURE, "focus", 186 return cmd_results_new(CMD_FAILURE, "focus",
185 "Failed to find a %s container in workspace", 187 "Failed to find a %s container in workspace",
@@ -212,6 +214,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
212 free(identifier); 214 free(identifier);
213 if (output) { 215 if (output) {
214 seat_set_focus(seat, seat_get_focus_inactive(seat, &output->node)); 216 seat_set_focus(seat, seat_get_focus_inactive(seat, &output->node));
217 cursor_send_pointer_motion(seat->cursor, 0, true);
215 } 218 }
216 219
217 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 220 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -232,6 +235,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
232 235
233 if (argc == 0 && container) { 236 if (argc == 0 && container) {
234 seat_set_focus_container(seat, container); 237 seat_set_focus_container(seat, container);
238 cursor_send_pointer_motion(seat->cursor, 0, true);
235 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 239 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
236 } 240 }
237 241
@@ -260,6 +264,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
260 struct sway_node *focus = seat_get_active_child(seat, node); 264 struct sway_node *focus = seat_get_active_child(seat, node);
261 if (focus) { 265 if (focus) {
262 seat_set_focus(seat, focus); 266 seat_set_focus(seat, focus);
267 cursor_send_pointer_motion(seat->cursor, 0, true);
263 } 268 }
264 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 269 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
265 } 270 }
@@ -279,6 +284,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
279 struct sway_node *node = 284 struct sway_node *node =
280 get_node_in_output_direction(new_output, direction); 285 get_node_in_output_direction(new_output, direction);
281 seat_set_focus(seat, node); 286 seat_set_focus(seat, node);
287 cursor_send_pointer_motion(seat->cursor, 0, true);
282 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 288 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
283 } 289 }
284 290
@@ -286,6 +292,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
286 node_get_in_direction(container, seat, direction); 292 node_get_in_direction(container, seat, direction);
287 if (next_focus) { 293 if (next_focus) {
288 seat_set_focus(seat, next_focus); 294 seat_set_focus(seat, next_focus);
295 cursor_send_pointer_motion(seat->cursor, 0, true);
289 } 296 }
290 297
291 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 298 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ccd79f0e..ebc60027 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -218,7 +218,7 @@ static struct sway_container *container_at_tabbed(struct sway_node *parent,
218 218
219 // Surfaces 219 // Surfaces
220 struct sway_node *current = seat_get_active_child(seat, parent); 220 struct sway_node *current = seat_get_active_child(seat, parent);
221 return tiling_container_at(current, lx, ly, surface, sx, sy); 221 return current ? tiling_container_at(current, lx, ly, surface, sx, sy) : NULL;
222} 222}
223 223
224/** 224/**
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 53215b40..10c48e2e 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -14,6 +14,7 @@
14#include "sway/criteria.h" 14#include "sway/criteria.h"
15#include "sway/commands.h" 15#include "sway/commands.h"
16#include "sway/desktop/transaction.h" 16#include "sway/desktop/transaction.h"
17#include "sway/input/cursor.h"
17#include "sway/ipc-server.h" 18#include "sway/ipc-server.h"
18#include "sway/output.h" 19#include "sway/output.h"
19#include "sway/input/seat.h" 20#include "sway/input/seat.h"
@@ -583,6 +584,7 @@ void view_unmap(struct sway_view *view) {
583 } 584 }
584 585
585 transaction_commit_dirty(); 586 transaction_commit_dirty();
587 cursor_send_pointer_motion(config->handler_context.seat->cursor, 0, true);
586 view->surface = NULL; 588 view->surface = NULL;
587} 589}
588 590
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 378bfc5d..b8e90892 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -7,6 +7,7 @@
7#include <strings.h> 7#include <strings.h>
8#include "stringop.h" 8#include "stringop.h"
9#include "sway/input/input-manager.h" 9#include "sway/input/input-manager.h"
10#include "sway/input/cursor.h"
10#include "sway/input/seat.h" 11#include "sway/input/seat.h"
11#include "sway/ipc-server.h" 12#include "sway/ipc-server.h"
12#include "sway/output.h" 13#include "sway/output.h"
@@ -400,6 +401,7 @@ bool workspace_switch(struct sway_workspace *workspace,
400 if (&floater->node == focus) { 401 if (&floater->node == focus) {
401 seat_set_focus(seat, NULL); 402 seat_set_focus(seat, NULL);
402 seat_set_focus_container(seat, floater); 403 seat_set_focus_container(seat, floater);
404 cursor_send_pointer_motion(seat->cursor, 0, true);
403 } 405 }
404 --i; 406 --i;
405 } 407 }
@@ -422,6 +424,7 @@ bool workspace_switch(struct sway_workspace *workspace,
422 } 424 }
423 seat_set_focus(seat, next); 425 seat_set_focus(seat, next);
424 arrange_workspace(workspace); 426 arrange_workspace(workspace);
427 cursor_send_pointer_motion(seat->cursor, 0, true);
425 return true; 428 return true;
426} 429}
427 430