Peter Kümmel wrote:
Here a patch to recover from
a silly window position.

Is it portable?




------------------------------------------------------------------------

Index: frontends/qt4/GuiView.C
===================================================================
--- frontends/qt4/GuiView.C     (revision 15561)
+++ frontends/qt4/GuiView.C     (working copy)
@@ -154,6 +154,12 @@
        // only true when the -geometry option was NOT used
        if (width != 0 && height != 0) {
                if (posx != -1 && posy != -1) {
+                       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

Reply via email to