Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_WindowCocoa.mm
| Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
| - (void)windowWillMove:(NSNotification *)notification | - (void)windowWillMove:(NSNotification *)notification | ||||
| { | { | ||||
| systemCocoa->handleWindowEvent(GHOST_kEventWindowMove, associatedWindow); | systemCocoa->handleWindowEvent(GHOST_kEventWindowMove, associatedWindow); | ||||
| } | } | ||||
| - (void)windowWillEnterFullScreen:(NSNotification *)notification | - (void)windowWillEnterFullScreen:(NSNotification *)notification | ||||
| { | { | ||||
| associatedWindow->setImmediateDraw(true); | associatedWindow->setImmediateDraw(true); | ||||
| /* macOS does not send a window resize event when switching between zoomed | |||||
| * and fullscreen, when automatic show/hide of dock and menu bar are enabled. | |||||
| * Send our own to prevent artifacts. */ | |||||
| if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { | |||||
| systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); | |||||
| } | |||||
| } | } | ||||
| - (void)windowDidEnterFullScreen:(NSNotification *)notification | - (void)windowDidEnterFullScreen:(NSNotification *)notification | ||||
| { | { | ||||
| associatedWindow->setImmediateDraw(false); | associatedWindow->setImmediateDraw(false); | ||||
| } | } | ||||
| - (void)windowWillExitFullScreen:(NSNotification *)notification | - (void)windowWillExitFullScreen:(NSNotification *)notification | ||||
| { | { | ||||
| associatedWindow->setImmediateDraw(true); | associatedWindow->setImmediateDraw(true); | ||||
| } | } | ||||
| - (void)windowDidExitFullScreen:(NSNotification *)notification | - (void)windowDidExitFullScreen:(NSNotification *)notification | ||||
| { | { | ||||
| associatedWindow->setImmediateDraw(false); | associatedWindow->setImmediateDraw(false); | ||||
| /* See comment for windowWillEnterFullScreen. */ | |||||
| if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { | |||||
| systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); | |||||
| } | |||||
| } | } | ||||
| - (void)windowDidResize:(NSNotification *)notification | - (void)windowDidResize:(NSNotification *)notification | ||||
| { | { | ||||
| //if (![[notification object] inLiveResize]) { | //if (![[notification object] inLiveResize]) { | ||||
| //Send event only once, at end of resize operation (when user has released mouse button) | //Send event only once, at end of resize operation (when user has released mouse button) | ||||
| systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); | systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); | ||||
| //} | //} | ||||
| ▲ Show 20 Lines • Show All 1,105 Lines • Show Last 20 Lines | |||||