void ResizableWindow::setMinimised (const bool shouldMinimise) { if (shouldMinimise != isMinimised()) { if (ComponentPeer* const peer = getPeer()) { updateLastPos(); peer->setMinimised (shouldMinimise); } else { jassertfalse; } } }
void ResizableWindow::setMinimised (const bool shouldMinimise) { if (shouldMinimise != isMinimised()) { if (auto* peer = getPeer()) { updateLastPosIfShowing(); peer->setMinimised (shouldMinimise); } else { jassertfalse; } } }
void ComponentPeer::handleMovedOrResized() { ModifierKeys::updateCurrentModifiers(); const bool nowMinimised = isMinimised(); if (component.flags.hasHeavyweightPeerFlag && ! nowMinimised) { const WeakReference<Component> deletionChecker (&component); Rectangle<int> newBounds (getBounds()); Rectangle<int> oldBounds (component.getBounds()); oldBounds = Component::ComponentHelpers::localPositionToRawPeerPos (component, oldBounds); const bool wasMoved = (oldBounds.getPosition() != newBounds.getPosition()); const bool wasResized = (oldBounds.getWidth() != newBounds.getWidth() || oldBounds.getHeight() != newBounds.getHeight()); if (wasMoved || wasResized) { newBounds = Component::ComponentHelpers::rawPeerPositionToLocal (component, newBounds); component.bounds = newBounds; if (wasResized) component.repaint(); component.sendMovedResizedMessages (wasMoved, wasResized); if (deletionChecker == nullptr) return; } } if (isWindowMinimised != nowMinimised) { isWindowMinimised = nowMinimised; component.minimisationStateChanged (nowMinimised); component.sendVisibilityChangeMessage(); } if (! isFullScreen()) lastNonFullscreenBounds = component.getBounds(); }
void ComponentPeer::handleMovedOrResized() { updateCurrentModifiers(); const bool nowMinimised = isMinimised(); if (component->flags.hasHeavyweightPeerFlag && ! nowMinimised) { const WeakReference<Component> deletionChecker (component); const Rectangle<int> newBounds (getBounds()); const bool wasMoved = (component->getPosition() != newBounds.getPosition()); const bool wasResized = (component->getWidth() != newBounds.getWidth() || component->getHeight() != newBounds.getHeight()); if (wasMoved || wasResized) { component->bounds = newBounds; if (wasResized) component->repaint(); component->sendMovedResizedMessages (wasMoved, wasResized); if (deletionChecker == nullptr) return; } } if (isWindowMinimised != nowMinimised) { isWindowMinimised = nowMinimised; component->minimisationStateChanged (nowMinimised); component->sendVisibilityChangeMessage(); } if (! isFullScreen()) lastNonFullscreenBounds = component->getBounds(); }
void ResizableWindow::updateLastPos() { if (isShowing() && ! (isFullScreen() || isMinimised())) lastNonFullScreenPos = getBounds(); }
void ResizableWindow::updateLastPosIfNotFullScreen() { if (! (isFullScreen() || isMinimised() || isKioskMode())) lastNonFullScreenPos = getBounds(); }
void LWindow::maximize() { if(!isMinimised()) { SDL_MaximizeWindow(mWindow); mMinimised = false; } }