~ruther/dwl

ref: 1024928c15cebbeb1c652a6ba4a243f1c330bac8 dwl/dwl.c -rw-r--r-- 75.1 KiB
1024928c — Guido Cella 4 years ago
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.
64faad7c — Guido Cella 4 years ago
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.
ee5bd9a6 — Guido Cella 4 years ago
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.
d9ab7572 — Stivvo 4 years ago
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()
80a685ee — Stivvo 4 years ago
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
5221a329 — Stivvo 4 years ago
closemon() has now only 1 parameter
934ce085 — Stivvo 4 years ago
Don't switch to disabled mons after unplug
38606a1d — Stivvo 4 years ago
Merge branch 'handleUnplug' into output-management
9f0b1686 — Stivvo 4 years ago
Back to closemon() with one parameter

With the recent changes in output-management, the extra argument in
closemon() would be needed only when unplugging the monitor, so it isn't
worth it anymore. Also now is more efficient.
9f3f15b4 — Stivvo 4 years ago
Disable mon faster

Since focusmon() now never focuses disabled monitors, there's no need to
focus the disabled monitor first
25671d79 — Stivvo 4 years ago
Fix crash when disabling focused mon

m->link.next leads to errors if the monitor to disable doesn't have a
"next" (right) monitor and is currently focused. dirtmon() does more
checks.

In some previous commits m->link.next is told to be left monitor, which
is wrong

Also focusclient() explicitly checks for disabled monitors (this fixes
in case of more than one disabled monitor)
5622dbda — Stivvo 4 years ago
Fix crash unplugging focused mon 2

Focus the top client on newmon, which we know for sure that it isn't
going to be unplugged or disabled and actually set that as the focused
monitor to move the focus. This is necessary to prevent crash when
disabling monitors with the output-management patch.
0a0e61e5 — Stivvo 4 years ago
Merge branch 'handleUnplug' into output-management
fab42e7c — Stivvo 4 years ago
Fix crash unplugging a focused mon

Focus newmon, which we know for sure that it isn't be unplugged or
disabled
a4d42ea7 — Stivvo 4 years ago
Focus client on a new monitor before closing
62fb4c08 — Stivvo 4 years ago
Block access to disabled monitor

Before this, pressing mod+comma or mod+period (focusmon function) moved
the focus to disabed monitors. Now, all disabled monitors are skipped
388ab9df — Stivvo 4 years ago
Move disabled clients to the left

To the nearest monitor to the left of the disabled one
806ebffe — Stivvo 4 years ago
Merge branch 'handleUnplug' into output-management
fbbc1fd6 — Stivvo 4 years ago
Merge branch 'handleUnplug' of http://olidata.stivvo01.com:3000/Stivvo01/dwl into handleUnplug
d4178b9d — Stivvo 4 years ago
Closemon(), newmon as parameter

This allows to fix output-management: move clients to the monitor on the
left of the disabled one, instead of the leftmost (which might happen to
be the disabled one)

Also using wl_list_foreach() and then brake after the first iteration is
ugly and inefficient
Next
Do not follow this link