kwin/waylandclient.h
Vlad Zahorodnii 31ea780d79 [wayland] Rework xdg-shell implementation
Summary:
This change splits the XdgShellClient class to better match existing
abstractions in the xdg-shell protocol and fix a few issues related to
sending configure events.

In the new client classes, configure events are handled differently.
Instead of blocking configure events, we try to send them as late as
possible. Delaying configure events will let us merge changeMaximize()
for X11 clients and Wayland clients and it also fixes the bug where
we don't send the final configure event when user has finished resizing
a window.

Given that configure events are not sent immediately, XdgSurfaceClient
keeps the last requested frame geometry and the last requested client
geometry.

This patch doesn't intend to fix all issues in kwin's implementation of
the xdg-shell protocol. For example, we still handle surface unmapping
very poorly.

Test Plan: Tests pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27861
2020-06-01 15:12:59 +03:00

71 lines
2.2 KiB
C++

/*
* Copyright (C) 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "abstract_client.h"
namespace KWin
{
class WaylandClient : public AbstractClient
{
Q_OBJECT
public:
WaylandClient(KWaylandServer::SurfaceInterface *surface);
QString captionNormal() const override;
QString captionSuffix() const override;
QStringList activities() const override;
void setOnAllActivities(bool set) override;
void blockActivityUpdates(bool b = true) override;
QPoint clientContentPos() const override;
QRect transparentRect() const override;
quint32 windowId() const override;
pid_t pid() const override;
bool isLockScreen() const override;
bool isInputMethod() const override;
bool isLocalhost() const override;
double opacity() const override;
void setOpacity(double opacity) override;
AbstractClient *findModal(bool allow_itself = false) override;
void resizeWithChecks(const QSize &size, ForceGeometry_t force = NormalGeometrySet) override;
void killWindow() override;
QByteArray windowRole() const override;
void setCaption(const QString &caption);
protected:
bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override;
bool belongsToDesktop() const override;
void doSetActive() override;
void updateCaption() override;
private:
void updateClientArea();
void updateClientOutputs();
void updateIcon();
void updateResourceName();
QString m_captionNormal;
QString m_captionSuffix;
double m_opacity = 1.0;
quint32 m_windowId;
};
} // namespace KWin