From a96cb88ccdad8146d77fe6dad1ed95cb127f833d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 27 Oct 2006 08:40:08 +0000 Subject: [PATCH] GuiView.C: recover from silly window positions git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15574 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.C | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index f1611262de..263f41c62a 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -154,6 +154,15 @@ void GuiView::setGeometry(unsigned int width, // only true when the -geometry option was NOT used if (width != 0 && height != 0) { if (posx != -1 && posy != -1) { + // if there are ever startup positioning problems + // on a virtual desktop then check the 6 lines below + // http://doc.trolltech.com/4.2/qdesktopwidget.html + QDesktopWidget& dw = *qApp->desktop(); + QRect desk = dw.availableGeometry(dw.primaryScreen()); + if (posx >= desk.width()) + posx = 0.1 * desk.width(); + if (posy >= desk.height()) + posy = 0.1 * desk.height(); #ifdef Q_WS_WIN // FIXME: use only setGeoemtry when Trolltech has // fixed the qt4/X11 bug