Bug fix #33911
authorTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 18:07:17 +0000 (18:07 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 18:07:17 +0000 (18:07 +0000)
When you open a Blender window larger than a screen, Macs clip it to match the height,
but they allow the width to be more.

Problem is that this clipping happens after all window opening code. That causes
check for HiDPI mode to fail.

Now it checks it again on event GHOST_kEventWindowUpdate, which is only on startup.

intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.mm

index 77417a9..1665180 100644 (file)
@@ -1038,6 +1038,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
                                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowDeactivate, window) );
                                break;
                        case GHOST_kEventWindowUpdate:
+                               if (m_nativePixel) {
+                                       window->setNativePixelSize();
+                                       pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) );
+                               }
                                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) );
                                break;
                        case GHOST_kEventWindowMove:
index 772db85..43d3dcb 100644 (file)
@@ -927,7 +927,6 @@ void GHOST_WindowCocoa::setNativePixelSize(void)
        getClientBounds(rect);
 
        m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
-
 }
 
 /**