Re: [code] [textadept] retina displays

From: John Benediktsson <>
Date: Wed, 3 Apr 2013 09:00:32 -0700

> Giving that retina displays are awfully recent, it would be a step
> backwards in technology if they didn't include any kind of detection that
> could be done like that. I'm sure there must be a file, someone should get
> in touch with Mac developers, one of them might know.

True, and Gtk-OSX supports it in the quartz backend (as does
ScintillaCocoa), if you want to see what people do, here's an example[1]
from Chromium:

loat GetScaleFactorScaleForNativeView(gfx::NativeView view) { if
(NSWindow* window = [view window]) { if ([window
respondsToSelector:@selector(backingScaleFactor)]) return [window
backingScaleFactor]; return [window userSpaceScaleFactor]; }
NSArray* screens = [NSScreen screens]; if (![screens count])
return 1.0f; NSScreen* screen = [screens objectAtIndex:0]; if
([screen respondsToSelector:@selector(backingScaleFactor)]) return
[screen backingScaleFactor]; return [screen userSpaceScaleFactor];}
You can see it is on a per-window basis, not per-application, and it
supports the deprecated "userSpaceScaleFactor" as well as
"backingScaleFactor". The question that is difficult is detecting it
a) from Lua, and b) once per-application (which isn't the right way to
do it).

You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 03 Apr 2013 - 12:00:32 EDT

This archive was generated by hypermail 2.2.0 : Thu 04 Apr 2013 - 06:36:21 EDT