diff options
author | Guido Cella <guido@guidocella.xyz> | 2020-12-19 06:57:14 +0100 |
---|---|---|
committer | Guido Cella <guido@guidocella.xyz> | 2020-12-19 12:34:31 +0100 |
commit | 1024928c15cebbeb1c652a6ba4a243f1c330bac8 (patch) | |
tree | dce21864e2f00480c290f315a230906058b450ed /LICENSE.tinywl | |
parent | 64faad7cb6dfc59832ef3249b606df89c23327f8 (diff) |
deactivate focused client when spawning a new one
Because maprequest immediately calls wl_list_insert(&fstack, &c->flink),
in the following call to setmon(), the selclient() which is passed to
focusclient() as the old client is actually the newly mapped client, and
the real old one is never deactivated. You can see this by, for example,
opening Chromium's devtools, then spawning a terminal. The background of
the focused line in the devtools doesn't change from light blue to grey.
We can't just remove wl_list_insert(&fstack, &c->flink) from maprequest,
because calling wl_list_remove in focusclient() with a client that has
not been added to the list causes a segmentation fault.
Therefore we fix the focusclient call by not passing it the old client
every time, but instead using the wlroots function that gets the focused
surface and deactivate that, like in TinyWL.
This also avoids getting the selected client and passing it to
focusclient() on every call unnecessarily, and will allow removing
shouldfocusclients in a future commit by checking if old is a layer
surface instead.
Diffstat (limited to 'LICENSE.tinywl')
0 files changed, 0 insertions, 0 deletions