Commit 29a49f86 authored by David Edmundson's avatar David Edmundson

[wayland] Use pending maximize mode in decoration updates

Summary:
The change to make maximize mode asynchronous featured the comment

>Things are a bit complex with borders. Technically we
>shouldn't update them till we get a response, but we also need to have
>the correct geometry of the full size window in our request. For now
>they behave as before, updating when we request the change.

We call setNoBorder when we request the geometry but decoratedClient
also checks the maximise mode, in order to follow the scheme above we
need this to operate on the requested state not current state.

X is unaffected.

This fixes the borders being restored correct after maximize/restore.

Test Plan:
Chose a theme with visible borders
Maximised a window and back
They restored

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15991
parent d95b6548
...@@ -204,6 +204,11 @@ bool AbstractClient::isCurrentTab() const ...@@ -204,6 +204,11 @@ bool AbstractClient::isCurrentTab() const
return !tab_group || tab_group->current() == this; return !tab_group || tab_group->current() == this;
} }
MaximizeMode AbstractClient::requestedMaximizeMode() const
{
return maximizeMode();
}
xcb_timestamp_t AbstractClient::userTime() const xcb_timestamp_t AbstractClient::userTime() const
{ {
return XCB_TIME_CURRENT_TIME; return XCB_TIME_CURRENT_TIME;
......
...@@ -456,7 +456,16 @@ public: ...@@ -456,7 +456,16 @@ public:
*/ */
bool isCurrentTab() const; bool isCurrentTab() const;
virtual QRect geometryRestore() const = 0; virtual QRect geometryRestore() const = 0;
/**
* The currently applied maximize mode
*/
virtual MaximizeMode maximizeMode() const = 0; virtual MaximizeMode maximizeMode() const = 0;
/**
* The maximise mode requested by the server.
* For X this always matches maximizeMode, for wayland clients it
* is asyncronous
*/
virtual MaximizeMode requestedMaximizeMode() const;
void maximize(MaximizeMode); void maximize(MaximizeMode);
void setMaximize(bool vertically, bool horizontally); void setMaximize(bool vertically, bool horizontally);
virtual bool noBorder() const = 0; virtual bool noBorder() const = 0;
......
...@@ -271,7 +271,7 @@ int DecoratedClientImpl::height() const ...@@ -271,7 +271,7 @@ int DecoratedClientImpl::height() const
bool DecoratedClientImpl::isMaximizedVertically() const bool DecoratedClientImpl::isMaximizedVertically() const
{ {
return m_client->maximizeMode() & MaximizeVertical; return m_client->requestedMaximizeMode() & MaximizeVertical;
} }
bool DecoratedClientImpl::isMaximized() const bool DecoratedClientImpl::isMaximized() const
...@@ -281,7 +281,7 @@ bool DecoratedClientImpl::isMaximized() const ...@@ -281,7 +281,7 @@ bool DecoratedClientImpl::isMaximized() const
bool DecoratedClientImpl::isMaximizedHorizontally() const bool DecoratedClientImpl::isMaximizedHorizontally() const
{ {
return m_client->maximizeMode() & MaximizeHorizontal; return m_client->requestedMaximizeMode() & MaximizeHorizontal;
} }
Qt::Edges DecoratedClientImpl::adjacentScreenEdges() const Qt::Edges DecoratedClientImpl::adjacentScreenEdges() const
......
...@@ -914,6 +914,11 @@ MaximizeMode ShellClient::maximizeMode() const ...@@ -914,6 +914,11 @@ MaximizeMode ShellClient::maximizeMode() const
return m_maximizeMode; return m_maximizeMode;
} }
MaximizeMode ShellClient::requestedMaximizeMode() const
{
return m_requestedMaximizeMode;
}
bool ShellClient::noBorder() const bool ShellClient::noBorder() const
{ {
if (isInternal()) { if (isInternal()) {
......
...@@ -95,6 +95,8 @@ public: ...@@ -95,6 +95,8 @@ public:
} }
void hideClient(bool hide) override; void hideClient(bool hide) override;
MaximizeMode maximizeMode() const override; MaximizeMode maximizeMode() const override;
MaximizeMode requestedMaximizeMode() const override;
QRect geometryRestore() const override { QRect geometryRestore() const override {
return m_geomMaximizeRestore; return m_geomMaximizeRestore;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment