Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show All 28 Lines | |||||
29 | #include "virtualdesktops.h" | 29 | #include "virtualdesktops.h" | ||
30 | #include "workspace.h" | 30 | #include "workspace.h" | ||
31 | #include "decorations/decorationbridge.h" | 31 | #include "decorations/decorationbridge.h" | ||
32 | #include "decorations/decoratedclient.h" | 32 | #include "decorations/decoratedclient.h" | ||
33 | #include <KDecoration2/Decoration> | 33 | #include <KDecoration2/Decoration> | ||
34 | #include <KDecoration2/DecoratedClient> | 34 | #include <KDecoration2/DecoratedClient> | ||
35 | 35 | | |||
36 | #include <KWayland/Client/surface.h> | 36 | #include <KWayland/Client/surface.h> | ||
37 | #include <KWayland/Server/clientconnection.h> | ||||
37 | #include <KWayland/Server/seat_interface.h> | 38 | #include <KWayland/Server/seat_interface.h> | ||
38 | #include <KWayland/Server/shell_interface.h> | 39 | #include <KWayland/Server/shell_interface.h> | ||
39 | #include <KWayland/Server/surface_interface.h> | 40 | #include <KWayland/Server/surface_interface.h> | ||
40 | #include <KWayland/Server/buffer_interface.h> | 41 | #include <KWayland/Server/buffer_interface.h> | ||
41 | #include <KWayland/Server/plasmashell_interface.h> | 42 | #include <KWayland/Server/plasmashell_interface.h> | ||
42 | #include <KWayland/Server/shadow_interface.h> | 43 | #include <KWayland/Server/shadow_interface.h> | ||
43 | #include <KWayland/Server/server_decoration_interface.h> | 44 | #include <KWayland/Server/server_decoration_interface.h> | ||
44 | #include <KWayland/Server/qtsurfaceextension_interface.h> | 45 | #include <KWayland/Server/qtsurfaceextension_interface.h> | ||
45 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | 46 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | ||
46 | #include <KDesktopFile> | 47 | #include <KDesktopFile> | ||
47 | 48 | | |||
48 | #include <QOpenGLFramebufferObject> | 49 | #include <QOpenGLFramebufferObject> | ||
49 | #include <QWindow> | 50 | #include <QWindow> | ||
50 | 51 | | |||
52 | #include <sys/types.h> | ||||
53 | #include <unistd.h> | ||||
54 | #include <signal.h> | ||||
55 | | ||||
51 | using namespace KWayland::Server; | 56 | using namespace KWayland::Server; | ||
52 | 57 | | |||
53 | static const QByteArray s_schemePropertyName = QByteArrayLiteral("KDE_COLOR_SCHEME_PATH"); | 58 | static const QByteArray s_schemePropertyName = QByteArrayLiteral("KDE_COLOR_SCHEME_PATH"); | ||
54 | 59 | | |||
55 | namespace KWin | 60 | namespace KWin | ||
56 | { | 61 | { | ||
57 | 62 | | |||
58 | ShellClient::ShellClient(ShellSurfaceInterface *surface) | 63 | ShellClient::ShellClient(ShellSurfaceInterface *surface) | ||
▲ Show 20 Lines • Show All 1316 Lines • ▼ Show 20 Line(s) | 1379 | { | |||
1375 | if (m_plasmaShellSurface) { | 1380 | if (m_plasmaShellSurface) { | ||
1376 | if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Panel) { | 1381 | if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Panel) { | ||
1377 | return m_plasmaShellSurface->panelTakesFocus(); | 1382 | return m_plasmaShellSurface->panelTakesFocus(); | ||
1378 | } | 1383 | } | ||
1379 | } | 1384 | } | ||
1380 | return false; | 1385 | return false; | ||
1381 | } | 1386 | } | ||
1382 | 1387 | | |||
1388 | void ShellClient::killWindow() | ||||
1389 | { | ||||
1390 | if (isInternal()) { | ||||
1391 | return; | ||||
1392 | } | ||||
1393 | if (!surface()) { | ||||
1394 | return; | ||||
1395 | } | ||||
1396 | auto c = surface()->client(); | ||||
1397 | if (c->processId() == getpid()) { | ||||
1398 | c->destroy(); | ||||
1399 | return; | ||||
1400 | } | ||||
1401 | ::kill(c->processId(), SIGTERM); | ||||
1402 | // give it time to terminate and only if terminate fails, try destroy Wayland connection | ||||
1403 | QTimer::singleShot(5000, c, &ClientConnection::destroy); | ||||
1404 | } | ||||
1405 | | ||||
1383 | } | 1406 | } |