Skip to content

Commit

Permalink
- fix HISE window positioning on Windows when maximized
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Jan 22, 2025
1 parent c704f57 commit aabe79d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
13 changes: 10 additions & 3 deletions hi_backend/backend/BackendRootWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,16 @@ BackendRootWindow::BackendRootWindow(AudioProcessor *ownerProcessor, var editorS

const int workspace = editorState.getDynamicObject()->getProperty("CurrentWorkspace");


#if JUCE_WINDOWS
auto makeFullScreenOnLaunch = (bool)editorState.getProperty("isFullScreen", false);
getProperties().set("FullScreen", makeFullScreenOnLaunch);
#endif

if(workspace > 0)
showWorkspace(workspace);

setEditor(this);
}


}

if (!loadedCorrectly)
Expand Down Expand Up @@ -759,6 +760,12 @@ void BackendRootWindow::saveInterfaceData()

obj->setProperty("Position", position);

if(auto rw = findParentComponentOfClass<ResizableWindow>())
{
auto isFullScreen = rw->isFullScreen();
obj->setProperty("isFullScreen", isFullScreen);
}

obj->setProperty("CurrentWorkspace", currentWorkspace);
}

Expand Down
12 changes: 7 additions & 5 deletions projects/standalone/Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ class HISEStandaloneApplication : public JUCEApplication
}
}

setContentOwned (new MainContentComponent(commandLine), true);
auto mc = new MainContentComponent(commandLine);
setContentOwned (mc, true);

#if JUCE_IOS

Expand All @@ -899,9 +900,10 @@ class HISEStandaloneApplication : public JUCEApplication

setUsingNativeTitleBar(true);



centreWithSize (getWidth(), getHeight() - 28);
if(mc->makeFullscreenOnLaunch)
setFullScreen(true);
else
centreWithSize (getWidth(), getHeight() - 28);

#endif

Expand Down Expand Up @@ -968,7 +970,7 @@ MainContentComponent::MainContentComponent(const String &commandLine)

setSize(editor->getWidth(), editor->getHeight());


makeFullscreenOnLaunch = (bool)editor->getProperties()["FullScreen"];

handleCommandLineArguments(commandLine);
}
Expand Down
2 changes: 2 additions & 0 deletions projects/standalone/Source/MainComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class MainContentComponent : public Component,

void requestQuit();

bool makeFullscreenOnLaunch = false;

private:

ScopedPointer<AudioProcessorEditor> editor;
Expand Down

0 comments on commit aabe79d

Please sign in to comment.