Changeset View
Changeset View
Standalone View
Standalone View
debug_console.cpp
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "debug_console.h" | 20 | #include "debug_console.h" | ||
21 | #include "composite.h" | 21 | #include "composite.h" | ||
22 | #include "client.h" | 22 | #include "client.h" | ||
23 | #include "input_event.h" | 23 | #include "input_event.h" | ||
24 | #include "internal_client.h" | 24 | #include "internal_client.h" | ||
25 | #include "main.h" | 25 | #include "main.h" | ||
26 | #include "scene.h" | 26 | #include "scene.h" | ||
27 | #include "shell_client.h" | 27 | #include "xdgshellclient.h" | ||
28 | #include "unmanaged.h" | 28 | #include "unmanaged.h" | ||
29 | #include "wayland_server.h" | 29 | #include "wayland_server.h" | ||
30 | #include "workspace.h" | 30 | #include "workspace.h" | ||
31 | #include "keyboard_input.h" | 31 | #include "keyboard_input.h" | ||
32 | #include "libinput/connection.h" | 32 | #include "libinput/connection.h" | ||
33 | #include "libinput/device.h" | 33 | #include "libinput/device.h" | ||
34 | #include <kwinglplatform.h> | 34 | #include <kwinglplatform.h> | ||
35 | #include <kwinglutils.h> | 35 | #include <kwinglutils.h> | ||
▲ Show 20 Lines • Show All 757 Lines • ▼ Show 20 Line(s) | |||||
793 | { | 793 | { | ||
794 | if (waylandServer()) { | 794 | if (waylandServer()) { | ||
795 | const auto clients = waylandServer()->clients(); | 795 | const auto clients = waylandServer()->clients(); | ||
796 | for (auto c : clients) { | 796 | for (auto c : clients) { | ||
797 | m_shellClients.append(c); | 797 | m_shellClients.append(c); | ||
798 | } | 798 | } | ||
799 | // TODO: that only includes windows getting shown, not those which are only created | 799 | // TODO: that only includes windows getting shown, not those which are only created | ||
800 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, | 800 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, | ||
801 | [this] (ShellClient *c) { | 801 | [this] (XdgShellClient *c) { | ||
802 | add(s_waylandClientId -1, m_shellClients, c); | 802 | add(s_waylandClientId -1, m_shellClients, c); | ||
803 | } | 803 | } | ||
804 | ); | 804 | ); | ||
805 | connect(waylandServer(), &WaylandServer::shellClientRemoved, this, | 805 | connect(waylandServer(), &WaylandServer::shellClientRemoved, this, | ||
806 | [this] (ShellClient *c) { | 806 | [this] (XdgShellClient *c) { | ||
807 | remove(s_waylandClientId -1, m_shellClients, c); | 807 | remove(s_waylandClientId -1, m_shellClients, c); | ||
808 | } | 808 | } | ||
809 | ); | 809 | ); | ||
810 | } | 810 | } | ||
811 | const auto x11Clients = workspace()->clientList(); | 811 | const auto x11Clients = workspace()->clientList(); | ||
812 | for (auto c : x11Clients) { | 812 | for (auto c : x11Clients) { | ||
813 | m_x11Clients.append(c); | 813 | m_x11Clients.append(c); | ||
814 | } | 814 | } | ||
▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Line(s) | 1094 | if (!index.parent().isValid()) { | |||
1108 | default: | 1108 | default: | ||
1109 | return QVariant(); | 1109 | return QVariant(); | ||
1110 | } | 1110 | } | ||
1111 | } | 1111 | } | ||
1112 | if (index.internalId() & s_propertyBitMask) { | 1112 | if (index.internalId() & s_propertyBitMask) { | ||
1113 | if (index.column() >= 2 || role != Qt::DisplayRole) { | 1113 | if (index.column() >= 2 || role != Qt::DisplayRole) { | ||
1114 | return QVariant(); | 1114 | return QVariant(); | ||
1115 | } | 1115 | } | ||
1116 | if (ShellClient *c = shellClient(index)) { | 1116 | if (XdgShellClient *c = shellClient(index)) { | ||
1117 | return propertyData(c, index, role); | 1117 | return propertyData(c, index, role); | ||
1118 | } else if (InternalClient *c = internalClient(index)) { | 1118 | } else if (InternalClient *c = internalClient(index)) { | ||
1119 | return propertyData(c, index, role); | 1119 | return propertyData(c, index, role); | ||
1120 | } else if (Client *c = x11Client(index)) { | 1120 | } else if (Client *c = x11Client(index)) { | ||
1121 | return propertyData(c, index, role); | 1121 | return propertyData(c, index, role); | ||
1122 | } else if (Unmanaged *u = unmanaged(index)) { | 1122 | } else if (Unmanaged *u = unmanaged(index)) { | ||
1123 | return propertyData(u, index, role); | 1123 | return propertyData(u, index, role); | ||
1124 | } | 1124 | } | ||
Show All 31 Lines | |||||
1156 | { | 1156 | { | ||
1157 | const qint32 row = (index.internalId() & s_clientBitMask) - (s_idDistance * id); | 1157 | const qint32 row = (index.internalId() & s_clientBitMask) - (s_idDistance * id); | ||
1158 | if (row < 0 || row >= clients.count()) { | 1158 | if (row < 0 || row >= clients.count()) { | ||
1159 | return nullptr; | 1159 | return nullptr; | ||
1160 | } | 1160 | } | ||
1161 | return clients.at(row); | 1161 | return clients.at(row); | ||
1162 | } | 1162 | } | ||
1163 | 1163 | | |||
1164 | ShellClient *DebugConsoleModel::shellClient(const QModelIndex &index) const | 1164 | XdgShellClient *DebugConsoleModel::shellClient(const QModelIndex &index) const | ||
1165 | { | 1165 | { | ||
1166 | return clientForIndex(index, m_shellClients, s_waylandClientId); | 1166 | return clientForIndex(index, m_shellClients, s_waylandClientId); | ||
1167 | } | 1167 | } | ||
1168 | 1168 | | |||
1169 | InternalClient *DebugConsoleModel::internalClient(const QModelIndex &index) const | 1169 | InternalClient *DebugConsoleModel::internalClient(const QModelIndex &index) const | ||
1170 | { | 1170 | { | ||
1171 | return clientForIndex(index, m_internalClients, s_workspaceInternalId); | 1171 | return clientForIndex(index, m_internalClients, s_workspaceInternalId); | ||
1172 | } | 1172 | } | ||
Show All 35 Lines | 1187 | { | |||
1208 | for (auto c : workspace()->desktopList()) { | 1208 | for (auto c : workspace()->desktopList()) { | ||
1209 | if (!c->surface()) { | 1209 | if (!c->surface()) { | ||
1210 | continue; | 1210 | continue; | ||
1211 | } | 1211 | } | ||
1212 | connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); | 1212 | connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); | ||
1213 | } | 1213 | } | ||
1214 | if (waylandServer()) { | 1214 | if (waylandServer()) { | ||
1215 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, | 1215 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, | ||
1216 | [this, reset] (ShellClient *c) { | 1216 | [this, reset] (XdgShellClient *c) { | ||
1217 | connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); | 1217 | connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); | ||
1218 | reset(); | 1218 | reset(); | ||
1219 | } | 1219 | } | ||
1220 | ); | 1220 | ); | ||
1221 | } | 1221 | } | ||
1222 | connect(workspace(), &Workspace::clientAdded, this, | 1222 | connect(workspace(), &Workspace::clientAdded, this, | ||
1223 | [this, reset] (AbstractClient *c) { | 1223 | [this, reset] (AbstractClient *c) { | ||
1224 | if (c->surface()) { | 1224 | if (c->surface()) { | ||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |