i3 incorrectly detects output resolution after removal of multiple monitors
- Dominant language
- C
- Stars
- 10.6k
- Forks
- 822
- PR merge metrics
- No merged PRs in 30d
Description
## I'm submitting a…
[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)
## Current Behavior
I had two outputs, `DP1` and `HDMI2`, active and a third `eDP-1` disabled. I then ran `xrandr --output eDP-1 --auto --output DP1 --off --output HDMI2 --off` when undocking from the two external monitors. The resulting output resolution in i3 did not match the resolution reported in xrandr.
```
$ i3-msg -t get_outputs | jq .
[
{
"name": "eDP1",
"active": true,
"primary": true,
"rect": {
"x": 0,
"y": 0,
"width": 1440,
"height": 1440
},
"current_workspace": "2"
},
{
"name": "xroot-0",
"active": false,
"primary": false,
"rect": {
"x": 0,
"y": 0,
"width": 2560,
"height": 2560
},
"current_workspace": null
},
{
"name": "DP1",
"active": false,
"primary": false,
"rect": {
"x": 0,
"y": 0,
"width": 1440,
"height": 1440
},
"current_workspace": null
}
]
```
```
$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 2560, maximum 32767 x 32767
eDP1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
2560x1440 60.00*+
1920x1440 60.00
1856x1392 60.01
1792x1344 60.01
2048x1152 60.00 59.90 59.91
1920x1200 59.88 59.95
1920x1080 59.96 60.00 59.93
1600x1200 60.00
1680x1050 59.95 59.88
1400x1050 59.98
1600x900 60.00 59.95 59.82
1280x1024 60.02
1400x900 59.96 59.88
1280x960 60.00
1368x768 60.00 59.88 59.85
1280x800 59.81 59.91
1280x720 59.86 60.00 59.74
1024x768 60.00
1024x576 60.00 59.90 59.82
960x540 60.00 59.63 59.82
800x600 60.32 56.25
864x486 60.00 59.92 59.57
640x480 59.94
720x405 59.51 60.00 58.99
640x360 59.84 59.32 60.00
DP1 disconnected 1440x2560+0+0 left (normal left inverted right x axis y axis) 0mm x 0mm
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
2560x1440 60.00
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
2560x1440 (0x4b) 241.500MHz +HSync -VSync
h: width 2560 start 2608 end 2640 total 2720 skew 0 clock 88.79KHz
v: height 1440 start 1443 end 1448 total 1481 clock 59.95Hz
```
## Expected Behavior
I expected `i3` and `xrandr` to report the same resolution for the output, such that the outermost container in i3 would occupy the whole screen rather than (1440/2560)% of it.
## Reproduction Instructions
1. Attach mini-DP to DP cable to DP1 output
2. Attach HDMI to DP cable to HDMI2 output
3. Boot laptop with lid shut
4. `startx`, which launches `i3`
5. `xrandr --output HDMI2 --addmode 2560x1440` (because the monitor doesn't report it due to the HDMI-to-DP cable)
6. `xrandr --output DP1 --auto --output HDMI2 --mode 2560x1440 --right-of DP1`
7. Open a few containers on workspaces 1 (DP1) and 2 (HDMI2)
8. `xrandr --output DP1 --off --output HDMI2 --off --output eDP-1 --auto`
9. `i3-msg 'debuglog on; shmlog on; reload'`
NOTE: This is the first time I've seen this issue and I can't afford to kill my X session at the moment to see if it reproduces. A reload of i3 (mod+shift+r) does not resolve the issue. Neither did forcing the monitor to a lower resolution and then restoring it via:
```
$ xrandr --output eDP1 --mode 1024x768
$ xrandr --output eDP1 --auto
```
## Environment
Output of `i3 --moreversion 2>&-`:
Binary i3 version: 4.19 (2020-11-15) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.19 (2020-11-15) (pid 781)
Loaded i3 config: /home/me/.config/i3/config (Last modified: Sun 25 Oct 2020 01:20:30 PM PDT, 5111279 seconds ago)The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
Config file
set $mod Mod4
font pango:monospace 8
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
default_border none
default_floating_border none
mouse_warping none
floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Shift+q kill
bindsym $mod+d exec dmenu_run
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+h split h
bindsym $mod+v split v
bindsym $mod+f fullscreen toggle
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exit
mode "resize" {
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
bar {
i3bar_command /home/me/bin/polymon
}
Logfile URL: https://logs.i3wm.org/logs/5665404747776000.bz2
- Linux Distribution & Version: Arch x86_64
- Linux xxxxx 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64 GNU/Linux
- xorg-server 1.20.10-3- Are you using a compositor (e.g., xcompmgr or compton): No
Contributor guide
Assessment
This issue has not been assessed yet.