Merge "Merge remote-tracking branch 'origin/5.13' into dev"

This commit is contained in:
Qt Forward Merge Bot 2019-07-02 03:03:53 +02:00 committed by Johan Klokkhammer Helsing
commit a582ec32d1
2 changed files with 11 additions and 1 deletions

View File

@ -113,7 +113,10 @@ void QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon)
if (!origin) if (!origin)
origin = seat->touchFocus(); origin = seat->touchFocus();
start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial()); if (origin)
start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial());
else
qCDebug(lcQpaWayland) << "Couldn't start a drag because the origin window could not be found.";
} }
void QWaylandDataDevice::cancelDrag() void QWaylandDataDevice::cancelDrag()

View File

@ -279,6 +279,10 @@ void QWaylandInputDevice::Pointer::updateCursorTheme()
int pixelSize = cursorSize() * scale; int pixelSize = cursorSize() * scale;
auto *display = seat()->mQDisplay; auto *display = seat()->mQDisplay;
mCursor.theme = display->loadCursorTheme(cursorThemeName(), pixelSize); mCursor.theme = display->loadCursorTheme(cursorThemeName(), pixelSize);
if (!mCursor.theme)
return; // A warning has already been printed in loadCursorTheme
if (auto *arrow = mCursor.theme->cursorImage(Qt::ArrowCursor)) { if (auto *arrow = mCursor.theme->cursorImage(Qt::ArrowCursor)) {
int arrowPixelSize = qMax(arrow->width, arrow->height); // Not all cursor themes are square int arrowPixelSize = qMax(arrow->width, arrow->height); // Not all cursor themes are square
while (scale > 1 && arrowPixelSize / scale < cursorSize()) while (scale > 1 && arrowPixelSize / scale < cursorSize())
@ -317,6 +321,9 @@ void QWaylandInputDevice::Pointer::updateCursor()
if (!mCursor.theme || idealCursorScale() != mCursor.themeBufferScale) if (!mCursor.theme || idealCursorScale() != mCursor.themeBufferScale)
updateCursorTheme(); updateCursorTheme();
if (!mCursor.theme)
return;
// Set from shape using theme // Set from shape using theme
uint time = seat()->mCursor.animationTimer.elapsed(); uint time = seat()->mCursor.animationTimer.elapsed();
if (struct ::wl_cursor_image *image = mCursor.theme->cursorImage(shape, time)) { if (struct ::wl_cursor_image *image = mCursor.theme->cursorImage(shape, time)) {