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 77417a9e0af4b88bb81645d19cea485f60943010..1665180b68790195e1d3dd3090ae89f8cd5a9c69 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:
                                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:
                                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) );
                                break;
                        case GHOST_kEventWindowMove:
index 772db85b190a85ed303ddf3d833d0a099d88515d..43d3dcb76e7ac26aa17962a384187898e7052df0 100644 (file)
@@ -927,7 +927,6 @@ void GHOST_WindowCocoa::setNativePixelSize(void)
        getClientBounds(rect);
 
        m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
        getClientBounds(rect);
 
        m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
-
 }
 
 /**
 }
 
 /**