aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-10 21:00:39 -0400
committerGitHub <noreply@github.com>2018-09-10 21:00:39 -0400
commit822b45f4836c9a22af5a283e2aea6e4ecd514c22 (patch)
tree8cf1710d23edfe1da01da72338197b348288922d /sway/tree
parent024b9d85ea4cd51d803317c64e46dac659c9f7ec (diff)
parent097ed036477b775624593ac95fdaef12c36ff306 (diff)
Merge pull request #2617 from wmww/cursor-enter-on-focus-change
Give windows pointer focus immediately
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c4
-rw-r--r--sway/tree/view.c3
-rw-r--r--sway/tree/workspace.c3
3 files changed, 8 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ccd79f0e..0a69f8d5 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,
// Surfaces
struct sway_node *current = seat_get_active_child(seat, parent);
- return tiling_container_at(current, lx, ly, surface, sx, sy);
+ return current ? tiling_container_at(current, lx, ly, surface, sx, sy) : NULL;
}
/**
@@ -246,7 +246,7 @@ static struct sway_container *container_at_stacked(struct sway_node *parent,
// Surfaces
struct sway_node *current = seat_get_active_child(seat, parent);
- return tiling_container_at(current, lx, ly, surface, sx, sy);
+ return current ? tiling_container_at(current, lx, ly, surface, sx, sy) : NULL;
}
/**
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 53215b40..65ac8b32 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -14,6 +14,7 @@
#include "sway/criteria.h"
#include "sway/commands.h"
#include "sway/desktop/transaction.h"
+#include "sway/input/cursor.h"
#include "sway/ipc-server.h"
#include "sway/output.h"
#include "sway/input/seat.h"
@@ -582,6 +583,8 @@ void view_unmap(struct sway_view *view) {
workspace_detect_urgent(ws);
}
+ cursor_send_pointer_motion(config->handler_context.seat->cursor, 0, true);
+
transaction_commit_dirty();
view->surface = NULL;
}
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 @@
#include <strings.h>
#include "stringop.h"
#include "sway/input/input-manager.h"
+#include "sway/input/cursor.h"
#include "sway/input/seat.h"
#include "sway/ipc-server.h"
#include "sway/output.h"
@@ -400,6 +401,7 @@ bool workspace_switch(struct sway_workspace *workspace,
if (&floater->node == focus) {
seat_set_focus(seat, NULL);
seat_set_focus_container(seat, floater);
+ cursor_send_pointer_motion(seat->cursor, 0, true);
}
--i;
}
@@ -422,6 +424,7 @@ bool workspace_switch(struct sway_workspace *workspace,
}
seat_set_focus(seat, next);
arrange_workspace(workspace);
+ cursor_send_pointer_motion(seat->cursor, 0, true);
return true;
}