GNOME Bugzilla – Bug 763269
HiDPI cairo patch breaks gtk 2 builds
Last modified: 2016-03-17 23:36:14 UTC
The hidpi patch applied to cairo here https://github.com/jralls/gtk-osx-build/commit/a3826210aa38d15f0c5df13ab9e7c725a3d73890 is applied not only for gtk3 builds but also gtk2 builds and gkt2 doesn't expect that - the result is a completely broken GUI under gtk2. gkt2 builds should be made without the patch.
Looks OK to me, at least on non-retina. Is your problem on retina? Can you attach a screenshot showing the breakage?
Created attachment 323330 [details] Screenshot
Yes, it is retina in my case - it makes sense it makes no difference on non-retina because when you have a look at the patch, scale=1 for non-retina and it basically just multiplies by 1 which makes no difference. When I comment-out the patch, everything looks and works fine. With the patch some of the GUI elements are drawn half the size and the whole GUI is broken. For reference, the correct appearance is something like this http://wiki.geany.org/_media/howtos/osx/geany-osx.png
I was afraid of that. What happens if instead of restoring the two lines to ... you instead add them to _gdk_windowing_create_cairo_surface in gdk/quartz/gdkdrawable-quartz.c?
That doesn't help - neither when using CGContextScaleCTM(cg_context, 1/scale.width, 1/scale.height); nor CGContextScaleCTM(cg_context, scale.width, scale.height);
Oh, duh, I was thinking backwards. We need to move that from cairo into gtk3.
I'll have a look.
I must say I don't understand the logic behind the patches - cairo already takes display densities into account - now the cairo patch undos that. Afterwards, in gtk, this is re-done again by doubling the surface size. What's the logic behind this? Note that indeed without this patch I get some views pixelated in gtk3 but this doesn't seem to be the right approach to me. IMO there should be no such a patch needed for cairo, it seems gtk should be fixed in this respect.
Afair display density isn't taken into account for image surfaces, which are widely used in gtk+3 for caching. To get correct image surfaces you have to tell cairo the device scale, which is also applied to the non-image surface, which in turn conflicts with the osx internal scaling.
OK, thanks for the explanation
Created attachment 324136 [details] [review] Fix gtk+2 breakage on retina introduced by the recent hidpi fixes. Well, I take that back, a gtk+3 only fix was possible as you said. Sorry for breaking gtk2 and for taking so long.
Great to hear, thanks!
Pushed, thanks.