c488e08
From 9e9a7bc29319d52c3e563bc2c5282cb7e6890eba Mon Sep 17 00:00:00 2001
c488e08
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
c488e08
Date: Wed, 29 Sep 2010 14:02:10 +0200
c488e08
Subject: [PATCH] Fixes cursor shape when widget becomes native on X11.
c488e08
c488e08
When a native window handle is created for a widget that has override
c488e08
cursor set, we should reset the cursor on the parent and set the cursor
c488e08
on the new window handle.
c488e08
c488e08
Task-number: QTBUG-6185
c488e08
Reviewed-by: Olivier Goffart
c488e08
---
c488e08
 src/gui/kernel/qwidget_x11.cpp |    4 +++-
c488e08
 1 files changed, 3 insertions(+), 1 deletions(-)
c488e08
c488e08
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
c488e08
index e01489f..8d80e10 100644
c488e08
--- a/src/gui/kernel/qwidget_x11.cpp
c488e08
+++ b/src/gui/kernel/qwidget_x11.cpp
c488e08
@@ -889,8 +889,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
c488e08
                 q->setWindowOpacity(maybeTopData()->opacity/255.);
c488e08
 
c488e08
         }
c488e08
-    } else if (q->testAttribute(Qt::WA_SetCursor) && q->internalWinId()) {
c488e08
+    } else if (q->internalWinId()) {
c488e08
         qt_x11_enforce_cursor(q);
c488e08
+        if (QWidget *p = q->parentWidget()) // reset the cursor on the native parent
c488e08
+            qt_x11_enforce_cursor(p);
c488e08
     }
c488e08
 
c488e08
     if (extra && !extra->mask.isEmpty() && q->internalWinId())
c488e08
-- 
c488e08
1.6.1
c488e08