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

Make greeter window fullscreen #1673

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Conversation

aleasto
Copy link
Contributor

@aleasto aleasto commented Feb 20, 2023

Only fullscreen clients can decide the output display on wayland

Fixes #1672

Only fullscreen clients can decide the output display on wayland
@Vogtinator Vogtinator merged commit 676fb59 into sddm:develop Feb 21, 2023
@aleixpol
Copy link
Contributor

This fix is wrong though. We are not using xdg shell so the premise of "only fullscreen windows choose output" doesn't apply. It should either be using layer shell or xdg fullscreen, on either this change shouldn't make a difference (at best) or it broke for other use cases.

I'd suggest reverting this and taking some time to understand what you are seeing.

@aleasto
Copy link
Contributor Author

aleasto commented Feb 21, 2023

This change fixes it for QT_WAYLAND_SHELL_INTEGRATION=layer-shell

@Vogtinator
Copy link
Contributor

This fix is wrong though. We are not using xdg shell so the premise of "only fullscreen windows choose output" doesn't apply. It should either be using layer shell or xdg fullscreen, on either this change shouldn't make a difference (at best) or it broke for other use cases.

IMO this fix is not wrong in any case, as we want the greeter to be fullscreen (except maybe for test mode? Debatable). According to the QWindow::show doc:

This is equivalent to calling showFullScreen(), showMaximized(), or showNormal(), depending on the platform's default behavior for the window type and flags.

Currently this defaults to showNormal() on the wayland platform.

@aleasto
Copy link
Contributor Author

aleasto commented Feb 21, 2023

This change fixes it for QT_WAYLAND_SHELL_INTEGRATION=layer-shell

Well, I went to double check and it doesn't. I must have been trying with QT_WAYLAND_SHELL_INTEGRATION=xdg-shell which I can confirm double-checked is fixed by this

@Vogtinator
Copy link
Contributor

To clarify, it's still broken with QT_WAYLAND_SHELL_INTEGRATION=layer-shell but works with xdg-shell now?

@aleasto
Copy link
Contributor Author

aleasto commented Feb 21, 2023

Yea. Previously both showed the behaviour of spawning both windows in the same screen, as per my screenrecording in #1672

@Vogtinator
Copy link
Contributor

Can be reproduced easily by using dbus-run-session kwin_wayland --wayland-display $WAYLAND_DISPLAY and then WAYLAND_DISPLAY=wayland-1 QT_WAYLAND_SHELL_INTEGRATION=layer-shell ./src/greeter/sddm-greeter --test-mode.

With WAYLAND_DEBUG=1, it shows that it does not specify an output on layer creation:

zwlr_layer_shell_v1@24.get_layer_surface(new id zwlr_layer_surface_v1@38, wl_surface@43, nil, 2, "window")

@Vogtinator
Copy link
Contributor

Vogtinator commented Feb 21, 2023

Works with this patch to layer-shell-qt:

diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp
index dd17aa0..e172b52 100644
--- a/src/qwaylandlayersurface.cpp
+++ b/src/qwaylandlayersurface.cpp
@@ -25,6 +25,10 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandC
 
     wl_output *output = nullptr;
     QScreen *screen = interface->desiredOutput();
+    if (!screen) {
+        screen = window->window()->screen();
+    }
+
     if (screen) {
         auto waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen *>(screen->handle());
         // Qt will always assign a screen to a window, but if the compositor has no screens available a dummy QScreen object is created

That would be a rather big oversight though, so I wonder whether that was intentionally not done.

@aleasto
Copy link
Contributor Author

aleasto commented Feb 21, 2023

Yes that works on my test set up.

@Vogtinator
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sddm on kwin_wayland: Multi-monitor opens all greeter windows on one monitor
4 participants