Toggle fullscreen on all clients
mod+e allows to toggle fullscreen any client, even those who don't
support it themselves
Handle new windows
Windows lose fullscreen state when a new window is created in the same
tag
Same fscreen func for xdg and xwayland
Restore windows after fullscreen
Store position and size of windows before going fullscreen. This is more
efficient than arrange() and also works with floating windows
All the clients keep their original position because arrange() isn't
used after quitting fullscreen
No borders on fullscreen windows
Some code has been borrowed from the smartBorders patch
handle the x11 configure event
This fixes the window size of old games in Wine.
implement the virtual keyboard protocol
This is used by wtype.
Also properly cleanup keyboards. Without wl_list_remove(&kb->link) dwl
crashed after using wtype 2-3 times.
Allow toggling the layout before selecting a different one
Implement the idle protocol
It allows clients such as swayidle and chat applications to monitor user
idle time.
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.
implement the wlr-data-transfer protocol
It makes wl-clipboard work properly in neovim, without having to create
a transparent surface that steals focus and causes flickering. It's also
required for clipman.
fix temporarily disabling a single monitor
The code in this else completely freezes my system when I run the
swayidle command to replicate xset dpms force off. No idea if it works
on multiple monitors, but for now avoid running when there's 1 monitor.
Also remove the comment with the function name in sway.
Don't switch to another disabled monitors
Since wlr_output_enable doesn't have any effect before finishing all the
procedure, a little hack allows to make use of focusmon(), which must
know the latest in about which output is currently disabled
Also improve performance in focusmon() and cleaner code in
outputmgrapplyortest()
Fix crash with no monitors left
When there's no monitors left, prevent the while in cleanupmon() to
become an infinite loop
Also switch to the left monitors instead of the right
closemon() has now only 1 parameter