-rw-r--r-- | library/qpeapplication.cpp | 16 | ||||
-rw-r--r-- | library/qpeapplication.h | 2 | ||||
-rw-r--r-- | library/widget_showing.cpp | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index dcc1001..34f5e6a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -100,8 +100,9 @@ #include <backend/rohfeedback.h> static bool useBigPixmaps = 0; +static bool saveWindowsPos = 0; class HackWidget : public QWidget { public: @@ -128,8 +129,9 @@ public: fontFamily = cfg.readEntry( "FontFamily", "Vera" ); fontSize = cfg.readNumEntry( "FontSize", 10 ); smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); + saveWindowsPos = cfg.readBoolEntry( "AllowWindowed", false ); #ifdef OPIE_WITHROHFEEDBACK RoH = 0; #endif } @@ -249,9 +251,10 @@ public: } static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) { -#ifndef OPIE_NO_WINDOWED + if (!saveWindowsPos) + return FALSE; maximized = TRUE; // 350 is the trigger in qwsdefaultdecoration for providing a resize button if ( qApp->desktop()->width() <= 350 ) return FALSE; @@ -271,10 +274,8 @@ public: maximized = l[4].toInt(); return TRUE; } -#endif - return FALSE; } static bool validate_widget_size(const QWidget *w, QPoint &p, QSize &s) @@ -321,9 +322,10 @@ public: static void store_widget_rect(QWidget *w, QString &app) { if( !w ) return; -#ifndef OPIE_NO_WINDOWED + if (!saveWindowsPos) + return; // 350 is the trigger in qwsdefaultdecoration for providing a resize button if ( qApp->desktop()->width() <= 350 ) return; // we use these to map the offset of geometry and pos. ( we can only use normalGeometry to @@ -342,9 +344,8 @@ public: cfg.setGroup("ApplicationPositions"); QString s; s.sprintf("%d,%d,%d,%d,%d", r.left() + offsetX, r.top() + offsetY, r.width(), r.height(), w->isMaximized() ); cfg.writeEntry( app, s ); -#endif } static bool setWidgetCaptionFromAppName( QWidget* /*mw*/, const QString& /*appName*/, const QString& /*appsPath*/ ) { @@ -2206,8 +2207,13 @@ void QPEApplication::hideOrQuit() else quit(); } +bool QPEApplication::isSaveWindowsPos() +{ + return saveWindowsPos; +} + #if (__GNUC__ > 2 ) && !defined(_OS_MACX_) extern "C" void __cxa_pure_virtual(); void __cxa_pure_virtual() diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 6486cad..7c99a9a 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h @@ -136,8 +136,10 @@ public: bool keyboardGrabbed() const; int exec(); + static bool isSaveWindowsPos(); + signals: void clientMoused(); void timeChanged(); void clockChanged( bool pm ); diff --git a/library/widget_showing.cpp b/library/widget_showing.cpp index e43a16a..cc1bfb2 100644 --- a/library/widget_showing.cpp +++ b/library/widget_showing.cpp @@ -51,15 +51,10 @@ void QPEApplication::showWidget( QWidget* wg, bool nomax ) { wg->show(); return; } -#ifdef OPIE_NO_WINDOWED - Q_UNUSED( nomax ) - if ( TRUE ) { -#else - if ( !nomax - && ( qApp->desktop()->width() <= 320 ) ){ -#endif + if ( !isSaveWindowsPos() || (!nomax + && ( qApp->desktop()->width() <= 30 )) ){ wg->showMaximized(); } else { #ifdef Q_WS_QWS QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() ); |