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