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

Settings not applied for dual monitor setup under wayland #2073

Open
stefonarch opened this issue Jun 17, 2024 · 8 comments
Open

Settings not applied for dual monitor setup under wayland #2073

stefonarch opened this issue Jun 17, 2024 · 8 comments
Labels

Comments

@stefonarch
Copy link
Member

stefonarch commented Jun 17, 2024

The configuration shows all options for positioning, but only the resolution is applied and the panel stays on the first monitor. Desktop has the same issue as can be seen here. Note: the screenshot shows what can be seen on the main monitor - "monitor 1" and the resolution of the second monitor is less.

immagine

If changing the monitor where it should appear and restarting the panel the settings will be applied correctly.

If disconnecting the monitor with a panel on it this will not be moved automatically to the other monitor, panel module restart is needed too.

Expected Behavior

Apply setting on the fly

Current Behavior

Restarting is needed under wayland.

  1. Assign a monitor to a panel in a dual monitor setup
  2. See dimension changed but not placement
  3. Restart panel module

Possible solution

  • Reload panel module automatically after changing monitor settings on wayland.

  • If not possible show a notification "Please restart panel module in session settings"?

  • LXQt Version: 2.0

@tsujan
Copy link
Member

tsujan commented Jun 17, 2024

As Qt can't get window positions under Wayland, it can't get screen positions either. Nothing can be done about this with Qt methods unless Qt-Wayland devs enhance them.

@stefonarch
Copy link
Member Author

The panel gets positioned by anchors with layer-shell-qt - the only issue here is that a panel restart is needed to apply settings.

@stefonarch
Copy link
Member Author

This happens also when adding a new panel on monitor2: it appears on monitor 1, and will be moved only to monitor 2 when restarting the panel module. So it looks just impossible to add a panel on a second monitor if this it not known or fixed.

Same when disconnecting a monitor: its panel disappears and will be moved to the remaining monitor only after restarting panel or session.

@marcusbritanicus
Copy link
Contributor

As Qt can't get window positions under Wayland, it can't get screen positions either. Nothing can be done about this with Qt methods unless Qt-Wayland devs enhance them.

Qt also cannot do anything about this. This information needs to be given by the compositor. But wayland is built for security and so compositors are not required to share with you the available geometry or window positions. So, Qt will not get this information from anywhere.

The panel gets positioned by anchors with layer-shell-qt - the only issue here is that a panel restart is needed to apply settings.

If I am correct, I think all layer-shell-qt can be applied without explicit restart. Which setting exactly is causing the problem?

@stefonarch
Copy link
Member Author

As I said: the new panel knows well about it's resolution (the one from the second monitor) but can't position itself there without restarting. The setting would be desktop=1 in panel.conf under [panel id] for a new panel on the second monitor.

Restart automatically panel process when adding or moving a panel under wayland would be enough. On monitor disconnect/connect the same.

@marcusbritanicus
Copy link
Contributor

marcusbritanicus commented Aug 23, 2024

Restart automatically panel process when adding or moving a panel under wayland would be enough. On monitor disconnect/connect the same.

I think just destroying the existing layer-surface, and creating a new one with new output should automatically move the panel to the new output. I will be busy till Tuesday. I will do a few tests on Wayfire and ping back here.

PS: If I am not making sense, then I have not understood the question and please ignore me.

@stefonarch
Copy link
Member Author

stefonarch commented Aug 23, 2024

I think just destroying the existing layer-surface, and creating a new one with new output should automatically move the panel to the new output.

Basically that is was happens when reconnecting it, so yes, I think you're right.

@stefonarch
Copy link
Member Author

stefonarch commented Sep 25, 2024

I've found a workaround in kanshi for both panel and desktop (which under some circumstances needs a restart too).
reload-module :

#!/bin/bash
qdbus org.lxqt.session /LXQtSession org.lxqt.session.stopModule lxqt-"$1".desktop
sleep 0.1
qdbus org.lxqt.session /LXQtSession org.lxqt.session.startModule lxqt-"$1".desktop

~/.config/kanshi/config for every profile:

profile foo {
    output eDP-1 {
    enable
    ....
    }
    exec sleep 1 && restart-module desktop
    exec sleep 1 && restart-module panel
}

sleep is only needed when plugging it in/out, otherwise not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo/Issues
Development

No branches or pull requests

3 participants