xrandr 双显示器缩放问题

xrandr 双显示器缩放问题

我想将装有 Ubuntu 16.04 的 2560x1600 13 英寸(16:10)MacBook 连接到外部 21 英寸 1920x1080(16:9)显示器,并使其能够进行缩放。

我的 MacBook 上的所有东西都缩放得很完美,其像素比 1920x1080 屏幕高出 33%(忽略 16:9 到 16:10 转换的差异)。因此,我尝试将外接显示器缩放到 2560x1440,缩放比例为 33%。

xrandr --output HDMI2 --scale 1.3333x1.3333 --panning 2560x1440

这会在外部创建一个 2560x1440 的桌面,但我一次只能查看 1920x1080。这是一种缩放效果,通过将光标移动到屏幕边缘,我可以查看的区域就会移动。

我也尝试过不平移,但结果显示器的一部分未被使用(黑色),并且限制了我的鼠标在那里移动。

我正在运行 Ubuntu 16.04、Unity 和 Compiz。我的 GPU 是 Mesa DRI Intel(R) Haswell,因此没有独立的 AMD 或 NVIDIA 卡。

答案1

我遇到了类似的问题并通过这种方式解决了。

我有一个外置大屏幕 24 英寸 3840x2160 和一台笔记本电脑,分辨率相同 3840x2160,但屏幕较小 15.4 英寸

我希望笔记本电脑屏幕能够放大,因为默认缩放比例太小。缩小会导致屏幕模糊,解决方案是使用 xrandr 将所有内容放大,然后使用 gnome 缩放因子:

操作方法如下(笔记本电脑屏幕上方的外部屏幕,但如果您更改 pos 参数,则可以按不同的方式排列)

xrandr --output DP-0 --primary --mode 3840x2160  --pos 0x0 --scale 2x2  --rotate normal --output DP-2 --mode 3840x2160 --pos 0x4320 --scale 1x1  --rotate normal --output DP-1 --off

解释:

--output : DP-1 is the external screen, DP-2 is the laptop screen (use xrandr -q to get your devices names)
--mode : both screen have same definitions 3840x2160
--scale 2x2 for external, 1x1 for laptop, this is "relative" to the primary which is external screen here..
--pos : external screen is at position 0x0, laptop screen is bellow at pos 0x(2160*2)=0x4320 because external screen is scalled by 2

然后

gsettings set org.gnome.desktop.interface scaling-factor 2

或者

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"

在此处输入图片描述

答案2

对我有用的解决方案是dconf设置比例因子,正如 Malte Skoruppa 所解释的

也就是说,运行dconf read /com/ubuntu/user-interface/scale-factor以获取显示器的名称和当前比例因子值。结果可能类似于{'eDP-1': 8, 'HDMI2': 8}

要稍微放大 HDMI2 屏幕,您可以运行:

dconf write /com/ubuntu/user-interface/scale-factor "{'eDP-1': 8, 'HDMI2': 9}"

请注意,GUI 中的比例因子是 dconf 中值的 1/8,因此 8 表示 1 倍缩放,9 表示 1.125 倍,等等。

相关内容