Changeset View
Changeset View
Standalone View
Standalone View
xdgshellclient.cpp
Show All 30 Lines | |||||
31 | #include "tabbox.h" | 31 | #include "tabbox.h" | ||
32 | #endif | 32 | #endif | ||
33 | #include "virtualdesktops.h" | 33 | #include "virtualdesktops.h" | ||
34 | #include "wayland_server.h" | 34 | #include "wayland_server.h" | ||
35 | #include "workspace.h" | 35 | #include "workspace.h" | ||
36 | 36 | | |||
37 | #include <KDecoration2/DecoratedClient> | 37 | #include <KDecoration2/DecoratedClient> | ||
38 | #include <KDecoration2/Decoration> | 38 | #include <KDecoration2/Decoration> | ||
39 | #include <KWayland/Server/appmenu_interface.h> | 39 | #include <KWaylandServer/appmenu_interface.h> | ||
40 | #include <KWayland/Server/buffer_interface.h> | 40 | #include <KWaylandServer/buffer_interface.h> | ||
41 | #include <KWayland/Server/clientconnection.h> | 41 | #include <KWaylandServer/clientconnection.h> | ||
42 | #include <KWayland/Server/display.h> | 42 | #include <KWaylandServer/display.h> | ||
43 | #include <KWayland/Server/plasmashell_interface.h> | 43 | #include <KWaylandServer/plasmashell_interface.h> | ||
44 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | 44 | #include <KWaylandServer/plasmawindowmanagement_interface.h> | ||
45 | #include <KWayland/Server/qtsurfaceextension_interface.h> | 45 | #include <KWaylandServer/qtsurfaceextension_interface.h> | ||
46 | #include <KWayland/Server/seat_interface.h> | 46 | #include <KWaylandServer/seat_interface.h> | ||
47 | #include <KWayland/Server/server_decoration_interface.h> | 47 | #include <KWaylandServer/server_decoration_interface.h> | ||
48 | #include <KWayland/Server/server_decoration_palette_interface.h> | 48 | #include <KWaylandServer/server_decoration_palette_interface.h> | ||
49 | #include <KWayland/Server/shadow_interface.h> | 49 | #include <KWaylandServer/shadow_interface.h> | ||
50 | #include <KWayland/Server/surface_interface.h> | 50 | #include <KWaylandServer/surface_interface.h> | ||
51 | #include <KWayland/Server/xdgdecoration_interface.h> | 51 | #include <KWaylandServer/xdgdecoration_interface.h> | ||
52 | 52 | | |||
53 | #include <QFileInfo> | 53 | #include <QFileInfo> | ||
54 | 54 | | |||
55 | #include <sys/types.h> | 55 | #include <sys/types.h> | ||
56 | #include <unistd.h> | 56 | #include <unistd.h> | ||
57 | 57 | | |||
58 | #include <csignal> | 58 | #include <csignal> | ||
59 | 59 | | |||
60 | Q_DECLARE_METATYPE(NET::WindowType) | 60 | Q_DECLARE_METATYPE(NET::WindowType) | ||
61 | 61 | | |||
62 | using namespace KWayland::Server; | 62 | using namespace KWaylandServer; | ||
63 | 63 | | |||
64 | namespace KWin | 64 | namespace KWin | ||
65 | { | 65 | { | ||
66 | 66 | | |||
67 | XdgShellClient::XdgShellClient(XdgShellSurfaceInterface *surface) | 67 | XdgShellClient::XdgShellClient(XdgShellSurfaceInterface *surface) | ||
68 | : AbstractClient() | 68 | : AbstractClient() | ||
69 | , m_xdgShellToplevel(surface) | 69 | , m_xdgShellToplevel(surface) | ||
70 | , m_xdgShellPopup(nullptr) | 70 | , m_xdgShellPopup(nullptr) | ||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 88 | { | |||
163 | 163 | | |||
164 | // set initial desktop | 164 | // set initial desktop | ||
165 | setDesktop(VirtualDesktopManager::self()->current()); | 165 | setDesktop(VirtualDesktopManager::self()->current()); | ||
166 | 166 | | |||
167 | // setup shadow integration | 167 | // setup shadow integration | ||
168 | updateShadow(); | 168 | updateShadow(); | ||
169 | connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::updateShadow); | 169 | connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::updateShadow); | ||
170 | 170 | | |||
171 | connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) { | 171 | connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWaylandServer::SurfaceInterface *child) { | ||
172 | if (child == surface()) { | 172 | if (child == surface()) { | ||
173 | handleTransientForChanged(); | 173 | handleTransientForChanged(); | ||
174 | } | 174 | } | ||
175 | }); | 175 | }); | ||
176 | handleTransientForChanged(); | 176 | handleTransientForChanged(); | ||
177 | 177 | | |||
178 | AbstractClient::updateColorScheme(QString()); | 178 | AbstractClient::updateColorScheme(QString()); | ||
179 | 179 | | |||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Line(s) | 444 | { | |||
450 | blockGeometryUpdates(true); | 450 | blockGeometryUpdates(true); | ||
451 | if (force) | 451 | if (force) | ||
452 | destroyDecoration(); | 452 | destroyDecoration(); | ||
453 | if (!noBorder()) { | 453 | if (!noBorder()) { | ||
454 | createDecoration(oldgeom); | 454 | createDecoration(oldgeom); | ||
455 | } else | 455 | } else | ||
456 | destroyDecoration(); | 456 | destroyDecoration(); | ||
457 | if (m_serverDecoration && isDecorated()) { | 457 | if (m_serverDecoration && isDecorated()) { | ||
458 | m_serverDecoration->setMode(KWayland::Server::ServerSideDecorationManagerInterface::Mode::Server); | 458 | m_serverDecoration->setMode(KWaylandServer::ServerSideDecorationManagerInterface::Mode::Server); | ||
459 | } | 459 | } | ||
460 | if (m_xdgDecoration) { | 460 | if (m_xdgDecoration) { | ||
461 | auto mode = isDecorated() || m_userNoBorder ? XdgDecorationInterface::Mode::ServerSide: XdgDecorationInterface::Mode::ClientSide; | 461 | auto mode = isDecorated() || m_userNoBorder ? XdgDecorationInterface::Mode::ServerSide: XdgDecorationInterface::Mode::ClientSide; | ||
462 | m_xdgDecoration->configure(mode); | 462 | m_xdgDecoration->configure(mode); | ||
463 | if (m_requestGeometryBlockCounter == 0) { | 463 | if (m_requestGeometryBlockCounter == 0) { | ||
464 | m_xdgShellToplevel->configure(xdgSurfaceStates(), m_requestedClientSize); | 464 | m_xdgShellToplevel->configure(xdgSurfaceStates(), m_requestedClientSize); | ||
465 | } | 465 | } | ||
466 | } | 466 | } | ||
▲ Show 20 Lines • Show All 1319 Lines • ▼ Show 20 Line(s) | |||||
1786 | 1786 | | |||
1787 | QMatrix4x4 XdgShellClient::inputTransformation() const | 1787 | QMatrix4x4 XdgShellClient::inputTransformation() const | ||
1788 | { | 1788 | { | ||
1789 | QMatrix4x4 matrix; | 1789 | QMatrix4x4 matrix; | ||
1790 | matrix.translate(-m_bufferGeometry.x(), -m_bufferGeometry.y()); | 1790 | matrix.translate(-m_bufferGeometry.x(), -m_bufferGeometry.y()); | ||
1791 | return matrix; | 1791 | return matrix; | ||
1792 | } | 1792 | } | ||
1793 | 1793 | | |||
1794 | void XdgShellClient::installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *deco) | 1794 | void XdgShellClient::installServerSideDecoration(KWaylandServer::ServerSideDecorationInterface *deco) | ||
1795 | { | 1795 | { | ||
1796 | if (m_serverDecoration == deco) { | 1796 | if (m_serverDecoration == deco) { | ||
1797 | return; | 1797 | return; | ||
1798 | } | 1798 | } | ||
1799 | m_serverDecoration = deco; | 1799 | m_serverDecoration = deco; | ||
1800 | connect(m_serverDecoration, &ServerSideDecorationInterface::destroyed, this, | 1800 | connect(m_serverDecoration, &ServerSideDecorationInterface::destroyed, this, | ||
1801 | [this] { | 1801 | [this] { | ||
1802 | m_serverDecoration = nullptr; | 1802 | m_serverDecoration = nullptr; | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 1850 | if (isLockScreen()) { | |||
1851 | return false; | 1851 | return false; | ||
1852 | } | 1852 | } | ||
1853 | if (m_xdgShellPopup) { | 1853 | if (m_xdgShellPopup) { | ||
1854 | return false; | 1854 | return false; | ||
1855 | } | 1855 | } | ||
1856 | return true; | 1856 | return true; | ||
1857 | } | 1857 | } | ||
1858 | 1858 | | |||
1859 | KWayland::Server::XdgShellSurfaceInterface::States XdgShellClient::xdgSurfaceStates() const | 1859 | KWaylandServer::XdgShellSurfaceInterface::States XdgShellClient::xdgSurfaceStates() const | ||
1860 | { | 1860 | { | ||
1861 | XdgShellSurfaceInterface::States states; | 1861 | XdgShellSurfaceInterface::States states; | ||
1862 | if (isActive()) { | 1862 | if (isActive()) { | ||
1863 | states |= XdgShellSurfaceInterface::State::Activated; | 1863 | states |= XdgShellSurfaceInterface::State::Activated; | ||
1864 | } | 1864 | } | ||
1865 | if (isFullScreen()) { | 1865 | if (isFullScreen()) { | ||
1866 | states |= XdgShellSurfaceInterface::State::Fullscreen; | 1866 | states |= XdgShellSurfaceInterface::State::Fullscreen; | ||
1867 | } | 1867 | } | ||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |