Abdelrazak Younes wrote:
Abdelrazak Younes wrote:
Enrico Forestieri wrote:
On Fri, Nov 16, 2007 at 06:54:23PM +0100, Abdelrazak Younes wrote:

OK, what about maximisation?

Works fine for me. I can full maximize, maximize either vertically
or horizontally and then return to the original size. This is with
sawfish, didn't try other WMs.

Then it seems sawfish is a good pupil :-)


However, -geometry still doesn't work.
I think I know what's going on... stay tuned.

Keeping fingers crossed...

Could you try this patch please and give me the output of -dbg gui?

Hum sorry, here is a better patch (I hope).

AARRGHH! Here is the correct patch.

Abdel.

Index: GuiView.cpp
===================================================================
--- GuiView.cpp (revision 21643)
+++ GuiView.cpp (working copy)
@@ -71,6 +71,7 @@
 #include <QMenu>
 #include <QPainter>
 #include <QPixmap>
+#include <QPoint>
 #include <QPushButton>
 #include <QSettings>
 #include <QShowEvent>
@@ -352,7 +353,7 @@
 
 void GuiView::init()
 {
-       setMinimumSize(300, 200);
+       setMinimumSize(100, 100);
        // GuiToolbars *must* be initialised before GuiMenubar.
        d.toolbars_ = new GuiToolbars(*this);
        // FIXME: GuiToolbars::init() cannot be integrated in the ctor
@@ -376,10 +377,19 @@
                QSettings settings;
                QString const key = "view-" + QString::number(id());
 #ifdef Q_WS_X11
-               QPoint pos = settings.value(key + "/pos", QPoint(50, 
50)).toPoint();
-               QSize size = settings.value(key + "/size", QSize(690, 
510)).toSize();
-               resize(size);
-               move(pos);
+               QSize const passed_size = size();
+               QPoint const passed_pos = pos();
+               LYXERR(Debug::GUI, "Passed Geometry "
+                       << passed_size.height() << "x" << passed_size.width()
+                       << "+" << passed_pos.x() << "+" << passed_pos.y());
+               // Use settings only if the geometry is preset by the window 
manager or
+               // if the user used the "-geometry" option.
+               if (passed_size.height() <= 100 && passed_size.width() <= 100) {
+                       QPoint pos = settings.value(key + "/pos", QPoint(50, 
50)).toPoint();
+                       QSize size = settings.value(key + "/size", QSize(690, 
510)).toSize();
+                       resize(size);
+                       move(pos);
+               }
 #else
                if (!restoreGeometry(settings.value(key + 
"/geometry").toByteArray()))
                        setGeometry(50, 50, 690, 510);

Reply via email to