Skip to content

Incorrect Screen Resolution Detection in swww for 4K Monitor in Portrait Mode with Hyprland #378

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

Open
code-ascend opened this issue Nov 6, 2024 · 4 comments

Comments

@code-ascend
Copy link

code-ascend commented Nov 6, 2024

Hello! I'm using a computer with two monitors.

Hyprland 0.45.0 built from branch
swww version: 0.9.5

~/.config/hypr/monitors.conf:

# Generated by nwg-displays. Do not edit manually.
monitor=DP-2,[email protected],1507x0,1.5
monitor=DP-2,transform,3
monitor=DP-3,[email protected],2947x360,1.0,bitdepth,10

xrandr output:

DP-3 connected primary 2560x1440+2160+0
DP-2 connected 2160x3840+0+0

DP-2 is a 4K monitor in portrait mode (vertically oriented).

Current issue upon startup: swww query output:

DP-2: 2560x1440, scale: 1.5
DP-3: 2560x1440, scale: 1

In this scaling mode, swww doesn’t stretch the wallpaper to cover the entire screen because it detects DP-2 as having a resolution of 2560x1440 and centers the image instead.

Workaround:
If I edit the line:
monitor=DP-2,[email protected],1507x0,1.5

to
monitor=DP-2,[email protected],1507x0,1.0

and then change it back to

monitor=DP-2,[email protected],1507x0,1.5

while Hyprland is running, swww then shows the correct resolution in swww query:

DP-2: 1440x2560, scale: 1.5 
DP-3: 2560x1440, scale: 1

241107_04h36m53s_screenshot

@Mange
Copy link

Mange commented Nov 9, 2024

I have a similar issue after upgrading Hyprland. My portrait monitor will not crop the image anymore, instead showing black (not --fill-colors) around a centered image.

swww query reports the screen's resolution, but not anything about it being rotated.

> swww query
DP-1: 2560x1440, scale: 1, currently displaying: image: …
DP-2: 2560x1440, scale: 1, currently displaying: image: …
DP-3: 2560x1440, scale: 1, currently displaying: image: …

DP-3 is rotated and I would assume it should be displaying 1440x2560 instead.

> swww --version
swww 0.9.5

> hyprctl version
Hyprland, built from branch v0.44.1-b at commit 4520b30d498daca8079365bdb909a8dea38e8d55  (version: bump to 0.44.1).
Date: 2024-10-09
Tag: v0.44.1, commits: 4520b30d498daca8079365bdb909a8dea38e8d55
built against aquamarine 0.4.3

Thankfully this happened after I bumped my NixOS build, so I have an easy time to diff the changes in versions between the build. I think these might be related:

[U.]  #004  aquamarine                     0.4.1 -> 0.4.3
[U*]  #084  hyprland                       0.43.0, 0.43.0-man -> 0.44.1, 0.44.1-man

I think it might relate to this Hyprland issue, where people conclude that latest main of swww works. There's a lot of unreleased commits in main right now.

I don't care enough about this problem right now to switch to a from-source version of swww, but these are the breadcrumbs I found. Maybe it will be helpful to someone. :-)

@vantroy
Copy link

vantroy commented Jan 16, 2025

Adding to the above, I Just installed swww yesterday and had the same issue, in addition to other vertical monitors strange behaviours. Replacing the swww package -- which seems stale -- with swww-git fixed it for me.

@kRHYME7
Copy link

kRHYME7 commented Feb 11, 2025

#398 petition hehe 😁

@eureka-cpu
Copy link

eureka-cpu commented Mar 31, 2025

I am also running into this issue. I have a 1920x1080 that I have configured to be portrait on hyprland. My first monitor is fine, but my portrait monitor has the background centered instead of filling the whole screen.

$ swww --version                                                                                                                                  [20:38:56]
swww 0.9.5

EDIT: I was able to fix this by using master instead: https://github.com/eureka-cpu/dotfiles/blob/249ddd76464cf94de462f06a8e2e41ec9fe3c24d/flake.nix#L11

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

No branches or pull requests

5 participants