Merge remote-tracking branch 'origin/5.12' into dev

Change-Id: Ib4c65db63c2f3119fc7c157d4353c4e0ecebefb0
This commit is contained in:
Qt Forward Merge Bot 2018-10-09 15:30:02 +02:00
commit 9d082d91f3
5 changed files with 27 additions and 13 deletions

View File

@ -72,9 +72,6 @@ void QWaylandXdgSurfaceV6::Toplevel::applyConfigure()
if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen)))
m_normalSize = m_xdgSurface->m_window->window()->frameGeometry().size();
if (m_pending.size.isEmpty() && !m_normalSize.isEmpty())
m_pending.size = m_normalSize;
if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive))
m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window);
@ -85,10 +82,20 @@ void QWaylandXdgSurfaceV6::Toplevel::applyConfigure()
Qt::WindowStates statesWithoutActive = m_pending.states & ~Qt::WindowActive;
m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive);
m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
if (m_pending.size.isEmpty()) {
// An empty size in the configure means it's up to the client to choose the size
bool normalPending = !(m_pending.states & (Qt::WindowMaximized|Qt::WindowFullScreen));
if (normalPending && !m_normalSize.isEmpty())
m_xdgSurface->m_window->resizeFromApplyConfigure(m_normalSize);
} else {
m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
}
QSize windowGeometrySize = m_xdgSurface->m_window->window()->frameGeometry().size();
m_xdgSurface->set_window_geometry(0, 0, windowGeometrySize.width(), windowGeometrySize.height());
m_applied = m_pending;
qCDebug(lcQpaWayland) << "Applied pending zxdg_toplevel_v6 configure event:" << m_applied.size << m_applied.states;
}
void QWaylandXdgSurfaceV6::Toplevel::zxdg_toplevel_v6_configure(int32_t width, int32_t height, wl_array *states)

View File

@ -82,9 +82,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure()
if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen)))
m_normalSize = m_xdgSurface->m_window->window()->frameGeometry().size();
if (m_pending.size.isEmpty() && !m_normalSize.isEmpty())
m_pending.size = m_normalSize;
if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive))
m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window);
@ -95,10 +92,20 @@ void QWaylandXdgSurface::Toplevel::applyConfigure()
Qt::WindowStates statesWithoutActive = m_pending.states & ~Qt::WindowActive;
m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive);
m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
if (m_pending.size.isEmpty()) {
// An empty size in the configure means it's up to the client to choose the size
bool normalPending = !(m_pending.states & (Qt::WindowMaximized|Qt::WindowFullScreen));
if (normalPending && !m_normalSize.isEmpty())
m_xdgSurface->m_window->resizeFromApplyConfigure(m_normalSize);
} else {
m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
}
QSize windowGeometrySize = m_xdgSurface->m_window->window()->frameGeometry().size();
m_xdgSurface->set_window_geometry(0, 0, windowGeometrySize.width(), windowGeometrySize.height());
m_applied = m_pending;
qCDebug(lcQpaWayland) << "Applied pending xdg_toplevel configure event:" << m_applied.size << m_applied.states;
}
bool QWaylandXdgSurface::Toplevel::wantsDecorations()

View File

@ -529,9 +529,10 @@ void QWaylandDisplay::setCursor(const QSharedPointer<QWaylandBuffer> &buffer, co
QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(qreal devicePixelRatio)
{
static int cursorSize = qEnvironmentVariableIntValue("XCURSOR_SIZE");
if (cursorSize <= 0)
cursorSize = 32;
constexpr int defaultCursorSize = 32;
static const int xCursorSize = qEnvironmentVariableIntValue("XCURSOR_SIZE");
int cursorSize = xCursorSize > 0 ? xCursorSize : defaultCursorSize;
if (compositorVersion() >= 3) // set_buffer_scale is not supported on earlier versions
cursorSize *= devicePixelRatio;

View File

@ -297,7 +297,6 @@ void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device)
QWaylandDataDevice *QWaylandInputDevice::dataDevice() const
{
Q_ASSERT(mDataDevice);
return mDataDevice;
}
#endif

View File

@ -343,7 +343,7 @@ void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, cons
QMargins margins = frameMargins();
int widthWithoutMargins = qMax(sizeWithMargins.width() - (margins.left()+margins.right()), 1);
int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top()+margins.bottom()), 1);
QRect geometry(QPoint(), QSize(widthWithoutMargins, heightWithoutMargins));
QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins));
mOffset += offset;
setGeometry(geometry);