{"id":3523,"date":"2019-10-21T10:00:11","date_gmt":"2019-10-21T15:00:11","guid":{"rendered":"https:\/\/www.foell.org\/justin\/?p=3523"},"modified":"2022-08-18T16:25:06","modified_gmt":"2022-08-18T21:25:06","slug":"simple-hidpi-monitor-scaling-with-wayland-in-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.foell.org\/justin\/simple-hidpi-monitor-scaling-with-wayland-in-ubuntu-18-04\/","title":{"rendered":"Simple HiDPI Monitor Scaling with Wayland in Ubuntu 18.04"},"content":{"rendered":"<p><a href=\"https:\/\/webdevstudios.com\/\">My company<\/a> helped me purchase a new <a href=\"https:\/\/www.foell.org\/justin\/dell-7390-xps-13-developer-edition-laptop\/\">Dell 7390 XPS 13 Developer Edition<\/a>. The biggest hurdle I had when setting it up was getting my external monitor to work correctly. It&#8217;s a standard HD monitor (1920&#215;1080), and the laptop screen is 4K (3840&#215;2160) &#8211; known as a &#8220;HiDPI&#8221; monitor because while it&#8217;s run at 3840&#215;2160 it&#8217;s scaled 200% so actual humans can read the fonts.<\/p>\n<p>This presented a problem because the scaling was affecting the external monitor &#8211; it was appearing as if the resolution was half of HD &#8211; 960&#215;540. <a href=\"https:\/\/www.teoalida.com\/database\/screenresolution\/\">Hello 1990s!<\/a><\/p>\n<p><!--more--><\/p>\n<h2>X Scaling Problems<\/h2>\n<p>So I turned off the external monitor, but some applications still weren&#8217;t scaling right on the 4K (200% scaled) laptop screen. I began to experiment with <a href=\"https:\/\/wiki.archlinux.org\/index.php\/HiDPI#Applications\">individual application scaling factors<\/a> like <code>QT_DEVICE_PIXEL_RATIO=1<\/code> for QT applications such as VLC and Zoom, and <code>--force-device-scale-factor=2<\/code> for Spotify.<\/p>\n<p>It was fine for a week but I really missed my 2nd monitor, so I invested some <a href=\"https:\/\/blog.summercat.com\/configuring-mixed-dpi-monitors-with-xrandr.html\">time getting to know xrandr, trying to get things working<\/a>. While doing so, I bumped into other issues using xrandr like:<\/p>\n<blockquote><p><code>xrandr: screen cannot be larger than 8192x8192<\/code><\/p><\/blockquote>\n<p>Then I found some chatter about Wayland and its ability to handle scaling <em>automagically<\/em>.<\/p>\n<h2>Wayland: Scaling the Easy Way<\/h2>\n<p>First, WTF is Wayland? It&#8217;s a <a href=\"https:\/\/www.secjuice.com\/wayland-vs-xorg\/\">next-generation X server that replaces Xorg<\/a>. It was apparently included as default with Ubuntu 17.10 (which I skipped because I was on LTS). Then because it was deemed to not be ready for LTS prime-time, it was installed on 18.04 but Xorg became the default again.<\/p>\n<p>So how do you switch? Easy, before you log in, just click the gear icon and select &#8220;Ubuntu on Wayland.&#8221;<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland.jpg\" rel=\"gallery-3523\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3530\" data-permalink=\"https:\/\/www.foell.org\/justin\/simple-hidpi-monitor-scaling-with-wayland-in-ubuntu-18-04\/ubuntu-on-wayland\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland.jpg\" data-orig-size=\"4032,3024\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 7&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1571237347&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;3.99&quot;,&quot;iso&quot;:&quot;80&quot;,&quot;shutter_speed&quot;:&quot;0.14285714285714&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"Ubuntu on Wayland\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland-1024x768.jpg\" class=\"alignnone size-large wp-image-3530\" src=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland-1024x768.jpg\" alt=\"\" width=\"770\" height=\"578\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland-1024x768.jpg 1024w, https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland-300x225.jpg 300w, https:\/\/www.foell.org\/justin\/files\/2019\/10\/Ubuntu-on-Wayland-768x576.jpg 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a><\/p>\n<p>After logging in, enable gnome&#8217;s &#8220;experimental&#8221; per-monitor scaling, by runing this command in a terminal:<\/p>\n<blockquote><p><code>gsettings set org.gnome.mutter experimental-features \"['scale-monitor-framebuffer']\"<\/code><\/p><\/blockquote>\n<p>Here&#8217;s the conversation on reddit I found regarding these settings:<\/p>\n<div class=\"reddit-embed\" data-embed-media=\"www.redditmedia.com\" data-embed-parent=\"false\" data-embed-live=\"false\" data-embed-uuid=\"534073f2-f04d-11e9-b22c-0e9c3d3a7942\" data-embed-created=\"2019-10-16T19:44:11.102597+00:00\"><a href=\"https:\/\/www.reddit.com\/r\/gnome\/comments\/avlhi9\/dual_monitor_scaling_one_hidpi_and_the_other_not\/ehi7p9m\/\">Comment<\/a> from discussion <a href=\"https:\/\/www.reddit.com\/r\/gnome\/comments\/avlhi9\/dual_monitor_scaling_one_hidpi_and_the_other_not\/\">gitfeh&#8217;s comment from discussion &quot;Dual monitor scaling one HiDPI and the other not&quot;<\/a>.<\/div>\n<p><script async src=\"https:\/\/www.redditstatic.com\/comment-embed.js\"><\/script><\/p>\n<p>After logging out and logging back in (or rebooting), you should be able to select the scaling of your external monitor through the normal Settings -&gt; Devices -&gt; Displays configuration. Now the scaling for the external monitor will <em>actually work<\/em>:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling.png\" rel=\"gallery-3523\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3526\" data-permalink=\"https:\/\/www.foell.org\/justin\/simple-hidpi-monitor-scaling-with-wayland-in-ubuntu-18-04\/externalmonitorscaling\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling.png\" data-orig-size=\"1983,1443\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ExternalMonitorScaling\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling-1024x745.png\" class=\"alignnone size-large wp-image-3526\" src=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling-1024x745.png\" alt=\"\" width=\"770\" height=\"560\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling-1024x745.png 1024w, https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling-300x218.png 300w, https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling-768x559.png 768w, https:\/\/www.foell.org\/justin\/files\/2019\/10\/ExternalMonitorScaling.png 1983w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a><\/p>\n<p>With Wayland you can get rid of the per-application scaling settings because it handles them automatically. I&#8217;m relieved to have found a simple solution to this problem, hopefully it helps you too!<\/p>\n<div class='kindleWidget kindleLight' ><img decoding=\"async\" src=\"https:\/\/www.foell.org\/justin\/wp-content\/plugins\/send-to-kindle\/media\/white-15.png\" \/><span>Send to Kindle<\/span><\/div>","protected":false},"excerpt":{"rendered":"<p>My company helped me purchase a new Dell 7390 XPS 13 Developer Edition. The biggest hurdle I had when setting it up was getting my external monitor to work correctly. It&#8217;s a standard HD monitor (1920&#215;1080), and the laptop screen is 4K (3840&#215;2160) &#8211; known as a &#8220;HiDPI&#8221; monitor because while it&#8217;s run at 3840&#215;2160&hellip; <a href=\"https:\/\/www.foell.org\/justin\/simple-hidpi-monitor-scaling-with-wayland-in-ubuntu-18-04\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Simple HiDPI per-monitor scaling with Wayland in Ubuntu 18.04","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,8],"tags":[164,165,166,190,168],"class_list":["post-3523","post","type-post","status-publish","format-standard","hentry","category-business","category-ubuntu","tag-dell","tag-gnome","tag-linux","tag-wayland","tag-xps13"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/3523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/comments?post=3523"}],"version-history":[{"count":9,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/3523\/revisions"}],"predecessor-version":[{"id":3546,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/3523\/revisions\/3546"}],"wp:attachment":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/media?parent=3523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/categories?post=3523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/tags?post=3523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}