diff options
author | Gerry Boland <gerry.boland@canonical.com> | 2016-11-02 16:46:53 +0000 |
---|---|---|
committer | Matti Paaso <matti.paaso@qt.io> | 2017-01-24 05:52:52 +0000 |
commit | c28fde3fdac19fd5a5f614bb7983080031c924b3 (patch) | |
tree | 441d2d4ea4e1e17db49ed3b12c7c724cbc6db894 /src/plugins/platforms/mirclient/qmirclientcursor.cpp | |
parent | 4b507e8257243e36f40089d57099c2d668c5884d (diff) |
Mirclient: update based on upstream development in lp:qtubuntu
This is based on revision 360 of lp:qtubuntu.
Main features/bugs fixed:
- fix QQuickWidget-based app rendering
- wire up Qt window types to Mir to enable desktop-based applications
to function with a window manager
- use QEGLPlatformContext and QEGLPBuffer instead of custom code
- correctly populate and update list of QScreens
- support for switching keyboard layouts
- improve window resizing to fix visual glitching
Change-Id: If816a858eb10b6356275d4b80c89a72562b3c29f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Matti Paaso <matti.paaso@qt.io>
Diffstat (limited to 'src/plugins/platforms/mirclient/qmirclientcursor.cpp')
-rw-r--r-- | src/plugins/platforms/mirclient/qmirclientcursor.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/plugins/platforms/mirclient/qmirclientcursor.cpp b/src/plugins/platforms/mirclient/qmirclientcursor.cpp index a0da3fdd77..812cde95c6 100644 --- a/src/plugins/platforms/mirclient/qmirclientcursor.cpp +++ b/src/plugins/platforms/mirclient/qmirclientcursor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 Canonical, Ltd. +** Copyright (C) 2015-2016 Canonical, Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -45,35 +45,41 @@ #include <mir_toolkit/mir_client_library.h> +Q_LOGGING_CATEGORY(mirclientCursor, "qt.qpa.mirclient.cursor", QtWarningMsg) + QMirClientCursor::QMirClientCursor(MirConnection *connection) : mConnection(connection) { - mShapeToCursorName[Qt::ArrowCursor] = "left_ptr"; + /* + * TODO: Add the missing cursors to Mir (LP: #1388987) + * Those are the ones without a mir_ prefix, which are X11 cursors + * and won't be understood by any shell other than Unity8. + */ + mShapeToCursorName[Qt::ArrowCursor] = mir_arrow_cursor_name; mShapeToCursorName[Qt::UpArrowCursor] = "up_arrow"; - mShapeToCursorName[Qt::CrossCursor] = "cross"; - mShapeToCursorName[Qt::WaitCursor] = "watch"; - mShapeToCursorName[Qt::IBeamCursor] = "xterm"; - mShapeToCursorName[Qt::SizeVerCursor] = "size_ver"; - mShapeToCursorName[Qt::SizeHorCursor] = "size_hor"; - mShapeToCursorName[Qt::SizeBDiagCursor] = "size_bdiag"; - mShapeToCursorName[Qt::SizeFDiagCursor] = "size_fdiag"; - mShapeToCursorName[Qt::SizeAllCursor] = "size_all"; - mShapeToCursorName[Qt::BlankCursor] = "blank"; - mShapeToCursorName[Qt::SplitVCursor] = "split_v"; - mShapeToCursorName[Qt::SplitHCursor] = "split_h"; - mShapeToCursorName[Qt::PointingHandCursor] = "hand"; + mShapeToCursorName[Qt::CrossCursor] = mir_crosshair_cursor_name; + mShapeToCursorName[Qt::WaitCursor] = mir_busy_cursor_name; + mShapeToCursorName[Qt::IBeamCursor] = mir_caret_cursor_name; + mShapeToCursorName[Qt::SizeVerCursor] = mir_vertical_resize_cursor_name; + mShapeToCursorName[Qt::SizeHorCursor] = mir_horizontal_resize_cursor_name; + mShapeToCursorName[Qt::SizeBDiagCursor] = mir_diagonal_resize_bottom_to_top_cursor_name; + mShapeToCursorName[Qt::SizeFDiagCursor] = mir_diagonal_resize_top_to_bottom_cursor_name; + mShapeToCursorName[Qt::SizeAllCursor] = mir_omnidirectional_resize_cursor_name; + mShapeToCursorName[Qt::BlankCursor] = mir_disabled_cursor_name; + mShapeToCursorName[Qt::SplitVCursor] = mir_vsplit_resize_cursor_name; + mShapeToCursorName[Qt::SplitHCursor] = mir_hsplit_resize_cursor_name; + mShapeToCursorName[Qt::PointingHandCursor] = mir_pointing_hand_cursor_name; mShapeToCursorName[Qt::ForbiddenCursor] = "forbidden"; mShapeToCursorName[Qt::WhatsThisCursor] = "whats_this"; mShapeToCursorName[Qt::BusyCursor] = "left_ptr_watch"; - mShapeToCursorName[Qt::OpenHandCursor] = "openhand"; - mShapeToCursorName[Qt::ClosedHandCursor] = "closedhand"; + mShapeToCursorName[Qt::OpenHandCursor] = mir_open_hand_cursor_name; + mShapeToCursorName[Qt::ClosedHandCursor] = mir_closed_hand_cursor_name; mShapeToCursorName[Qt::DragCopyCursor] = "dnd-copy"; mShapeToCursorName[Qt::DragMoveCursor] = "dnd-move"; mShapeToCursorName[Qt::DragLinkCursor] = "dnd-link"; } namespace { -#if !defined(QT_NO_DEBUG) const char *qtCursorShapeToStr(Qt::CursorShape shape) { switch (shape) { @@ -127,7 +133,6 @@ const char *qtCursorShapeToStr(Qt::CursorShape shape) return "???"; } } -#endif // !defined(QT_NO_DEBUG) } // anonymous namespace void QMirClientCursor::changeCursor(QCursor *windowCursor, QWindow *window) @@ -144,7 +149,7 @@ void QMirClientCursor::changeCursor(QCursor *windowCursor, QWindow *window) if (windowCursor) { - DLOG("[ubuntumirclient QPA] changeCursor shape=%s, window=%p\n", qtCursorShapeToStr(windowCursor->shape()), window); + qCDebug(mirclientCursor, "changeCursor shape=%s, window=%p", qtCursorShapeToStr(windowCursor->shape()), window); if (!windowCursor->pixmap().isNull()) { configureMirCursorWithPixmapQCursor(surface, *windowCursor); } else if (windowCursor->shape() == Qt::BitmapCursor) { |