baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.8k stars 415 forks source link

[QUESTION] How to keep two windows full of desktop ? #1442

Open alienzj opened 1 year ago

alienzj commented 1 year ago

Dear bspwm community,

I meet some problems.

image

When I press Super t, bspwm will run bspc desktop -l next, then the single window will become like above.

If I creat another window, it will appear like below:

image

And I can't change the window size, only can switch between these windows, then press Super t to maximize one window.

I want to keep two windows full of desktop, anyone can help me to fix it? Appreciated a lot in advance.

emanuele6 commented 1 year ago

Hi.

I don't understand how the issue is occuring? Does that happen only after you run bspc desktop -l next?

It looks like the problem could be either that you have some unwanted padding, or that your monitor has been managed by bspwm with the wrong size, or maybe that you have some receptacles open.

Could you reproduce the state in the second screenshot, and share the output of running

bspc wm -d | jq -c 'del(.focusHistory, (.monitors[] | .focusedDesktopId as $id | .desktops[] | select(.id != $id)))'

in one of the two terminals?

Also maybe share your bspwmrc file so I can point out if there is something that looks wrong.

alienzj commented 1 year ago

Hi, Thanks a lot for your reply. Please kindly refer to the attached for the output. bspc_wm.log

I also don't know why the issue occurred, not occur in all desktop.

And configurations are listed here: bspwm: https://github.com/alienzj/dotfiles/blob/magic/config/bspwm/bspwmrc sxhkd: https://github.com/alienzj/dotfiles/blob/magic/config/sxhkd/sxhkdrc

I used two monitor, one's resolution is 2560x1440, another's resolution is 3840x2160. After login into system, I always run monitor_set_multi, then run bspwmrc.

emanuele6 commented 1 year ago

After login into system, I always run monitor_set_multi, then run bspwmrc.

I don't understand what you mean by that. Do you run that bspwmrc manually? You should really not do that, you should just let bspwm run it either at startup, or at runtime with bspc wm -r.


In any case, it looks like you have a bunch of invisible VIrtualBox windows that are managed by bspwm for some reason, that is why you see that weird configuration when you use the tiled layout.

wget -qO- https://github.com/baskerville/bspwm/files/10866721/bspc_wm.log | jq '.monitors[0] | .focusedDesktopId as $d | .desktops[] | select(.id == $d)' | bspdeskjson2dot | dot -Tpng > tree.png

tree

Do you have any idea why that would happen? Can you post the output of the following command run in a desktop in which the problem occurs?

bspc query -N -n .window | while IFS= read -r id; do printf \\n; xprop -id "$id"; done
alienzj commented 1 year ago

Hi,

So nice reply! Thank you so much!

Yes, I run bspwmrc manually after I run monitor_set_multi. I follow the guide from here: https://github.com/alienzj/dotfiles/tree/master/hosts/murasaki#displays. I means I use xrandr to update my monitor configuration, then reload bspwm.

From the tree you provided, maybe I have switched VirtualBox windows to the issued desktop, then switch it back? My VirtualBox windows are displayed at desktop (monitor) 0.

Yes, please kindly refer to the attached for the updated output. bspc_query.log

emanuele6 commented 1 year ago

Yes, please kindly refer to the attached for the updated output. bspc_query.log

Oops, sorry. I meant to ask you to run the command with .window.local, without '.local` it prints information about all your open windows and it is way too much output for me to handle.

In any case, please run this command instead, it will problaby make it easier for me to understand what is going on:

bspc query -T -d | jq -rc 'path(.root | .. | select(.client?) | objects) as $p | "\($p) ===== \([ getpath($p).client | .className, .instanceName ])", getpath($p).id' | while IFS= read -r l; do case $l in '['*) printf %s\\n "$l";; *) xprop -id "$l" 2>&1; esac done
alienzj commented 1 year ago

bspc query -T -d | jq -rc 'path(.root | .. | select(.client?) | objects) as $p | "($p) ===== ([ getpath($p).client | .className, .instanceName ])", getpath($p).id' | while IFS= read -r l; do case $l in '[') printf %s\n "$l";; ) xprop -id "$l" 2>&1; esac done

Thanks again.

Here is the output: bspc_query_jq.log

alienzj commented 1 year ago

Hi, @emanuele6 Thanks a lot for your help.

Recently I updated the config of bspwm, see here: https://github.com/alienzj/dotfiles/commit/f769bbe9ac8e3911f22cbd644f30465d561c22df#diff-5d8adfecd43f232c572dbbce3bfb5155cc17ffd9541fa219caa8713bb1f63d7eR17

-bspc monitor $MONITOR -d {1,2,3,4,5,6,7,8,9,0}

+bspc monitor $MONITOR -d {1,2,3,4,5,6,7,8,9,10}

Then I didn't meet windows issue. Maybe was it solved?

emanuele6 commented 1 year ago

I do not think that change would change anything with regards to your problem.

I think this specific problem (bspwm not removing windows from the tree after they are closed in some cases, which seems to be what is happening in your case from looking at the log) was reported a few times before by other users, but it always happens frequently, but unreliably (which may be why you stopped encountering this issue). Since I never encounter this bug personally, and I never managed to reproduce it, I have never attempted to fix it since I would just be guessing what could be causing the issue.

I am happy to hear that the problem seems to have gone away for you though. :) If you encounter the issue again, and figure out a reliable way to reproduce it (open program X, go into this menu, press this button, etc.), do let me know and I will try to look into it!


side note:

You can use the primary monitor descriptor to select the primary monitor in a bspwm command:

bspc monitor primary -d 1 2 3 4 5 6 7 8 9 10

And you can also use primary#next to get the monitor (managed by bspwm), that comes after the primary monitor. (if you use it in a command, the command will silently fail and do nothing if there is not a second monitor).

So a convenient way to set the desktops on the primary monitor to 1 .. 10, and the desktops for the second monitor (if any) to 11 .. 15 without having to parse xrandr output etc, is the following =):

bspc monitor primary -d 1 2 3 4 5 6 7 8 9 10
bspc monitor 'primary#next' -d 11 12 13 14 15
alienzj commented 1 year ago

Thank you so much! It is a very useful suggestion! I will try it.