Closed stefonarch closed 1 day ago
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.
The panel gets positioned by anchors with layer-shell-qt - the only issue here is that a panel restart is needed to apply settings.
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.
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?
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.
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.
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.
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.
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.
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.
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