diff --git a/src/core/RMainWindow.cpp b/src/core/RMainWindow.cpp index 03e49eb4b7..636ef2059a 100644 --- a/src/core/RMainWindow.cpp +++ b/src/core/RMainWindow.cpp @@ -717,17 +717,6 @@ bool RMainWindow::readSettings() { ret = true; } - // get total available width on all screens: - int totalWidth = 0; - for (int i=0; iscreenCount(); i++) { - totalWidth+=QApplication::desktop()->availableGeometry(0).width(); - } - - // sanity check for x: - if (x>totalWidth-100) { - move(100, y); - } - resize(width, height); return ret; } diff --git a/src/gui/RMainWindowQt.cpp b/src/gui/RMainWindowQt.cpp index b9e16d7be0..0e95d7ce7f 100644 --- a/src/gui/RMainWindowQt.cpp +++ b/src/gui/RMainWindowQt.cpp @@ -17,6 +17,7 @@ * along with QCAD. */ #include +#include #include #include #include @@ -482,6 +483,26 @@ bool RMainWindowQt::readSettings() { statusBar()->hide(); } + // get total available width on all screens: + int totalWidth = 0; + for (int i=0; iscreenCount(); i++) { + totalWidth+=QApplication::desktop()->availableGeometry(i).width(); + } + + // sanity check for x: + if (x()>totalWidth-100) { + move(totalWidth-width(), y()); + } + + // make sure all tool bars are visible: + QList tbs = findChildren(); + for (int i=0; ix()>totalWidth-50) { + tb->move(totalWidth - tb->width(), tb->y()); + } + } + return ret; }