summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp30
-rw-r--r--libopie2/opiecore/device/odevice_simpad.h2
2 files changed, 23 insertions, 9 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index 4ae3c4f..ebf0cbb 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -36,2 +36,3 @@
#include <qwindowsystem_qws.h>
+#include <qwidgetlist.h>
@@ -317,3 +318,2 @@ bool SIMpad::suspend() // Must override because SIMpad does NOT have apm
{
- qDebug( "ODevice for SIMpad: suspend()" );
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
@@ -321,8 +321,2 @@ bool SIMpad::suspend() // Must override because SIMpad does NOT have apm
- /*
- * we need to save the screen content
- * then go to suspend using ODevice::suspend
- * and finally restore the screen content
- */
- (void)::system( "cat /dev/fb/0 > /tmp/.buffer" );
bool res = ODevice::suspend();
@@ -330,6 +324,7 @@ bool SIMpad::suspend() // Must override because SIMpad does NOT have apm
/*
- * restore
+ * restore the screen content if we really
+ * supended the device
*/
if ( res )
- ::system( "cat /tmp/.buffer > /dev/fb/0" );
+ updateAllWidgets();
@@ -371 +366,18 @@ int SIMpad::displayBrightnessResolution() const
+
+/*
+ * The MQ200 DRAM content is lost during suspend
+ * so we will just repaint every widget on resume
+ */
+void SIMpad::updateAllWidgets() {
+ QWidgetList *list = QApplication::allWidgets();
+ QWidgetListIt it( *list );
+ QWidget *wid;
+
+ while ((wid=it.current()) != 0 ) {
+ wid->update();
+ ++it;
+ }
+
+ delete list;
+}
diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h
index dbcbbb4..c25b911 100644
--- a/libopie2/opiecore/device/odevice_simpad.h
+++ b/libopie2/opiecore/device/odevice_simpad.h
@@ -67,2 +67,4 @@ protected:
OLedState m_leds [2];
+private:
+ static void updateAllWidgets();
};