Skip to content

Commit 86b6c55

Browse files
committed
Fix Main Window launching outside screen bounds
1 parent 7961480 commit 86b6c55

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

Source/MainWindow.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -337,21 +337,17 @@ void MainWindow::loadWindowBounds()
337337
if (e->hasTagName("BOUNDS"))
338338
{
339339

340-
int x = e->getIntAttribute("x");
341-
int y = e->getIntAttribute("y");
342-
int w = e->getIntAttribute("w");
343-
int h = e->getIntAttribute("h");
344-
345-
// bool fs = e->getBoolAttribute("fullscreen");
346-
347-
// without the correction, you get drift over time
348-
#ifdef _WIN32
349-
setTopLeftPosition(x,y); //Windows doesn't need correction
350-
#else
351-
setTopLeftPosition(x,y-27);
352-
#endif
353-
getContentComponent()->setBounds(0,0,w-10,h-33);
354-
//setFullScreen(fs);
340+
String x = String(e->getIntAttribute("x"));
341+
String y = String(e->getIntAttribute("y"));
342+
String w = String(e->getIntAttribute("w"));
343+
String h = String(e->getIntAttribute("h"));
344+
345+
String windowBoundsString;
346+
windowBoundsString = x + " " + y + " " + w + " " + h;
347+
348+
LOGD("Loading Window Bounds: ", windowBoundsString);
349+
restoreWindowStateFromString(windowBoundsString);
350+
355351
}
356352
else if (e->hasTagName("RECENTDIRECTORYNAMES"))
357353
{

0 commit comments

Comments
 (0)