mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
separate seat get focus and seat get focus inactive
This commit is contained in:
parent
7d8f2c52aa
commit
a7d49da239
7 changed files with 30 additions and 24 deletions
|
|
@ -63,8 +63,8 @@ static bool _workspace_by_name(swayc_t *view, void *data) {
|
|||
swayc_t *workspace_by_name(const char *name) {
|
||||
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||
swayc_t *current_workspace = NULL, *current_output = NULL;
|
||||
if (seat->has_focus) {
|
||||
swayc_t *focus = sway_seat_get_focus(seat, &root_container);
|
||||
swayc_t *focus = sway_seat_get_focus(seat);
|
||||
if (focus) {
|
||||
current_workspace = swayc_parent_by_type(focus, C_WORKSPACE);
|
||||
current_output = swayc_parent_by_type(focus, C_OUTPUT);
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ swayc_t *workspace_create(const char *name) {
|
|||
}
|
||||
// Otherwise create a new one
|
||||
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||
swayc_t *focus = sway_seat_get_focus(seat, &root_container);
|
||||
swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
|
||||
parent = focus;
|
||||
parent = swayc_parent_by_type(parent, C_OUTPUT);
|
||||
return new_workspace(parent, name);
|
||||
|
|
@ -195,7 +195,7 @@ bool workspace_switch(swayc_t *workspace) {
|
|||
return false;
|
||||
}
|
||||
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||
swayc_t *focus = sway_seat_get_focus(seat, &root_container);
|
||||
swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
|
||||
if (!seat || !focus) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue