Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#210 On App Resuming, Blank Screen [Patch]

stable
open
nobody
None
2012-12-27
2012-06-15
Josua Dietze
No

Setup Summary:
Necessitas 0.3 - Android 2.2 (Dell Streak), also reported from Motorola Defy - Widget application (QMainWindow).

Issue:
After using "Home" device key to pause Qt app and resuming by touching the icon again, the screen is black. Touching (invisible) action widgets will partly redraw the screen.

Patch:
My (really "dirty") solution went into the plugin/platform/android code; I added a line in "androidjnimain.cpp", method "updateWindow":

-------
   if(!m_androidGraphicsSystem ||  !qApp)
       return;

+  m_androidGraphicsSystem->getPrimaryScreen()->setDirty(
+      m_androidGraphicsSystem->getPrimaryScreen()->geometry() );
+
   foreach(QWidget * w, qApp->topLevelWidgets())
       w->update();
-------

There may be better solutions, but this line did the trick.

Discussion

  • Josua Dietze
    Josua Dietze
    2012-06-15

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,10 @@
    -Setup Summary: Necessitas 0.3 - Android 2.2 (Dell Streak), also reported from Motorola Defy - Widget application (QMainWindow).
    +Setup Summary:
    +Necessitas 0.3 - Android 2.2 (Dell Streak), also reported from Motorola Defy - Widget application (QMainWindow).
    
    +Issue:
     After using "Home" device key to pause Qt app and resuming by touching the icon again, the screen is black. Touching (invisible) action widgets will partly redraw the screen.
    
    +Patch:
     My (really "dirty") solution went into the plugin/platform/android code; I added a line in "androidjnimain.cpp", method "updateWindow":
    
         -------
    
     
  • discus-axel
    discus-axel
    2012-06-20

    The same problem annoys me. Sometimes the screen is black after the return and sometimes not. Could not find out, what is responsible for that.

     
  • BogDan Vatra
    BogDan Vatra
    2012-06-21

    It should be already fixed in alpha4 release. In order to test it you have to install Ministro from http://files.kde.org/necessitas/installer/MinistroActivity.apk and use "Ministro Configuration Tool" to switch to unstable repository and try again.
    Please report the results before the end of the next week,

     
  • fengyi
    fengyi
    2012-12-27

    src\plugins\platforms\fb_base\fb_base.cpp
    void QFbScreen::setDirty(const QRect &rect)
    {
    QRect intersection = rect.intersected(mGeometry);
    QPoint screenOffset = mGeometry.topLeft();
    repaintRegion += intersection.translated(-screenOffset); // global to local translation
    if (!redrawTimer.isActive()) {
    redrawTimer.start();
    }
    }
    just change to :
    void QFbScreen::setDirty(const QRect &rect)
    {
    QRect intersection = rect.intersected(mGeometry);
    QPoint screenOffset = mGeometry.topLeft();
    repaintRegion += intersection.translated(-screenOffset); // global to local translation
    redrawTimer.start();
    }