mirror of
https://github.com/swaywm/sway.git
synced 2026-04-28 06:46:26 -04:00
fix focus after workspace switch when focus_follows_mouse is always
This commit is contained in:
parent
02f5a6f867
commit
bb9873ccd8
1 changed files with 9 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include "sway/output.h"
|
||||
#include "sway/tree/arrange.h"
|
||||
#include "sway/tree/container.h"
|
||||
#include "sway/tree/node.h"
|
||||
#include "sway/tree/root.h"
|
||||
#include "sway/tree/view.h"
|
||||
#include "sway/tree/workspace.h"
|
||||
|
|
@ -778,6 +779,14 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
|
|||
node_set_dirty(&new_output->node);
|
||||
}
|
||||
|
||||
// replace node to focus with node under cursor
|
||||
if (config->focus_follows_mouse == FOLLOWS_ALWAYS) {
|
||||
struct wlr_surface *surface = NULL;
|
||||
double sx, sy;
|
||||
node = node_at_cursor(seat, new_workspace, seat->cursor, &surface, &sx, &sy);
|
||||
container = node->type == N_CONTAINER ? node->sway_container : NULL;
|
||||
}
|
||||
|
||||
// find new output's old workspace, which might have to be removed if empty
|
||||
struct sway_workspace *new_output_last_ws =
|
||||
new_output ? output_get_active_workspace(new_output) : NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue