MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / HandleWindows

Function HandleWindows

Telegram/SourceFiles/core/external_control.cpp:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163[[nodiscard]] QByteArray HandleWindows() {
164 const auto active = App().activeWindow();
165 auto list = QJsonArray();
166 auto index = 0;
167 for (const auto &entry : CollectWindows()) {
168 auto object = QJsonObject();
169 object.insert(u"id"_q, index++);
170 object.insert(u"title"_q, entry.window->windowTitle());
171 object.insert(u"primary"_q, entry.controller->isPrimary());
172 object.insert(u"active"_q, (entry.controller.get() == active));
173 list.append(object);
174 }
175 auto object = QJsonObject();
176 object.insert(u"ok"_q, true);
177 object.insert(u"windows"_q, list);
178 return Pack(object);
179}
180
181[[nodiscard]] QByteArray HandleActivate(int index) {
182 const auto windows = CollectWindows();

Callers 1

HandleExternalControlFunction · 0.85

Calls 9

AppClass · 0.85
CollectWindowsFunction · 0.85
activeWindowMethod · 0.80
PackFunction · 0.70
QJsonObjectClass · 0.50
insertMethod · 0.45
isPrimaryMethod · 0.45
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected