Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove_unplugged_monitors is not working #148

Closed
andornaut opened this issue May 17, 2014 · 6 comments
Closed

remove_unplugged_monitors is not working #148

andornaut opened this issue May 17, 2014 · 6 comments

Comments

@andornaut
Copy link

I have a laptop that is sometimes connected to an external monitor. I've configured bspwm to remove unplugged and disabled monitors, but bspwm does not remove the external monitor when it is disconnected,

Excerpt from bspwmrc:

bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true

2 screens: built-in laptop screen + external monitor:

$ bspc query -T && xrandr
a 1920x1080+2560+0 28,0,0,0 *
    one 6 12 0,0,0,0 T - *
        m URxvt urxvt 0x2C00009 6 724x412+3152+328 R -------- *
    two 6 12 0,0,0,0 T -
        m URxvt urxvt 0x600009 6 724x412+3184+184 R -------- *
    three 6 12 0,0,0,0 T -
        m URxvt urxvt 0x2600009 6 724x412+591+327 L -------- *
    four 6 12 0,0,0,0 T -
        V a 0.520000
            H m 0.480000
                a Google-chrome google-chrome 0x34000B4 6 1200x725-1855+342 R -------- *
                c URxvt urxvt 0x800009 6 724x412-1969+326 L --------
            H c 0.520000
                m URxvt urxvt 0x2800009 6 724x412-1966+329 R --------
                m URxvt urxvt 0x3600009 6 724x412-1966+329 U --------
b 2560x1600+0+0 0,0,0,0
    five 6 12 0,0,0,0 T - *
Screen 0: minimum 320 x 200, current 4480 x 1600, maximum 32767 x 32767
eDP1 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 309mm x 175mm
   1920x1080      60.0*+   59.9  
   1680x1050      60.0     59.9  
   1600x1024      60.2  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 641mm x 400mm
   2560x1600      60.0*+
   1920x1200      59.9  
   1920x1080      60.0     50.0     59.9  
   1600x1200      60.0  
   1680x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x800       59.8  
   1280x720       60.0     50.0     59.9  
   1024x768       60.0  
   800x600        60.3  
   720x576        50.0  
   720x480        60.0     59.9  
   640x480        60.0     59.9  
   720x400        70.1  
HDMI1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

With 1 screen: built-in laptop screen (external monitors physically disconnected):

$ bspc query -T && xrandr
a 1920x1080+2560+0 28,0,0,0 *
    one 6 12 0,0,0,0 T - *
        m URxvt urxvt 0x2C00009 6 724x412+3152+328 R -------- *
    two 6 12 0,0,0,0 T -
        m URxvt urxvt 0x600009 6 724x412+3184+184 R -------- *
    three 6 12 0,0,0,0 T -
        m URxvt urxvt 0x2600009 6 724x412+591+327 L -------- *
    four 6 12 0,0,0,0 T -
        V a 0.520000
            H m 0.480000
                a Google-chrome google-chrome 0x34000B4 6 1200x725-1855+342 R -------- *
                c URxvt urxvt 0x800009 6 724x412-1969+326 L --------
            H c 0.520000
                m URxvt urxvt 0x2800009 6 724x412-1966+329 R --------
                m URxvt urxvt 0x3600009 6 724x412-1966+329 U --------
b 2560x1600+0+0 0,0,0,0
    five 6 12 0,0,0,0 T - *
Screen 0: minimum 320 x 200, current 4480 x 1600, maximum 32767 x 32767
eDP1 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 309mm x 175mm
   1920x1080      60.0*+   59.9  
   1680x1050      60.0     59.9  
   1600x1024      60.2  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 disconnected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
HDMI1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
  2560x1600 (0xc5)  268.5MHz
        h: width  2560 start 2608 end 2640 total 2720 skew    0 clock   98.7KHz
        v: height 1600 start 1603 end 1609 total 1646           clock   60.0Hz

In the "1 screen" example, bspc query -T still shows a connected external monitor: "b 2560x1600+0+0 0,0,0,0"; even though it is physically disconnected and does not show up in the xrandr output.

bspwm was recently compiled and installed from the git master head.

$ bspwm -v
0.8.8
@SuperFluffy
Copy link

I can confirm this issue; getting the same results with remove_disabled_monitors true and remove_unplugged_monitors true set.

@baskerville
Copy link
Owner

@andornaut : not sure what VIRTUAL1 is but it seems to be related to this issue.
Is merge_overlapping_monitors set?
The output of bspwm compiled with make debug might be helpful. (There's a patch for the Arch Linux stock Git package.)

@SuperFluffy
Copy link

With merge_overlapping_monitors set, bspwm behaves correctly, moves all windows to the new monitor, and also uses the entire space (although bspc config top_padding 30 is ignored and I have to set it by hand; but I will open a different bug report for that).

I have set merge_overlapping_monitors now, and redid the experiment: bspwm with and without the external, and with and without merge_overlapping_monitors. These settings are set:

bspc config remove_disabled_monitor true
bspc config remove_unplugged_monitor true
bspc config merge_overlapping_monitors [false, true]

xrandr and bspc -T without the external:

% xrandr
Screen 0: minimum 8 x 8, current 1280 x 800, maximum 32767 x 32767
LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
   1280x800      60.16*+  50.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
% bspc -T
LVDS1 1280x800+0+0 30,0,0,0 *
    I 2 12 0,0,0,0 T -
        m Termite termite 0x1600003 2 642x362+317+217 L -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1C00078 2 1252x742+12+27 D -------- *
    III 2 12 0,0,0,0 T - *
        m Termite termite 0x1E00003 2 642x362+317+217 R -------- *
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -

With the external (but with merge_overlapping_monitors false):

% xrandr
Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 32767 x 32767
LVDS1 connected (normal left inverted right x axis y axis)
   1280x800      60.16 +  50.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
VGA1 connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050     59.88*+  59.95  
   1280x1024     75.02    60.02  
   1440x900      74.98    59.89  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.08    60.00  
   832x624       74.55  
   800x600       75.00    60.32    56.25  
   640x480       75.00    60.00  
   720x400       70.08  
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
% bspc -T
LVDS1 1280x800+0+0 30,0,0,0 *
    I 2 12 0,0,0,0 T -
        m Termite termite 0x1600003 2 642x362+317+217 L -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1C00078 2 1252x742+12+27 D -------- *
    III 2 12 0,0,0,0 T - *
        m Termite termite 0x1E00003 2 642x362+317+217 R -------- *
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -
VGA1 1680x1050+0+0 0,0,0,0
    Desktop2 2 12 0,0,0,0 T - *

And now with merge_overlapping_monitors true:

% bspc -T
VGA1 1680x1050+0+0 0,0,0,0 *
    I 2 12 0,0,0,0 T - *
        m Termite termite 0x1200003 2 642x362+515+340 R -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1C00078 2 1252x742+183+143 R -------- *
    III 2 12 0,0,0,0 T -
        m Termite termite 0x1A00003 2 642x362+515+340 R -------- *
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -

@SuperFluffy
Copy link

I have something new to add to the discussion: bspwm seems to have trouble when it is started with an external monitor connected; it works fine if I start bspwm and connect the external screen afterwards - I then experience the behaviour documented in my last comment.

However, when the external screen is connected at start, bspwm does the following:

  • it technically sees/uses the whole area of the external VGA1, but only puts tiled windows in the area corresponding to LVDS1; screenshot:
    bspwm_unmerged
  • when I xrandr --output LVDS1 --off the laptop screen, the windows stay on on LVDS1, even though it is turned off and my config tells bspwm to remove the disabled screen.
  • when I float a window and pull it into the empty area, bspwm will snap it to VGA1, but now the windows bleed into each other. Here is a screenshot of Firefox on LVDS1 (tiled) with a termite instance on VGA1 (tiled) underneath it.
    window_bleeding

I have the following relevant settings:

bspc config remove_disabled_monitor true
bspc config remove_unplugged_monitor true
bspc config merge_overlapping_monitors true

A query after startup with LVDS1 still enabled:

LVDS1 1280x800+0+0 30,0,0,0 *
    I 2 12 0,0,0,0 T - *
        V m 0.520000
            m Termite termite 0x1A00003 2 562x314+357+241 R --------
            m Termite termite 0x1600003 2 562x314+357+241 R -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1E00078 2 976x1142+150-2 R -------- *
    III 2 12 0,0,0,0 T -
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -
VGA1 1920x1200+0+0 30,0,0,0
    Desktop2 1 6 0,0,0,0 T - *

How it looks like after xrandr --output LVDS1 --off (same thing, basically; LVDS1 was not removed):

LVDS1 1280x800+0+0 30,0,0,0 *
    I 2 12 0,0,0,0 T - *
        V m 0.520000
            m Termite termite 0x1A00003 2 562x314+357+241 R --------
            m Termite termite 0x1600003 2 562x314+357+241 R -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1E00078 2 976x1142+150-2 R -------- *
    III 2 12 0,0,0,0 T -
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -
VGA1 1920x1200+0+0 30,0,0,0
    Desktop2 1 6 0,0,0,0 T - *

And now with the windows bleeding into each other:

LVDS1 1280x800+0+0 30,0,0,0 *
    I 2 12 0,0,0,0 T - *
        m Termite termite 0x1600003 2 562x314+357+241 R -------- *
    II 2 12 0,0,0,0 T -
        m Firefox Navigator 0x1E00078 2 976x1142+150-2 R -------- *
    III 2 12 0,0,0,0 T -
    IV 2 12 0,0,0,0 T -
    V 2 12 0,0,0,0 T -
    VI 2 12 0,0,0,0 T -
    VII 2 12 0,0,0,0 T -
    VIII 2 12 0,0,0,0 T -
    IX 2 12 0,0,0,0 T -
    X 2 12 0,0,0,0 T -
VGA1 1920x1200+0+0 30,0,0,0
    Desktop2 1 6 0,0,0,0 T - *
        m Termite termite 0x1A00003 2 562x314+1419+824 R -------- *

@baskerville
Copy link
Owner

Please note that the settings end with _monitors, not _monitor.

9f8f115 should help.

@SuperFluffy
Copy link

Thanks for noticing that; I have changed all settings to _monitors. Removing LVDS1 does what it should! :)

SeerLite pushed a commit to SeerLite/bspwm that referenced this issue Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants