Introduce geometry sync mode flags
The sync mode flags indicate in which fashion position and size update are made, i.e. synchronous or asynchronous.
This commit is contained in:
parent
7029d9c57c
commit
fde34f3c57
4 changed files with 33 additions and 0 deletions
|
@ -30,6 +30,8 @@ InputPanelV1Client::InputPanelV1Client(InputPanelSurfaceV1Interface *panelSurfac
|
|||
setSkipSwitcher(true);
|
||||
setSkipPager(true);
|
||||
setSkipTaskbar(true);
|
||||
setPositionSyncMode(SyncMode::Sync);
|
||||
setSizeSyncMode(SyncMode::Sync);
|
||||
setupCompositing();
|
||||
|
||||
connect(surface(), &SurfaceInterface::aboutToBeDestroyed, this, &InputPanelV1Client::destroyClient);
|
||||
|
|
|
@ -423,7 +423,17 @@ void WaylandClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
|||
requestGeometry(requestedFrameGeometry());
|
||||
} else {
|
||||
updateGeometry(requestedFrameGeometry());
|
||||
return;
|
||||
}
|
||||
|
||||
QRect updateRect = m_frameGeometry;
|
||||
if (m_positionSyncMode == SyncMode::Sync) {
|
||||
updateRect.moveTopLeft(requestedPos());
|
||||
}
|
||||
if (m_sizeSyncMode == SyncMode::Sync) {
|
||||
updateRect.setSize(requestedSize());
|
||||
}
|
||||
updateGeometry(updateRect);
|
||||
}
|
||||
|
||||
void WaylandClient::move(int x, int y, ForceGeometry_t force)
|
||||
|
@ -514,4 +524,14 @@ void WaylandClient::updateGeometry(const QRect &rect)
|
|||
addRepaintDuringGeometryUpdates();
|
||||
}
|
||||
|
||||
void WaylandClient::setPositionSyncMode(SyncMode syncMode)
|
||||
{
|
||||
m_positionSyncMode = syncMode;
|
||||
}
|
||||
|
||||
void WaylandClient::setSizeSyncMode(SyncMode syncMode)
|
||||
{
|
||||
m_sizeSyncMode = syncMode;
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
enum class SyncMode {
|
||||
Sync,
|
||||
Async,
|
||||
};
|
||||
|
||||
class WaylandClient : public AbstractClient
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -61,6 +66,8 @@ protected:
|
|||
void doSetActive() override;
|
||||
void updateCaption() override;
|
||||
|
||||
void setPositionSyncMode(SyncMode syncMode);
|
||||
void setSizeSyncMode(SyncMode syncMode);
|
||||
void cleanGrouping();
|
||||
|
||||
virtual void requestGeometry(const QRect &rect);
|
||||
|
@ -80,6 +87,8 @@ private:
|
|||
QRect m_requestedFrameGeometry;
|
||||
QRect m_bufferGeometry;
|
||||
QRect m_requestedClientGeometry;
|
||||
SyncMode m_positionSyncMode = SyncMode::Sync;
|
||||
SyncMode m_sizeSyncMode = SyncMode::Sync;
|
||||
quint32 m_windowId;
|
||||
bool m_isHidden = false;
|
||||
};
|
||||
|
|
|
@ -43,6 +43,8 @@ XdgSurfaceClient::XdgSurfaceClient(XdgSurfaceInterface *shellSurface)
|
|||
, m_shellSurface(shellSurface)
|
||||
, m_configureTimer(new QTimer(this))
|
||||
{
|
||||
setSizeSyncMode(SyncMode::Async);
|
||||
setPositionSyncMode(SyncMode::Async);
|
||||
setupCompositing();
|
||||
|
||||
connect(shellSurface, &XdgSurfaceInterface::configureAcknowledged,
|
||||
|
|
Loading…
Reference in a new issue