Sway switch-workspace erratic

I’ve recently installed OS on new A311D boot and so I’m running sway with the default config, and the switch-workspace keybindings erratic.

After boot it defaults to workspace 1 which works normally.

If I press LOGO+2 ($mod+1) the “1” in the top bar unhighllights (white background goes black) but “2” does not appear, and mod tab does not open, mod enter doesnt start a shell etc. Same thing with 3, 4, 5, etc

It eventually does work, sometimes, eg. I open workspace 2, but then others dont work.

The config is default:

    # Switch to workspace
    bindsym $mod+1 workspace 1
    bindsym $mod+2 workspace 2
    bindsym $mod+3 workspace 3
    bindsym $mod+4 workspace 4

etc. Ive made literally zero changes to any config.

Any suggestions?

1 Like

Oh, I think this is because Sway is putting (at least) one workspace on the HDMI output, even when nothing is plugged in. Try swaymsg output HDMI-A-1 disable on the command line or just output HDMI-A-1 disable in ~/.config/sway/config. Obviously you’ll need to reenable it to use an external display.

4 Likes

I had the same issue (MNT Reform A311D). Thanks for your fix, works smoothly :smiley:

2 Likes

Thank you! Problem solved.

nonono wait! Not problem solved!

The issue that you see should not be there in the first place. Other people will run into this problem as well. Should we not investigate how we fix this thing for good?

So was the issue indeed that on the pocket reform with a311d, the hdmi output is enabled by default even though nothing is connected? That sounds like a big bug to me.

Even more so, since a311d is still limited (by nobody having implemented the fix yet) to either output to the internal display (of classic reform) or to hdmi but not to both at the same time.

Is the situation very different on the pocket? Why?

I investigated this a little when I first figured out what was happening. I don’t think the HDMI output is enabled per wayland, but I couldn’t figure out why sway was treating it as enabled.

Here’s what wlr-randr and sway say, with the stock sway config, on a311d pocket reform:

$ wlr-randr 
DSI-1 "(null) (null) (DSI-1)"
  Make: (null)
  Model: (null)
  Serial: (null)
  Physical size: 95x151 mm
  Enabled: yes
  Modes:
    1200x1920 px, 54.021999 Hz (current)
  Position: 0,0
  Transform: 90
  Scale: 1.500000
  Adaptive Sync: disabled
HDMI-A-1 "(null) (null) (HDMI-A-1)"
  Make: (null)
  Model: (null)
  Serial: (null)
  Enabled: no
  Modes:
    1024x768 px, 60.004002 Hz
    800x600 px, 60.317001 Hz
    800x600 px, 56.250000 Hz
    848x480 px, 60.000000 Hz
$ swaymsg -t get_outputs
Output DSI-1 'Unknown Unknown Unknown' (focused)
  Current mode: 1200x1920 @ 54.022 Hz
  Power: on
  Position: 0,0
  Scale factor: 1.500000
  Scale filter: linear
  Subpixel hinting: unknown
  Transform: 270
  Workspace: 3
  Max render time: off
  Adaptive sync: disabled
  Allow tearing: no
  Available modes:
    1200x1920 @ 54.022 Hz

Output HDMI-A-1 'Unknown Unknown Unknown'
  Current mode: 0x0 @ 0.000 Hz
  Power: off
  Position: 1280,0
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 2
  Max render time: off
  Adaptive sync: disabled
  Allow tearing: no
  Available modes:
    1024x768 @ 60.004 Hz
    800x600 @ 60.317 Hz
    800x600 @ 56.250 Hz
    848x480 @ 60.000 Hz

I don’t know why sway assigns workspaces to / enables outputs it knows are off, and I’m not sure how this behavior is different than e.g. imx8plus.

I also had some other issues with the HDMI output on a311d, so it seems like something is misconfigured somewhere in the display driver stack? But I couldn’t guess what.

I see the same issue on Gentoo on the regular Reform with A311D too though - I had to add a line to my sway config that disables the HDMI output at startup.

Oh no… I can reproduce this issue on A311D classic Reform…

@tomicdesu @deianara @soulsource does either of you want to file this issue over at Issues · Bugs / Bugs · GitLab or would you like me to take care of summarizing this thread over there?

Since I am not running the official image, I feel it would be better if someone who does (or at least has an SD card with it ready) files the bug report.

OK I’ve done so. I leave in the morning on a 4 day trip so I’ll be slow to respond.

2 Likes