summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.h
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2016-09-07 14:34:03 +0200
committerRobin Burchell <robin.burchell@viroteck.net>2016-09-29 12:09:18 +0000
commit422838685c31d9b57133a8711bfd5db92095d96d (patch)
tree4a01c39c2aea23c955f5c5175d8a7b4c2ca356c2 /src/plugins/platforms/xcb/qxcbwindow.h
parent6c2d786e198b4cf30391f141c804e55523c6ed16 (diff)
xcb: Treat bitmap cursors differently from shaped cursors
QXcbCursor had a "cache" of cursor handles. Unfortunately, as QXcbCursor has its lifetime tied to the screen, this cache grew unbounded whenever the cursor was set: this could be witnessed worst when repeatedly setting the current cursor to a different pixmap each time. We fix this by keeping the cursor cache only for the "regular" shaped cursors that are often shared between windows, working on the assumption that custom cursors are generally specific only to a given window. This makes the lifetime of the bitmap cursors much more clear: they are tied to that window, and when the window is destroyed (or changes cursor), so too is the bitmap cursor destroyed (if set). Reported-by: Will Thompson <wjt@endlessm.com> Change-Id: Ia558d858ff49e89cd5220344567203eb0267a133 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index b8bcf4428a..f2b690416f 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -97,7 +97,7 @@ public:
bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE;
bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
- void setCursor(xcb_cursor_t cursor);
+ void setCursor(xcb_cursor_t cursor, bool isBitmapCursor);
QSurfaceFormat format() const Q_DECL_OVERRIDE;
@@ -263,6 +263,7 @@ protected:
SyncState m_syncState;
QXcbSyncWindowRequest *m_pendingSyncRequest;
+ xcb_cursor_t m_currentBitmapCursor;
};
QT_END_NAMESPACE