Hi-DPI support for Cinnamon
by mtwebster 27

Thanks to a generous donation a couple months ago, we’ve been able to target hi-dpi (or Retina) displays for support in the next Cinnamon release.

The changes are largely complete, and live on the ‘hidpi’ branch of a number of Cinnamon repositories.  They are:

  • cinnamon
  • muffin
  • cinnamon-settings-daemon
  • cinnamon-desktop
  • nemo

We would welcome anyone who wishes to test this out (and hopefully report back anything that’s been missed in the process.)

The requirements are:

  • Gtk 3.10+
  • a laptop or display that rates as hi-dpi (this is not necessarily a high pixel count, but the actual density of the pixels to the size of the display.)

For Mint/Ubuntu users, unfortunately you’re restricted to using an up-to-date Ubuntu Trusty for now.  Most other, more ‘pure’ distributions like Fedora, Arch, can likely use these branches in their current system as long as they’re on Gtk 3.10 or higher.  Note, if you’re not sure, or things don’t seem to be working as they should, check your cairo version – you’ll need a snapshot version (like 1.13 shipped in Fedora) with a Gtk built against that or else you won’t have full support.

Known issues:

  • On certain Cinnamon themes, the menu icon can be the wrong size.  Still looking into this.
  • MDM does not support hidpi yet – it works, it will just be tiny.
  • Changing the scale during a session, or changing the display resolution will cause some ugliness – recommended that you restart/logout-back in after setting a custom scale.
  • Window manager buttons (close, minimize, etc..) are unscaled right now – still working on this.

Features/Noteworthy items:

  • At the start of a Cinnamon session, the settings daemon does some calculation and tries to set the correct scaling value for you… no other intervention or setting should be required.  You can manually select a scale using the selector in Cinnamon Settings->General.  Usually it should be left at Auto.
  • Cinnamon settings panel icons are now themeable:  Icon sets can now override the icons for each of the cinnamon-settings panels, as well as their display in the menu.
  • For applet/desklet/extension developers, you generally should be able to use your applets un-modified – they should just work, regardless of scale.  However, in certain cases, where you may be doing some drawing or allocations based on screen size, you can access global.ui_scale to get the current scale (will be an integer, 1 or 2) and modify your math accordingly.  Checkout the stock menu applet to see an example of where that’s been used.
  • Cinnamon themers: Your themes should work as is, without modification.  All theme elements, pixel sizes, etc.. are scaled automatically.
  • Gtk themers:  There are a lot of changes to absorb, not the least of which is supplying double-scale resources for various widgets.  I would recommend checking out https://git.gnome.org/browse/gnome-themes-standard/log/?qt=grep&q=hidpi to get an idea of what’s involved.  Themes will work ok unmodified, but widgets will have weird sizes, things may be pixelated, etc.. Not the end of the world, but not pretty either.
  • Gtk2 apps only appear to scale their text, not their icons.  So, while they work fine, they don’t look great.  Same with QT apps.  I’m not knowledgeable enough to speak on how to address this right now.
  • There is only one scale factor for the desktop – I’ve not tested this in a multi-monitor configuration, but I can say that if they’re not both the same DPI (or close) monitors, then one will look good, and the other bad.  As far as I know right now this is a limitation in x-server.

So anyhow, I know hi-dpi tech is still relatively new, but more and more laptops are coming out with this, and we want to ensure support.  If anyone out there with one of these new devices wants to give Cinnamon a spin, we would welcome any feedback or criticism.  I know personally I don’t use every single feature in Cinnamon, so there are likely areas that I’ve overlooked.

Enjoy!

27 thoughts on “Hi-DPI support for Cinnamon

  1. Reply Sam Burgos Mar 5,2014 17:48

    Looks nice the new feature indeed. One offtopic question if I may: Is there any posibility to include an option like “show the taskbar on all displays” in Cinnamon? (leaving a couple of screenshots just in case)

    -> http://alturl.com/qti6b
    -> http://alturl.com/w42u2

    For the rest, keep going the great job (Y). Cheers

  2. Reply RexCortex Mar 5,2014 21:34

    Incredible, when mtwebster said they were interested in Hi-DPI support I didn’t think it would happen so fast! Did you benefit from the recent Gnome support?

    So no possibility to compile this on Mint 16 yet?

    Congratulations on this!

    • Reply mtwebster Mar 5,2014 21:52

      It was very helpful to look at what gnome-shell did, and how they did it – much of the base for this was from their work.

      It will likely never be able to run on Mint 16. For Cinnamon 2.2 we’re basically targeting only the new LTS (trusty/mint 17) – there are too many changes and requirements to be able to backport it cleanly, but with it being an LTS release, we felt this was an appropriate time to focus just on the new version.

      It’s possible if the Gnome Next PPA gets updated with required changes, that Mint 16 could conceivably support it, but I wouldn’t count on it.

      As a result of all this, once this hidpi code gets merged, PPA nightlies will be effectively over for all but Trusty builds.

  3. Reply Roelof Wobben Mar 8,2014 09:45

    Is there any date known when Cinnamon 2.2 wil be released.
    Then I can make plans how to make it aviable on my own distro.

    Roelof

  4. Reply Michael Schaller Mar 8,2014 12:07

    Mike, thank you for working on this!

    Btw… Will we be able to select the scale factor manually with the Displays tool, like on Mac OS X?
    (http://9to5mac.com/2014/03/06/apple-building-support-for-driving-4k-displays-at-retina-resolution-60hz-output-from-2013-macbook-pros/)

  5. Reply JosephM Mar 15,2014 22:03

    Be aware that most of the gtk themes that are available on sites such deviantart or gnome-look currently have no proper support for hi-dpi. I would imagine once ubuntu trusty is out you will see a lot more of these add support since it requires gtk3.10 and those themes will be broken with anything earlier.

  6. Reply HX_unbanned Mar 19,2014 07:43

    What could be most optimistic time to have this usable in Linux Mint 1x x86_64 with Cinnamon ?

  7. Reply Chris Mar 21,2014 08:38

    This sounds great! As someone who’s just finished peeling the plastic of their new Dell XSP 15, HiDPI support sounds perfect, however it’s been many a year since I’ve properly dived under the hood of linux, could you give a reverted-to-noob some pointers on using these repos? Will just replacing the repo’s work to get these features running? Are there some other threads / articles kicking around?

  8. Reply Patrick Mar 22,2014 19:15

    Agreed – this sounds great! Can’t wait to try it out once Mint 17 has been released.

    I’m currently using a Dell M3800 with a 3200×1800 screen, and recently I’ve tried different distros with different DEs. The result on most of these is truly painful (even Gnome 3.10), but based on these news I’ve settled on Mint 16 with Cinnamon 2 which actually already works pretty well with some tweaking.

    Keep up the good work!

  9. Reply Warren Mar 27,2014 15:17

    This sounds great – I’m looking at get a high DPI laptop soon, and will probably move to Mint 17 with Cinnamon on it.

    One question – I have an external 30″ monitor that is normal DPI – 2560×1600 at 30″. Will these changes be smart enough to adjust font and icon sizes appropriately as I drag windows between the two monitors?

    • Reply mtwebster Mar 27,2014 15:44

      Unfortunately, hi-dpi mode is global across all your displays (this is an X restriction, not Cinnamon) – so having a hidpi screen and a non-hidpi screen will result in either one or the other not looking good, depending on what mode you’re in.

      Note I haven’t been able to verify this, as I don’t have a second monitor right now.

      • Reply Warren Mar 27,2014 20:49

        That’s what I was afraid of. :-( I’ve seen color management changes kick-in depending on which monitor a window is on – so I was kinda hoping the same thing could happen here… but I will admit it was a somewhat dim hope…

        Once I get a new laptop and Mint17 I’ll see how it looks – Hopefully I can find a middle ground where things are a little bit too small on the HiDPI screen, and a little too big on the external — but not annoyingly big or small on either…

  10. Reply Anand Mar 27,2014 18:07

    Am just curious here – Any idea whether the proposed Xorg-replacement Wayland has plans to address this case?

    • Reply mtwebster Mar 27,2014 21:16

      I believe it does allow individual scales for each monitor, but I can’t say for certain – it’s just what I’ve picked up here and there. I don’t currently follow wayland development other than lurking on various irc channels.

  11. Reply Anand Mar 28,2014 12:09

    Okies. Thanks for replying. :-)

  12. Reply mrman Apr 10,2014 14:12

    Hi Clem & the gang.

    I was wondering if 21:9 support was being thought about in general? There are a lot of 21:9 monitors and TV’s on the horizon, nearly all are 1440p or 5k Hi-DPi models.

    Will windows snapping, Scaling and login screens work well for 21:9 ? Also could you start to include some 21:9 Wider-screen wallpapers please?

    Thanks

    mr man

    • Reply mtwebster Apr 10,2014 14:51

      I’m not sure these would qualify as hidpi – the determination takes into account (or tries to) monitor size as well as number of pixels, so generally a 4k tv wouldn’t be considered hidpi, as it’s so large as to negate the advantages of high pixel density. And, regarding the 21:9, I believe currently, both horizontal and vertical need to qualify as hidpi in order for the system to switch.

      Note if you don’t agree with the system’s calculation you can easily override it in cinnamon settings.

  13. Reply Stefan Apr 10,2014 14:27

    Hopefully I can use this together with Mint 17 on my new Chromebook Pixel :) I am about to buy one in the next few weeks.

  14. Reply lestcape Apr 12,2014 09:13

    Hi, excellent work, congratulation… I have only one question…. We have a way to know without Hi-DPI support if some applets or desklets are displayed correctly?

    One could making a small summary of the cases where it is necessary to include the scale and where not?

  15. Reply David Jun 16,2014 23:37

    I’m using the new hi-DPI mode! It seems to be great…except with specific apps – Chromium, for example. It doesn’t scale properly (all the icons are 1/2 as big as they should be). Is there a fix?

    • Reply mtwebster Jun 16,2014 23:56

      Hi,

      Unfortunately, for the time being, older apps, or those built on an old toolkit (gtk2) as well as apps that use the QT toolkit, do not fully support hidpi – you’ll notice their windows open half-sized (well, quarter really), only the text is scaled, but the icons are tiny.

      Browsers are also in this category to a certain extent. With chrome, about all you can do currently is change the default zoom level (in advanced settings) to 200%. I would avoid chromium right now – they are working on a new back end for it, and it’s in very rough shape in hidpi mode.

      Firefox you have a better option, in about:config you can set layout.css.devPixelsPerPx to 2.0, and get a pretty good experience.

      All of this really is waiting for these apps to catch up, there’s not much we can do at this point.

  16. Reply mrman Jul 13,2014 16:58

    wish there was an option for 1.5x rather than 2x

    2x is too big but looks nice on my 1080p monitor. Of course this is for 1440p or 4k monitors but i actually really like the larger icons and themes / fonts. It makes it easier for an old man like me to read stuff ..

    any chance you could feature a slider? 1.2 – 1.3 – 1.4 -1.5 etc.. to 2.5x ?

    thanks

  17. Reply Chris Aug 2,2014 13:35

    Hi,
    can only agree to the slider option. 1.0x is too small, 2.0x is too big.
    Any way I can set this in a config file until there is a slider?

    Regards
    Chris

  18. Reply Christian Aug 2,2014 13:43

    In absence of the slider, is there a way to set it manually in some config file?

Leave a Reply