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

Random panel and desktop issues with dual monitor setup #987

Open
stefonarch opened this issue Jan 15, 2025 · 18 comments
Open

Random panel and desktop issues with dual monitor setup #987

stefonarch opened this issue Jan 15, 2025 · 18 comments
Labels
bug Something isn't working

Comments

@stefonarch
Copy link

They can't be reproduced always. Laptop with external monitor, on the right. lxqt-panel sees the external monitor on the right as "monitor 1". Top panel is on monitor 2 (laptop). On login top panel is instead sometimes found on the right monitor (1). When I close the lid/suspend the top panel switches to the other monitor for a moment, as he powers off later. I can't see this with other compositors.

The desktop (pcmanfm-qt --desktop) instead is sometimes only shown on the laptop monitor after wakeup. Restarting it from session settings → modules fix that. This happens randomly too.

It looks as this depends also on how long the suspend lasts, a short period doesn't produce the desktop issue.

System Information

  • niri version:
    niri 25.01 (unknown commit)
  • Distro: Arch, extra-testing repo, but it was the same with a compiled version when floating was added.
@stefonarch stefonarch added the bug Something isn't working label Jan 15, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 15, 2025

These sound like client issues. In particular, clients should not rely on the order of monitors advertised through wl_output or xdg_output.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 15, 2025

It looks as this depends also on how long the suspend lasts, a short period doesn't produce the desktop issue.

Do you mean suspend as in full system suspend? Then it's quite strange that the suspend duration would affect this. Niri isn't involved in suspend in any way, I'm not sure what would change.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 15, 2025

In particular, clients should not rely on the order of monitors advertised through wl_output or xdg_output.

I think it should be possible to check if this is the case: in wayland-info output see if the order in which the two wl_outputs and xdg_outputs are reported corresponds to panel going to either of the monitors?

@stefonarch
Copy link
Author

For the duration diff I suspect the wakeup time for the external monitor is longer. Both issues I've not encountered on labwc or hyprland. You mean looking here I guess:

interface: 'zxdg_output_manager_v1',                     version:  3, name:  9                                                             
        xdg_output_v1                                                                                                                      
                output: 48                                                                                                                 
                name: 'eDP-1'                                                                                                              
                description: 'Chimei Innolux Corporation - 0x15F5 - eDP-1'                                                                 
                logical_x: 0, logical_y: 0                                                                                                 
                logical_width: 1920, logical_height: 1080                                                                                  
        xdg_output_v1                                                                                                                      
                output: 45                                                                                                                 
                name: 'HDMI-A-1'                                                                                                           
                description: 'Philips Consumer Electronics Company - PHL 243V7 - HDMI-A-1'                                                 
                logical_x: 1920, logical_y: 0                                                                                              
                logical_width: 1920, logical_height: 1080  

@stefonarch
Copy link
Author

Labwc and Hyprland do see the external monitor as "2" and the internal as "1", sway does the same as Niri.
I noticed that after login the laptop monitor is "1", but after suspend it's "2", which made the top panel disappear now. And as I said: the panel appearing for the 1-2 seconds the external monitor is still alive (on lid close) I see only on Niri.

@stefonarch
Copy link
Author

In fact looks as they get inverted: after login

interface: 'wl_output',                                  version:  4, name: 39
        name: eDP-1
        description: Chimei Innolux Corporation - 0x15F5 - eDP-1
        x: 0, y: 0, scale: 1,
        physical_width: 340 mm, physical_height: 190 mm,
        make: 'Chimei Innolux Corporation', model: '0x15F5',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 1920 px, height: 1080 px, refresh: 60.008 Hz,
                flags: current preferred
interface: 'wl_output',                                  version:  4, name: 40
        name: HDMI-A-1
        description: Philips Consumer Electronics Company - PHL 243V7 - HDMI-A-1
        x: 1920, y: 0, scale: 1,
        physical_width: 530 mm, physical_height: 300 mm,
        make: 'Philips Consumer Electronics Company', model: 'PHL 243V7',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
                flags: current preferred
 

after suspend:

interface: 'wl_output',                                  version:  4, name: 40
        name: HDMI-A-1
        description: Philips Consumer Electronics Company - PHL 243V7 - HDMI-A-1
        x: 1920, y: 0, scale: 1,
        physical_width: 530 mm, physical_height: 300 mm,
        make: 'Philips Consumer Electronics Company', model: 'PHL 243V7',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
                flags: current preferred
interface: 'wl_output',                                  version:  4, name: 41
        name: eDP-1
        description: Chimei Innolux Corporation - 0x15F5 - eDP-1
        x: 0, y: 0, scale: 1,
        physical_width: 340 mm, physical_height: 190 mm,
        make: 'Chimei Innolux Corporation', model: '0x15F5',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 1920 px, height: 1080 px, refresh: 60.008 Hz,
                flags: current preferred

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 16, 2025

I'm not sure why suspend would switch them around. But either way, clients shouldn't rely on this order, it's not guaranteed to be consistent. (In fact, I'm not sure how I would even go about making it consistent in niri.) Can the panel instead use connector names, or better, make/model/serial?

@stefonarch
Copy link
Author

To be clear: it switches only one moment to the external monitor before it goes blank on suspend, on resume it's fine. It isn't fine on first login though as they are switched. As the panel code works everywhere from X11 to all other wayland compositors I don't think it needs touching.

@stefonarch
Copy link
Author

I suspect it could be a smithay issue, as I see it only on Niri. The behavior is exactly the same as unplugging it. A lxqt-panel shown on "Monitor 2" will switch to the remaining output if that monitor is disconnected and switch back if plugged in again. Also desktop window randomly not drawn on one or both monitors is probably caused by this.

I looked at xfce4-panel and it uses "automatic", "primary" or an identifier:

Image

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 18, 2025

Hmm. There's no concept of a "primary" output on Wayland; I believe GTK will just return monitor at index 0 or something (which will change depending on which monitor happens to be advertised first). Not sure about Qt.

@stefonarch
Copy link
Author

Looks like we're on the way to use identifiers in the panel on wayland under the hood, And as fallout an option to keep panels tied or move them to the remaining output if their output is disconnected.

But still it looks like that only Niri does a similar thing as "unplugging" at suspend.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 20, 2025

I'm still not sure why this unplugging at suspend happens because niri isn't even involved in suspend in any way. It just reacts to events as sent by udev, should be same as any other compositor

@stefonarch
Copy link
Author

For the panel this is fixed by lxqt/lxqt-panel#2226
The desktop issue could be probably fixed in a similar way.
Feel free to close this, although those issues arised only on Niri.

@stefonarch
Copy link
Author

Btw just tested xfdesktop: same issue, missing on one output after suspending.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 22, 2025

Wait I just realized. You have an internal + external monitor connected. This means that by default, niri will turn off the internal monitor upon closing the lid (since usually this configuration won't suspend the system, but leave you working on just the external monitor). This must be why the eDP-1 global is removed and re-added: simply the same as unplugging and plugging back in the monitor.

You can try adding the keep-laptop-panel-on-when-lid-is-closed debug flag which will keep eDP-1 on throughout.

If this is the case then well, I'd argue that it is still a client-side issue where monitor reconnects aren't handled (just ignored).

@tsujan
Copy link

tsujan commented Jan 22, 2025

The desktop issue could be probably fixed in a similar way.

It seems so: lxqt/pcmanfm-qt#2006

@stefonarch
Copy link
Author

It seems so: lxqt/pcmanfm-qt#2006

It is so :)

@tsujan
Copy link

tsujan commented Jan 22, 2025

Then, as far as LXQt is concerned, this isn't an issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants