Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show All 22 Lines | |||||
23 | #include "deleted.h" | 23 | #include "deleted.h" | ||
24 | #include "placement.h" | 24 | #include "placement.h" | ||
25 | #include "screenedge.h" | 25 | #include "screenedge.h" | ||
26 | #include "screens.h" | 26 | #include "screens.h" | ||
27 | #include "wayland_server.h" | 27 | #include "wayland_server.h" | ||
28 | #include "workspace.h" | 28 | #include "workspace.h" | ||
29 | #include "virtualdesktops.h" | 29 | #include "virtualdesktops.h" | ||
30 | #include "workspace.h" | 30 | #include "workspace.h" | ||
31 | #include "screens.h" | ||||
31 | #include "decorations/decorationbridge.h" | 32 | #include "decorations/decorationbridge.h" | ||
32 | #include "decorations/decoratedclient.h" | 33 | #include "decorations/decoratedclient.h" | ||
33 | #include <KDecoration2/Decoration> | 34 | #include <KDecoration2/Decoration> | ||
34 | #include <KDecoration2/DecoratedClient> | 35 | #include <KDecoration2/DecoratedClient> | ||
35 | 36 | | |||
36 | #include <KWayland/Client/surface.h> | 37 | #include <KWayland/Client/surface.h> | ||
38 | #include <KWayland/Server/display.h> | ||||
37 | #include <KWayland/Server/clientconnection.h> | 39 | #include <KWayland/Server/clientconnection.h> | ||
38 | #include <KWayland/Server/seat_interface.h> | 40 | #include <KWayland/Server/seat_interface.h> | ||
39 | #include <KWayland/Server/shell_interface.h> | 41 | #include <KWayland/Server/shell_interface.h> | ||
40 | #include <KWayland/Server/surface_interface.h> | 42 | #include <KWayland/Server/surface_interface.h> | ||
41 | #include <KWayland/Server/buffer_interface.h> | 43 | #include <KWayland/Server/buffer_interface.h> | ||
42 | #include <KWayland/Server/plasmashell_interface.h> | 44 | #include <KWayland/Server/plasmashell_interface.h> | ||
43 | #include <KWayland/Server/shadow_interface.h> | 45 | #include <KWayland/Server/shadow_interface.h> | ||
44 | #include <KWayland/Server/server_decoration_interface.h> | 46 | #include <KWayland/Server/server_decoration_interface.h> | ||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 166 | [this] (bool maximized) { | |||
168 | } | 170 | } | ||
169 | maximize(maximized ? MaximizeFull : MaximizeRestore); | 171 | maximize(maximized ? MaximizeFull : MaximizeRestore); | ||
170 | } | 172 | } | ||
171 | ); | 173 | ); | ||
172 | // TODO: consider output! | 174 | // TODO: consider output! | ||
173 | connect(shellSurface, &T::fullscreenChanged, this, &ShellClient::clientFullScreenChanged); | 175 | connect(shellSurface, &T::fullscreenChanged, this, &ShellClient::clientFullScreenChanged); | ||
174 | 176 | | |||
175 | connect(shellSurface, &T::transientForChanged, this, &ShellClient::setTransient); | 177 | connect(shellSurface, &T::transientForChanged, this, &ShellClient::setTransient); | ||
178 | | ||||
179 | connect(this, &ShellClient::geometryChanged, this, &ShellClient::updateClientOutputs); | ||||
180 | connect(screens(), &Screens::changed, this, &ShellClient::updateClientOutputs); | ||||
176 | } | 181 | } | ||
177 | 182 | | |||
178 | void ShellClient::init() | 183 | void ShellClient::init() | ||
179 | { | 184 | { | ||
180 | connect(this, &ShellClient::desktopFileNameChanged, this, &ShellClient::updateIcon); | 185 | connect(this, &ShellClient::desktopFileNameChanged, this, &ShellClient::updateIcon); | ||
181 | findInternalWindow(); | 186 | findInternalWindow(); | ||
182 | createWindowId(); | 187 | createWindowId(); | ||
183 | setupCompositing(); | 188 | setupCompositing(); | ||
▲ Show 20 Lines • Show All 1333 Lines • ▼ Show 20 Line(s) | |||||
1517 | 1522 | | |||
1518 | void ShellClient::popupDone() | 1523 | void ShellClient::popupDone() | ||
1519 | { | 1524 | { | ||
1520 | if (m_shellSurface) { | 1525 | if (m_shellSurface) { | ||
1521 | m_shellSurface->popupDone(); | 1526 | m_shellSurface->popupDone(); | ||
1522 | } | 1527 | } | ||
1523 | } | 1528 | } | ||
1524 | 1529 | | |||
1530 | void ShellClient::updateClientOutputs() | ||||
1531 | { | ||||
1532 | QVector<OutputInterface*> clientOutputs; | ||||
1533 | const auto outputs = waylandServer()->display()->outputs(); | ||||
graesslin: two minor comments here: qAsConst and a whitespace after for :-) | |||||
1534 | for (OutputInterface* output: qAsConst(outputs)) { | ||||
1535 | const QRect outputGeom(output->globalPosition(), output->pixelSize() / output->scale()); | ||||
1536 | if (geometry().intersects(outputGeom)) { | ||||
1537 | clientOutputs << output; | ||||
1538 | } | ||||
1539 | } | ||||
1540 | surface()->setOutputs(clientOutputs); | ||||
1541 | } | ||||
1542 | | ||||
1525 | } | 1543 | } |
two minor comments here: qAsConst and a whitespace after for :-)