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

Qtopia-interest Archive, February 2008
[PATCH] Make the ContextLabel refuse close events like the PhoneLauncher does


Message 1 in thread

Hi,

the other part of the fix will be in the WM but in any case the ContextLabel 
should not vanish from the screen.




From 6375ba3819b6e841a020dd81fd84ce2c2d394ec5 Mon Sep 17 00:00:00 2001
From: Holger Freyther <zecke@xxxxxxxxxxx>
Date: Tue, 19 Feb 2008 22:47:43 +0100
Subject: [PATCH] Never close the ContextLabel (Softbar at the bottom):
     Even if the window manager thinks the softbar has focus
     and Key_Back will call close on the ContextLabel then
     ignore the CloseEvent.

---
 src/server/phone/contextlabel.cpp |    9 +++++++++
 src/server/phone/contextlabel.h   |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/server/phone/contextlabel.cpp 
b/src/server/phone/contextlabel.cpp
index e380356..3c58055 100644
--- a/src/server/phone/contextlabel.cpp
+++ b/src/server/phone/contextlabel.cpp
@@ -28,6 +28,7 @@
 #include <QStyle>
 #include <QPixmapCache>
 #include <QDebug>
+#include <QCloseEvent>
 #include <QApplication>
 #include <QTimer>
 #include "qsoftmenubarprovider.h"
@@ -264,3 +265,11 @@ void ContextLabel::updateLabels()
     }
 }
 
+/*
+ * Never close this window, even if it might got active
+ */
+void ContextLabel::closeEvent(QCloseEvent* e)
+{
+    e->ignore();
+}
+
diff --git a/src/server/phone/contextlabel.h b/src/server/phone/contextlabel.h
index e8969e0..6a13bf7 100644
--- a/src/server/phone/contextlabel.h
+++ b/src/server/phone/contextlabel.h
@@ -41,6 +41,8 @@ public:
 
     QSize reservedSize() const;
 
+    void closeEvent(QCloseEvent*);
+
 protected:
     void updateLabels();
     virtual bool filter(int unicode, int keycode, int modifiers, bool press,
-- 
 [ signature omitted ] 

Message 2 in thread

I will have to test this to make sure this is not the intended behavior 
for both keypad and touchscreen devices.


Holger Freyther wrote:
> Hi,
> 
> the other part of the fix will be in the WM but in any case the ContextLabel 
> should not vanish from the screen.
> 
> 
> 
> 
> From 6375ba3819b6e841a020dd81fd84ce2c2d394ec5 Mon Sep 17 00:00:00 2001
> From: Holger Freyther <zecke@xxxxxxxxxxx>
> Date: Tue, 19 Feb 2008 22:47:43 +0100
> Subject: [PATCH] Never close the ContextLabel (Softbar at the bottom):
>      Even if the window manager thinks the softbar has focus
>      and Key_Back will call close on the ContextLabel then
>      ignore the CloseEvent.
> 
> ---
>  src/server/phone/contextlabel.cpp |    9 +++++++++
>  src/server/phone/contextlabel.h   |    2 ++
>  2 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/src/server/phone/contextlabel.cpp 
> b/src/server/phone/contextlabel.cpp
> index e380356..3c58055 100644
> --- a/src/server/phone/contextlabel.cpp
> +++ b/src/server/phone/contextlabel.cpp
> @@ -28,6 +28,7 @@
>  #include <QStyle>
>  #include <QPixmapCache>
>  #include <QDebug>
> +#include <QCloseEvent>
>  #include <QApplication>
>  #include <QTimer>
>  #include "qsoftmenubarprovider.h"
> @@ -264,3 +265,11 @@ void ContextLabel::updateLabels()
>      }
>  }
>  
> +/*
> + * Never close this window, even if it might got active
> + */
> +void ContextLabel::closeEvent(QCloseEvent* e)
> +{
> +    e->ignore();
> +}
> +
> diff --git a/src/server/phone/contextlabel.h b/src/server/phone/contextlabel.h
> index e8969e0..6a13bf7 100644
> --- a/src/server/phone/contextlabel.h
> +++ b/src/server/phone/contextlabel.h
> @@ -41,6 +41,8 @@ public:
>  
>      QSize reservedSize() const;
>  
> +    void closeEvent(QCloseEvent*);
> +
>  protected:
>      void updateLabels();
>      virtual bool filter(int unicode, int keycode, int modifiers, bool press,

-- 
 [ signature omitted ]