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

Xwayland screen and get_outputs have different sizes when using scale. #4877

Closed
jameswalmsley opened this issue Jan 4, 2020 · 2 comments
Closed

Comments

@jameswalmsley
Copy link

Overview

When setting some output scales, the sway rect and the Xwayland screen
have different sizes:

E.g. for my 2560x1440 resolution screen at 1.4 scale.

$ swaymsg -t get_outputs | jq -r '.[] | select(.focused).rect'
{
  "x": 0,
  "y": 0,
  "width": 1828,
  "height": 1028
}

$ xrandr
Screen 0: minimum 16 x 16, current 1828 x 1028, maximum 32767 x 32767
XWAYLAND0 connected 1824x1028+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1824x1028     59.92*+

XWAYLAND0 width of 1824 when it should be 1828.

Other scales will create a matching size.

Is there a way to get the Xwayland screen ID of an output?

Git-sha's

wayland 1.17.0-43-ge7d88f3
wayland-protocols 1.18-6-g733de76
xwayland xorg-server-1.20.0-569-gb1ee4036b
wlroots 0.9.0-1-g5bbb4448
sway 1.2-rc1-162-g1e44247b

@jameswalmsley
Copy link
Author

Further Findings

When using kanshi:

# Thinkpad Carbon X1 6th Gen - Alone.
{
	output "Unknown 0x2036 0x00000000" mode 2560x1440 position 0,0 scale 1.333333
	exec swaymsg output \"Unknown 0x2036 0x00000000\" scale_filter linear
}
$ swaymsg -t get_outputs | jq -r '.[] | select(.focused).rect'
{
  "x": 0,
  "y": 0,
  "width": 1921,
  "height": 1081
}

$ swaymsg output eDP-1 scale 1.333333
$ swaymsg -t get_outputs | jq -r '.[] | select(.focused).rect'
{
  "x": 0,
  "y": 0,
  "width": 1920,
  "height": 1080
}

Adding an exec line to kanshi works:

# Thinkpad Carbon X1 6th Gen - Alone.
{
	output "Unknown 0x2036 0x00000000" mode 2560x1440 position 0,0 scale 1.333333
	exec swaymsg output \"Unknown 0x2036 0x00000000\" scale_filter linear
	exec swaymsg output \"Unknown 0x2036 0x00000000\" scale 1.333333
}

Why is there a difference between kanshi, and a direct swaymsg? Numerical precision?

This fixes my case of 1.333... but not for e.g. 1.4.

@jameswalmsley
Copy link
Author

Using issue #4896 for investigating the kanshi vs swaymsg difference.
Will look a bit deeper at why Xwayland and wlr have different rect sizes.

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

No branches or pull requests

1 participant