Trolltech Home | Qtopia-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qtopia-interest Archive, March 2008
[PATCH] Qtopia/X11 and not updating the ContextLabel on startup


Message 1 in thread

Hey,

If I have a missed call and restart qpe, a meesage box is shown but the 
ContextLabel is not updating the caption. This is due the ContextLabelManager 
not sending setTextLabel to the qpe process because we do not have an 
qApp->activeWindow() in ContextKeyManager::updateLabelsForFocused (also the 
usage of qApp->activeWindow and QApplication::activeWindow is not consistent) 
yet.

Proposed change: Once we get an activeWindow reevaluate if we need to update 
the labels. The QEvent::ApplicationActivated event is not sent and the 
fallback to XEvent is needed here.


comments?
	z.


From aaed0fb647a55dc3818cb982ae545f2ab70e83a4 Mon Sep 17 00:00:00 2001
From: Holger Freyther <zecke@xxxxxxxxxxx>
Date: Mon, 3 Mar 2008 12:01:26 +0100
Subject: [PATCH] The ContextLabel was not updated for the "missed call" 
messagebox on qpe launch.

At the time ContextLabelManager tried to update the labels we did not have
an QApplication::activeWindow yet. So the text was not updated, there was no
signal/event which would trigger updating the the label. 
QApplication::setActiveWindow
gets called from qapplication_x11.cpp for XFocusIn. If we see this event 
coming
by call ContextLabelManager::updateContextLabels, assuming it starts a timer, 
and if
we have an active window the labels will be updated. Listening to 
QEvent::ApplicationActivated
does not work as this event is sent conditionally, listening on the 
WindowActivate was not
attempted, it felt wrong to do this in the eventFilter.
---
 src/libraries/qtopia/qtopiaapplication.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/libraries/qtopia/qtopiaapplication.cpp 
b/src/libraries/qtopia/qtopiaapplication.cpp
index 88a14de..a5c084e 100644
--- a/src/libraries/qtopia/qtopiaapplication.cpp
+++ b/src/libraries/qtopia/qtopiaapplication.cpp
@@ -2902,6 +2902,19 @@ bool QtopiaApplication::x11EventFilter(XEvent *e)
                 return true;
         }
     }
+
+    
+    /*
+     * Setting: Missed calls, starting qpe, window manager
+     * Issue: placing/showing the dialog too late/wrong and not
+     * updating the context menu afterwards.
+     * Solve: qapplication_x11 is calling setActiveWindow
+     *
+     */
+    QWidget *widget = QWidget::find((WId)e->xany.window);
+    if (widget && e->type == XFocusIn)
+        ContextKeyManager::instance()->updateContextLabels();
+
     return false;
 }
 
-- 
 [ signature omitted ]