mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 19:31:29 +00:00
Merge pull request #214 from taiyu-len/master
put ipc_event_workspace in update_focus
This commit is contained in:
commit
0833fa0c75
|
@ -11,7 +11,6 @@ bool locked_container_focus = false;
|
||||||
bool locked_view_focus = false;
|
bool locked_view_focus = false;
|
||||||
|
|
||||||
// switches parent focus to c. will switch it accordingly
|
// switches parent focus to c. will switch it accordingly
|
||||||
// TODO: Everything needs a handle, so we can set front/back position properly
|
|
||||||
static void update_focus(swayc_t *c) {
|
static void update_focus(swayc_t *c) {
|
||||||
// Handle if focus switches
|
// Handle if focus switches
|
||||||
swayc_t *parent = c->parent;
|
swayc_t *parent = c->parent;
|
||||||
|
@ -20,6 +19,7 @@ static void update_focus(swayc_t *c) {
|
||||||
swayc_t *prev = parent->focused;
|
swayc_t *prev = parent->focused;
|
||||||
// Set new focus
|
// Set new focus
|
||||||
parent->focused = c;
|
parent->focused = c;
|
||||||
|
|
||||||
switch (c->type) {
|
switch (c->type) {
|
||||||
// Shouldnt happen
|
// Shouldnt happen
|
||||||
case C_ROOT: return;
|
case C_ROOT: return;
|
||||||
|
@ -32,6 +32,7 @@ static void update_focus(swayc_t *c) {
|
||||||
// Case where workspace changes
|
// Case where workspace changes
|
||||||
case C_WORKSPACE:
|
case C_WORKSPACE:
|
||||||
if (prev) {
|
if (prev) {
|
||||||
|
ipc_event_workspace(prev, c);
|
||||||
// update visibility of old workspace
|
// update visibility of old workspace
|
||||||
update_visibility(prev);
|
update_visibility(prev);
|
||||||
destroy_workspace(prev);
|
destroy_workspace(prev);
|
||||||
|
|
|
@ -223,7 +223,5 @@ bool workspace_switch(swayc_t *workspace) {
|
||||||
}
|
}
|
||||||
arrange_windows(workspace, -1, -1);
|
arrange_windows(workspace, -1, -1);
|
||||||
|
|
||||||
ipc_event_workspace(active_ws, workspace);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue