mirror of
https://github.com/swaywm/sway.git
synced 2026-04-03 07:15:39 -04:00
ipc: prevent emitting a workspace::focus event when moving a container to a different workspace or output
When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
This commit is contained in:
parent
b2ac234569
commit
03eaf444a4
5 changed files with 11 additions and 11 deletions
|
|
@ -617,7 +617,7 @@ static int handle_urgent_timeout(void *data) {
|
|||
}
|
||||
|
||||
void seat_set_focus_warp(struct sway_seat *seat,
|
||||
struct sway_container *container, bool warp) {
|
||||
struct sway_container *container, bool warp, bool notify) {
|
||||
if (seat->focused_layer) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -739,7 +739,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
|
|||
|
||||
if (last_focus) {
|
||||
if (last_workspace) {
|
||||
if (last_workspace != new_workspace) {
|
||||
if (notify && last_workspace != new_workspace) {
|
||||
ipc_event_workspace(last_workspace, new_workspace, "focus");
|
||||
}
|
||||
if (!workspace_is_visible(last_workspace)
|
||||
|
|
@ -779,7 +779,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
|
|||
|
||||
void seat_set_focus(struct sway_seat *seat,
|
||||
struct sway_container *container) {
|
||||
seat_set_focus_warp(seat, container, true);
|
||||
seat_set_focus_warp(seat, container, true, true);
|
||||
}
|
||||
|
||||
void seat_set_focus_surface(struct sway_seat *seat,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue