HiDPI on Linux

I’m in the process of switching from Mac to Ubuntu and I want to continue to use Xojo to develop with. My development laptop is HiDPI and that has proven to be a pain in the rear for many reasons on Linux (not least because the Xojo IDE is not HiDPI friendly on Linux - I have to half my screen resolution to use it).

Whilst I’m not asking Xojo to make the IDE HiDPI aware (as that would be dreaming!) I would like to know if there’s anything I can do to make sure the apps I develop in Xojo scale properly on Linux and look legible when the desktop manager scales stuff. Obviously this is possibly as plenty of apps look fine in an HiDPI environment in Linux.

Any advice would be great.

Do you know you can run Ubuntu on a Mac ?

Yep. I know. Trying to move completely away from the Apple ecosystem. I’m actually running Ubuntu on a Retina screen.

Gary:

so you have a know machine with Retina / HiDPI to test Ubuntu.

Garry, maybe this is what you are after:
http://www.pcworld.com/article/2911509/how-to-make-linuxs-desktop-look-good-on-high-resolution-displays.html

Thanks Andre. That’s a useful link. I think part of the problem is that Xojo uses GTK 2 whereas “proper” HiDPI support didn’t arrive until GTK3. I’ve no idea if or when Xojo will migrate to GTK3

This seems like a reasonable feature request, especially after macOS and Windows have Retina/HIDPI support.

I’ve been wrestling with HIDPI on Linux, and the solution I’ve found is to query the resolution of the default screen. Then adjust the window layout accordingly.
Seems like the native controls adjust their fonts as they should, but Xojo doesn’t use the packing mechanisms that most Linux apps use.
You can also connect to the notify::resolution signal of the default screen to react to changes. It gets tricky… I have a class that I can share if you like.

[quote=296970:@jim mckay]I’ve been wrestling with HIDPI on Linux, and the solution I’ve found is to query the resolution of the default screen. Then adjust the window layout accordingly.
Seems like the native controls adjust their fonts as they should, but Xojo doesn’t use the packing mechanisms that most Linux apps use.
You can also connect to the notify::resolution signal of the default screen to react to changes. It gets tricky… I have a class that I can share if you like.[/quote]
I’d be really interested if you’re willing to share. I only develop for a hobby and would live to continue to use Xojo whilst on this Linux journey (as there really doesn’t seem to be anything close to Xojo for Linux).

I’m curious what the motivation for this is

@Norman Palardy I’ve been an Apple fanboy for years and years but recently I’ve gotten quite disheartened with where they’re going with their desktop OS.

I really dislike how they’ve neglected the nerdy/geeky people out there who use their hardware for macOS (take not updating the Mac Pro/Mac mini for > 3 years). The recent update to the MacBook Pro was also disappointing primarily because of the big price hike for not much more power. In fact, I was ready to pull the trigger on a new MBP (I currently have a 4 year old one) but I can’t justify what they’re asking for (the weak British pound doesn’t help!).

My motivation for switching to Linux instead of Windows is mainly because I just don’t like Windows from a UI point of view. I also don’t like the constant popups and the number of viruses.

I realise that Linux is far from perfect (trust me, I’m discovering that right now!) but I’m giving it a fair try. I’ve certainly found replacements for most things on the Mac. Those that I can’t replace are giving me inspiration for app ideas to try to make using Xojo (for fun rather than to make money). Of course, that’s dependent on me being able to use Xojo on Linux.

I’m probably going to write a blog post about this soon but trying to use Xojo on Linux has been a taxing experience. Getting it running on a 64-bit distort was fiddly but not too taxing (yes I know that Xojo recommends 32-bit distros but quite frankly, that’s not acceptable as lots of hardware issues exist in 32-bit that are fixed in 64-bit). It looks like the Xojo IDE will be 64-bit early next year (I hope) which will remove that road block.

The biggest pain in the butt is using Xojo on a HiDPI display. Unless I drop my resolution in half, it’s pretty unusable if you’re not used to it. Granted, the user can increase the size of the fonts in the code editor but the IDE UI itself is very difficult to navigate. I also have big concerns about the fact Xojo seems to be built on GTK2 which (I think) will never properly support HiDPI. Makes me thinks building apps for modern Linux is going to be very difficult with Xojo.

I will give Xojo credit though, there really is nothing else out there on Linux that’s (in principle) as easy to use as Xojo. If only it worked on Linux as it does on Mac and Windows.

I have to agree with a lot of @Garry Pettet’s comments here. Luckily, my existing i7 rMBP was maxed out when I bought it and is still quite capable for my personal needs. It’s also on performance par with my Mac Pro canister when I use an external monitor and lock out the built in Intel graphics.

However, it may be the luck of the draw, but I am not running into the performance difficulties under Linux on a properly configured i7 development system that others report. Granted, I’ve not stepped up to 16r4b10 yet, and I’ve made sure that I’m running proven hardware that works with the 32 bit 3.10 kernel, but 13r3.3 and 16r3 both run well for me. Also, i’m still using standard 1920x1080 display resolution, so I’ve not run into a HiDPI situation with Linux.

I do hope that we see an update to GTK-3 for a coming version of Xojo, but it’s not limiting my efforts at this time.

Some of this isn’t in Apple’s control
That the Pound dropped like a stone after Brexit isn’t their doing - it hasn’t recovered that much yet.
Apple basically seem to price in USD & convert it to CDN $, Euros, Pounds etc.
We have the same price inflation. The CDN $ used to be close to par with the US$ and is now 30% less so our prices are inflated now.

That the power is “about the same” has a lot to do with Intel not shipped Kaby Lake processors that Apple needs.
So either Apple does nothing, which we’d slam them for, or they update it to what they can, for which we slam them :slight_smile:
Damned if they do or don’t

The mini, iMac and Pro not getting updates, yet, was surprising and disappointing but doesn’t affect me except to make me disappointed they didn’t.

Certainly not disappointed enough to want to move to any Linux distro I’ve worked with so far.
And most definitely not Ubuntu.
Out of all the ones we do work with its my least favourite especially with Unity installed.

FWIW, I’ve found Linux Mint 18 64-bit works quite well with Xojo, not that it will help you with HiDPI as that requires us to switch Xojo to use GTK3. Maybe a non-HiDPI VM from within Linux might be an option for running Xojo on HiDPI setups?

Here’s the current state of things…
http://www.pidog.com/share/resNotifier.xojo_binary_project
It’s adapted from my RetinaNotifier Class for Mac and still includes the now unneeded code.

I’m just curious, but what does GTK3 have that’s missing in 2 (regarding HIDPI?

It looks like just a matter of updating the window layout to reflect the size/position of the widgets… All the native widgets scale properly, just the layouts need adjusting for the scaleFactor.

(Not that I would complain about a switch to GTK3)

Or is there a whole other side to HIDPI on Linux that I’m unaware of?

If I get the time, I might add screen checking since you can set a different scalingFactor for each display if you choose to (at least under Ubuntu).

Norman,

I do not use Ubuntu on a regular basis, but was quite surprised to see how well it uses the screen estate of my UHD-screen,
when connected to my new laptop, out of the box. Proportions look right and text is readable and crisp.
On Windows 10, I still did not manage, after months, to get these results for my desktop pc. Also, dual screen usage is
enabled by default on Linux.

WiFI was detected correctly instantaneously. My older Windows 10 laptop became almost useless after an intermediate update that made WiFi (and thus printing) impossible; a solution came only months later, when I already purchased a new notebook.
(I will use the old one now for installing eCS).

My small XoJo-projects, including one with an encrypted sqlite-db, run without any problems on Linux, either from the IDE or as a standalone application. And when debugging, the seconds screen (notebook) is used for the debuggee by default !
The IDE looks quite good too.

I was especially impressed with printer installation in Ubuntu. I could choose my HP-printer directly from a menu (it had been correctly detected as a WiFi printer) and worked within 15 seconds (no kidding !).

Compare that to the situation on Windows 10, where the complete HP-driver package had to be renewed/reinstalled three times in the last 14 months (keeps the HP people from the street, thanx Bill …). And then one is still lucky that it is not a Canon printer; if you feel depressed, view the wonderful video by Cynthia Beaumont, showing only PART of the disaster of the installation process, which I remember from my own experience when helping my sister’s friend, a year after the production of the video (!)
https://www.youtube.com/watch?v=RH2wwmBdjw4