-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HiDPI / Retina Display Support #126
Comments
afaiu Cairo on OSX, it asks for a Quartz surface and uses this. I'd guess the resolution is already decided in the initilisation of the Tk window. |
The reason I think it's something to do with surface creation is that a TreeView, for example, does use native size pixels. I've tried looking through the Canvas creation sequence in Tk.jl and Cairo.jl as well as digging a bit in the Tk sources, but it's all convoluted enough that I failed to find out where things go awry, so far. In the meantime, I'm trying to bring up a native window with a Quartz drawable via Julia's FFI to figure out how to do it, but that's still in progress. |
So, drawing into a plain NSView via overriding -drawRect: with the Julia FFI and objc runtime yields correct drawing results, eg. the drawable has a HiDPI resolution without having to do any special setup to get that. So where in the setup process of the Cairo Canvas is the error? |
Could you please spend a few lines, what you want to do and how this looks in code? |
I would try with a GTK or Qt window and see whether the issue persists. Tk isn't the most actively developed toolkit around. |
The Gtk.jl Canvas provides double-buffering via drawing to an image (pixel) surface by default and i fear we see the same problem. But this default can be bypassed and the underlying rendering stage can be accessed. |
Unfortunately, I haven't done anything with Tk/Gtk/Qt outside of Julia, so I've not the faintest clue how a HiDPI option should be passed. I know Tk is the old dog of the bunch, but it was the only one I could get working mostly right on short notice. |
It seems like creating a simple Cairo surface in a Tk window (as in the Tk examples) doesn't use native pixels on a scaled display (in my case a Retina MacBook with OS X 10.10).
Is there some way to a) query the native pixel size, and b) to set the surface to have native resolution instead of scaled?
The text was updated successfully, but these errors were encountered: