Open ysl2 opened 11 months ago
Thank you for your Issue regarding the function resetlayout
.
I have had a closer look and found out that this implementation I made is not correct, I did not encounter any problems with it yet. The resetlayout
function affects the active monitor. The Client which is unmanaged does not need to be on the active monitor. So, this means that when the last Client of a tag is unmanaged on a different monitor the resetlayout
function will be called on the active monitor which is not meant to happen.
The nexttiled(m->clients)
does look for a next Client that is visible (exuding floating Clients). So, if no Client is visible it will call the resetlayout
function. This does indeed need to change to Clients on a specific tag if the pertag patch is in use.
The resetlayout
function calls setmfact
. This function calls arrange()
, there you have already a duplicate.
I have unfortunate not yet a solution to this issue. My first thought is to make a separate function which resets the layout, and the mfact on the correct monitor. With the pertag patch also the correct tag. I will look for a solution, If you also have a suggestion please let me know.
Hi Arie,
I have searched on internet and find this post: https://www.reddit.com/r/suckless/comments/s2ch3f/dwm_how_to_reset_to_tiled_layout_when_all_windows/
Thanks for your instruction! But I think it seems not a good way. Beacuse It will check all clients in a monitor instead of a specific tag. And this might be dangerous, beacuse we have
focus(NULL); updateclientlist(); arrange(m);
in the above ofresetlayout()
, the current focus tag might be already changed. Then it callsresetlayout()
, thesetlayout()
subfunction (inresetlayout()
) callsarrange()
if theselmon->sel
is not empty. So it might cause potential duplicatearrange()
call.So I wonder if there has a safe way to achieve the goal? Thanks ! :-)