Closed RiedleroD closed 1 month ago
Can confirm. The fractional scaling behaves differently on hyprland and sway for some reason.
This patch makes the scaling in sway work properly:
diff --git a/src/core/LockSurface.cpp b/src/core/LockSurface.cpp
index 006a2eb..cd7366d 100644
--- a/src/core/LockSurface.cpp
+++ b/src/core/LockSurface.cpp
@@ -102,13 +102,13 @@ void CSessionLockSurface::configure(const Vector2D& size_, uint32_t ser
ial_) {
wl_surface_damage_buffer(surface, 0, 0, 0xFFFF, 0xFFFF);
if (!eglWindow) {
- eglWindow = wl_egl_window_create(surface, size.x, size.y);
+ eglWindow = wl_egl_window_create(surface, logicalSize.x, logicalSize.y);
if (!eglWindow) {
Debug::log(CRIT, "Couldn't create eglWindow");
exit(1);
}
} else
- wl_egl_window_resize(eglWindow, size.x, size.y, 0, 0);
+ wl_egl_window_resize(eglWindow, logicalSize.x, logicalSize.y, 0, 0);
if (!eglSurface) {
eglSurface = g_pEGL->eglCreatePlatformWindowSurfaceEXT(g_pEGL->eglDisplay, g_pEGL->e
glConfig, eglWindow, nullptr);
But it breaks it in hyprland, where hyprlock always fits the output, but widgets are not scaled. I am not fully sure, what is intended here.
can you post a wayland_debug from sway
also tf is that lockscreen lmao
also tf is that lockscreen lmao
I just like having a weird lockscreen 😅 I made it myself with some html+css and a QR code generator, rendered into png via FF.
probably using sway+hyprlock as a bsod for hyprland xD
I don't use hyprland at all, I just got frustrated with the absolute state swaylock-effects is in, so I'm looking to switch to hyprlock for my sway setup.
wayland_debug
I tried to look it up, but I'm not sure how to do that. Seems to be something different than the normal sway debug output, right?
WAYLAND_DEBUG=1 hyprlock |& tee ~/debug.log
Sorry first log i posted was from entire sway session.
Here from sway with scale 1.5: wl_debug_sway.log Here from hl with scale 1.5: wl_debug_hl.log
I don't see a problem here... maybe sway's fractional scale on lockscreens is broken?
IIRC no other lock does support fsv1
Could be.
Sway and river behave the same.
Niri (smithay impl) errors with EXT_SESSION_LOCK_SURFACE_V1_ERROR_DIMENSIONS_MISMATCH
Should we disable fsv1 for non-hyprland compositors for now?
There is one thing I don't really understand, but it could be that I am misunderstanding fsv1. Shouldn't the widget dimensions scale somehow? Because right now the fractionalScale does not influence the size of widgets at all.
that's up to us to do, and atm we just dont
Should we disable fsv1 for non-hyprland compositors for now?
we can add an option 0 disable 1 enable 2 default auto
Niri (smithay impl) errors with EXT_SESSION_LOCK_SURFACE_V1_ERROR_DIMENSIONS_MISMATCH
This just appeared: https://github.com/Smithay/smithay/pull/1496, I guess it fixes that
correct, it should (can't say for sure I don't understand that devilish language)
Niri works as expected with https://github.com/Smithay/smithay/pull/1496. So this is probably a wlroots bug.
likely
When I set my scaling to anything larger than 1 in sway, hyprlock renders at an incorrect resolution, as if compensating for scaling like an XWayland window. Since the lockscreen works differently, however, the output isn't just blurry, but there's a black area around the scaled down "window" of hyprlock. It's not a fractional scaling problem, setting it to 2 has the same effect, the rendered part is just even smaller.
hyprlock at 1.74 scaling:![20240724_00h34m17s_grim](https://github.com/user-attachments/assets/df781867-72ec-4fec-a0e6-d1decf7910be)
equivalent swaylock-effects at 1.74 scaling:![20240724_00h35m22s_grim](https://github.com/user-attachments/assets/cd9aed51-96f8-49f3-8ca0-c9632f158364)
(how did I get those screenshots?
sleep 2 && grim
)log output:
my laptop screen resolution is 2880x1800 so neither of the detected ones are quite right. That might be an unrelated rounding error due to fractional scaling tho