From fa759d8ffdd6c2a66270e8e85a53f608f4cd7ad0 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 12 Jan 2013 17:07:49 +0000 Subject: Mac HiDPI ("retina") handling: OK - so you have this nice crisp screen, and still you want to add extra monitors to the laptop! That means Blender should switch back and forth to HiDPI modes, when you move a window to another monitor. This code makes the pixelsize scale factor a window property, and handles an event when a window moves to another monitor. It then changes the native pixelsize nicely and refreshes entire UI. You can also have one Blender window on high, and other on low resolution. Stretching a Blender window from 1 monitor to the other works too, but that is Apple magic handling it. --- source/blender/blenkernel/intern/blender.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel/intern/blender.c') diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 11ae242023c..fb2d1a3aaf7 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -426,6 +426,9 @@ void BKE_userdef_free(void) /* handle changes in settings that need recalc */ void BKE_userdef_state(void) { + /* prevent accidents */ + if (U.pixelsize == 0) U.pixelsize = 1; + BLF_default_dpi(U.pixelsize * U.dpi); U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72; -- cgit v1.2.3