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