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

Displays overlap #3

Open
alanorth opened this issue Mar 23, 2022 · 5 comments
Open

Displays overlap #3

alanorth opened this issue Mar 23, 2022 · 5 comments

Comments

@alanorth
Copy link

I have an internal display (eDP-1) and an external display (DP-5). Both displays are 1920x1080 with scale 1.33. When I snap them together in nwg-displays the positions are incorrect and there is a slight overlap that causes the mouse pointer to be mirrored on both displays temporarily before jumping to the next screen when it reaches the edge.

First display is DP-5, which starts at position 0,0:

2022-03-23T16:01:34,334635825+03:00-fs8

Second display is eDP-1, which starts at 1086,0 when I snap it to DP-5:

2022-03-23T16:10:34,403356356+03:00-fs8

If I manually drag eDP-5 to 1445,0 the transition between displays works as expected.
2022-03-23T16:02:30,386353292+03:00-fs8

I guess this is a problem with the fractional scaling math? I am using nwg-displays 0.1.2 on Arch Linux and Sway 1.7. Thank you!

@nwg-piotr
Copy link
Owner

I guess this is a problem with the fractional scaling math?

For sure, and it may be difficult to reproduce on my hardware. Did you try using a view scale other than 0.3?

@alanorth
Copy link
Author

The largest view scale I can use is 0.5, and even then the situation is weird. Here the external display (DP-5) is 1445x813 at position 0,0:

2022-03-24T09:07:11,376967980+03:00-fs8

And here the internal display (eDP-1) is 1920x1080 (despite me setting the scale, hmm) at position 1434,0 but at the edge of the window so I can't even move it further.

2022-03-24T09:07:22,890332102+03:00-fs8

With fractional scaling of the display sizes the snapping of displays is totally unreliable. It seems you must set the positions manually.

@nwg-piotr
Copy link
Owner

Does it work well on wdisplays?

@nwg-piotr
Copy link
Owner

Also: I experimented quite a lot by changing scaling on a two-headed setup (1366x768 + 1920x1080) and I could not reproduce the issue. :(

@alanorth
Copy link
Author

It works well on wdisplays. Here are the same two displays as I tested with above, both 1920x1080 at 1.33 scale. When I drag the right one to snap to the left one the resulting positions are correct.

First, the external display at position 0,0:

2022-03-25T09:21:29,562030773+03:00-fs8

Then the internal display at position 1445,0:

2022-03-25T09:21:46,895751545+03:00-fs8

So the x position of 1145 seems to be:

1080 / 1.33 == 1443.60, rounded up to nearest integer 1444 + 1 == 1445

I note that snapping in nwg-displays gives me an x position of 1446 though!

And I just realized that this snapping bug only happens if you don't set the resolution using the "Modes" dropdown! So even though nwg-displays knows the "Size" (resolution) of the current display, unless you select the mode from the dropdown it will calculate the snapping math incorrectly.

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

2 participants