KWayland

plasmawindowmanagement.cpp
1 /*
2  SPDX-FileCopyrightText: 2015 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #include "plasmawindowmanagement.h"
7 #include "event_queue.h"
8 #include "output.h"
9 #include "plasmavirtualdesktop.h"
10 #include "plasmawindowmodel.h"
11 #include "surface.h"
12 #include "wayland_pointer_p.h"
13 // Wayland
14 #include <wayland-plasma-window-management-client-protocol.h>
15 
16 #include <QFutureWatcher>
17 #include <QTimer>
18 #include <QtConcurrentRun>
19 #include <qplatformdefs.h>
20 
21 #include <cerrno>
22 
23 namespace KWayland
24 {
25 namespace Client
26 {
27 class Q_DECL_HIDDEN PlasmaWindowManagement::Private
28 {
29 public:
30  Private(PlasmaWindowManagement *q);
31  WaylandPointer<org_kde_plasma_window_management, org_kde_plasma_window_management_destroy> wm;
32  EventQueue *queue = nullptr;
33  bool showingDesktop = false;
34  QList<PlasmaWindow *> windows;
35  PlasmaWindow *activeWindow = nullptr;
36  QVector<quint32> stackingOrder;
37  QVector<QByteArray> stackingOrderUuids;
38 
39  void setup(org_kde_plasma_window_management *wm);
40 
41 private:
42  static void showDesktopCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t state);
43  static void windowCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t id);
44  static void windowWithUuidCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t id, const char *uuid);
45  static void stackingOrderCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, wl_array *ids);
46  static void stackingOrderUuidsCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, const char *uuids);
47  void setShowDesktop(bool set);
48  void windowCreated(org_kde_plasma_window *id, quint32 internalId, const char *uuid);
49  void setStackingOrder(const QVector<quint32> &ids);
50  void setStackingOrder(const QVector<QByteArray> &uuids);
51 
52  static struct org_kde_plasma_window_management_listener s_listener;
53  PlasmaWindowManagement *q;
54 };
55 
56 class Q_DECL_HIDDEN PlasmaWindow::Private
57 {
58 public:
59  Private(org_kde_plasma_window *window, quint32 internalId, const char *uuid, PlasmaWindow *q);
60  WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy> window;
61  quint32 internalId; ///< @deprecated
62  QByteArray uuid;
63  QString title;
64  QString appId;
65  quint32 desktop = 0;
66  bool active = false;
67  bool minimized = false;
68  bool maximized = false;
69  bool fullscreen = false;
70  bool keepAbove = false;
71  bool keepBelow = false;
72  bool onAllDesktops = false;
73  bool demandsAttention = false;
74  bool closeable = false;
75  bool minimizeable = false;
76  bool maximizeable = false;
77  bool fullscreenable = false;
78  bool skipTaskbar = false;
79  bool skipSwitcher = false;
80  bool shadeable = false;
81  bool shaded = false;
82  bool movable = false;
83  bool resizable = false;
84  bool virtualDesktopChangeable = false;
85  QIcon icon;
86  PlasmaWindowManagement *wm = nullptr;
87  bool unmapped = false;
88  QPointer<PlasmaWindow> parentWindow;
89  QMetaObject::Connection parentWindowUnmappedConnection;
90  QStringList plasmaVirtualDesktops;
91  QStringList plasmaActivities;
92  QRect geometry;
93  quint32 pid = 0;
94  QString resourceName;
95  QString applicationMenuServiceName;
96  QString applicationMenuObjectPath;
97 
98 private:
99  static void titleChangedCallback(void *data, org_kde_plasma_window *window, const char *title);
100  static void appIdChangedCallback(void *data, org_kde_plasma_window *window, const char *app_id);
101  static void pidChangedCallback(void *data, org_kde_plasma_window *window, uint32_t pid);
102  static void resourceNameChangedCallback(void *data, org_kde_plasma_window *window, const char *resourceName);
103  static void stateChangedCallback(void *data, org_kde_plasma_window *window, uint32_t state);
104  static void virtualDesktopChangedCallback(void *data, org_kde_plasma_window *window, int32_t number);
105  static void themedIconNameChangedCallback(void *data, org_kde_plasma_window *window, const char *name);
106  static void unmappedCallback(void *data, org_kde_plasma_window *window);
107  static void initialStateCallback(void *data, org_kde_plasma_window *window);
108  static void parentWindowCallback(void *data, org_kde_plasma_window *window, org_kde_plasma_window *parent);
109  static void windowGeometryCallback(void *data, org_kde_plasma_window *window, int32_t x, int32_t y, uint32_t width, uint32_t height);
110  static void iconChangedCallback(void *data, org_kde_plasma_window *org_kde_plasma_window);
111  static void virtualDesktopEnteredCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id);
112  static void virtualDesktopLeftCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id);
113  static void appmenuChangedCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *service_name, const char *object_path);
114  static void activityEnteredCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id);
115  static void activityLeftCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id);
116  void setActive(bool set);
117  void setMinimized(bool set);
118  void setMaximized(bool set);
119  void setFullscreen(bool set);
120  void setKeepAbove(bool set);
121  void setKeepBelow(bool set);
122  void setOnAllDesktops(bool set);
123  void setDemandsAttention(bool set);
124  void setCloseable(bool set);
125  void setMinimizeable(bool set);
126  void setMaximizeable(bool set);
127  void setFullscreenable(bool set);
128  void setSkipTaskbar(bool skip);
129  void setSkipSwitcher(bool skip);
130  void setShadeable(bool set);
131  void setShaded(bool set);
132  void setMovable(bool set);
133  void setResizable(bool set);
134  void setVirtualDesktopChangeable(bool set);
135  void setParentWindow(PlasmaWindow *parentWindow);
136  void setPid(const quint32 pid);
137 
138  static Private *cast(void *data)
139  {
140  return reinterpret_cast<Private *>(data);
141  }
142 
143  PlasmaWindow *q;
144 
145  static struct org_kde_plasma_window_listener s_listener;
146 };
147 
148 PlasmaWindowManagement::Private::Private(PlasmaWindowManagement *q)
149  : q(q)
150 {
151 }
152 
153 org_kde_plasma_window_management_listener PlasmaWindowManagement::Private::s_listener = {
154  showDesktopCallback,
155  windowCallback,
156  stackingOrderCallback,
157  stackingOrderUuidsCallback,
158  windowWithUuidCallback,
159 };
160 
161 void PlasmaWindowManagement::Private::setup(org_kde_plasma_window_management *windowManagement)
162 {
163  Q_ASSERT(!wm);
164  Q_ASSERT(windowManagement);
165  wm.setup(windowManagement);
166  org_kde_plasma_window_management_add_listener(windowManagement, &s_listener, this);
167 }
168 
169 void PlasmaWindowManagement::Private::showDesktopCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t state)
170 {
171  auto wm = reinterpret_cast<PlasmaWindowManagement::Private *>(data);
172  Q_ASSERT(wm->wm == org_kde_plasma_window_management);
173  switch (state) {
174  case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED:
175  wm->setShowDesktop(true);
176  break;
177  case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED:
178  wm->setShowDesktop(false);
179  break;
180  default:
181  Q_UNREACHABLE();
182  break;
183  }
184 }
185 
186 void PlasmaWindowManagement::Private::setShowDesktop(bool set)
187 {
188  if (showingDesktop == set) {
189  return;
190  }
191  showingDesktop = set;
192  Q_EMIT q->showingDesktopChanged(showingDesktop);
193 }
194 
195 void PlasmaWindowManagement::Private::windowCallback(void *data, org_kde_plasma_window_management *interface, uint32_t id)
196 {
197  auto wm = reinterpret_cast<PlasmaWindowManagement::Private *>(data);
198  Q_ASSERT(wm->wm == interface);
199  QTimer *timer = new QTimer();
200  timer->setSingleShot(true);
201  timer->setInterval(0);
203  timer,
205  wm->q,
206  [timer, wm, id] {
207  wm->windowCreated(org_kde_plasma_window_management_get_window(wm->wm, id), id, "unavailable");
208  timer->deleteLater();
209  },
211  timer->start();
212 }
213 
214 void PlasmaWindowManagement::Private::windowWithUuidCallback(void *data, org_kde_plasma_window_management *interface, uint32_t id, const char *_uuid)
215 {
216  QByteArray uuid(_uuid);
217  auto wm = reinterpret_cast<PlasmaWindowManagement::Private *>(data);
218  Q_ASSERT(wm->wm == interface);
219  QTimer *timer = new QTimer();
220  timer->setSingleShot(true);
221  timer->setInterval(0);
223  timer,
225  wm->q,
226  [timer, wm, id, uuid] {
227  wm->windowCreated(org_kde_plasma_window_management_get_window_by_uuid(wm->wm, uuid), id, uuid);
228  timer->deleteLater();
229  },
231  timer->start();
232 }
233 
234 void PlasmaWindowManagement::Private::windowCreated(org_kde_plasma_window *id, quint32 internalId, const char *uuid)
235 {
236  if (queue) {
237  queue->addProxy(id);
238  }
239  PlasmaWindow *window = new PlasmaWindow(q, id, internalId, uuid);
240  window->d->wm = q;
241  windows << window;
242 
243  const auto windowRemoved = [this, window] {
244  windows.removeAll(window);
245  if (activeWindow == window) {
246  activeWindow = nullptr;
247  Q_EMIT q->activeWindowChanged();
248  }
249  };
250 
251  QObject::connect(window, &QObject::destroyed, q, windowRemoved);
252  // unmapped is emitted earlier than QObject::destroyed. We want to update windows earlier to ensure other slot will see the up to date value of
253  // PlasmaWindowManagement::windows().
254  QObject::connect(window, &PlasmaWindow::unmapped, q, windowRemoved);
255  QObject::connect(window, &PlasmaWindow::activeChanged, q, [this, window] {
256  if (window->d->unmapped) {
257  return;
258  }
259  if (window->isActive()) {
260  if (activeWindow == window) {
261  return;
262  }
263  activeWindow = window;
264  Q_EMIT q->activeWindowChanged();
265  } else {
266  if (activeWindow == window) {
267  activeWindow = nullptr;
268  Q_EMIT q->activeWindowChanged();
269  }
270  }
271  });
272 }
273 
274 void PlasmaWindowManagement::Private::stackingOrderCallback(void *data, org_kde_plasma_window_management *interface, wl_array *ids)
275 {
276  // This is no-op since setStackingOrder(const QVector<quint32> &ids) is deprecated since 5.73,
277  // but we can't remove this method because it's needed in
278  // PlasmaWindowManagement::Private::s_listener struct
279 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 73)
280  auto wm = reinterpret_cast<PlasmaWindowManagement::Private *>(data);
281  Q_ASSERT(wm->wm == interface);
282  QVector<quint32> destination;
283  destination.resize(ids->size / sizeof(uint32_t));
284  memcpy(destination.data(), ids->data, ids->size);
285  wm->setStackingOrder(destination);
286 #endif
287 }
288 
289 void PlasmaWindowManagement::Private::stackingOrderUuidsCallback(void *data, org_kde_plasma_window_management *interface, const char *uuids)
290 {
291  auto wm = reinterpret_cast<PlasmaWindowManagement::Private *>(data);
292  Q_ASSERT(wm->wm == interface);
293  wm->setStackingOrder(QByteArray(uuids).split(';').toVector());
294 }
295 
296 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 73)
297 void PlasmaWindowManagement::Private::setStackingOrder(const QVector<quint32> &ids)
298 {
299  if (stackingOrder == ids) {
300  return;
301  }
302  stackingOrder = ids;
303  Q_EMIT q->stackingOrderChanged();
304 }
305 #endif
306 
307 void PlasmaWindowManagement::Private::setStackingOrder(const QVector<QByteArray> &uuids)
308 {
309  if (stackingOrderUuids == uuids) {
310  return;
311  }
312  stackingOrderUuids = uuids;
313  Q_EMIT q->stackingOrderUuidsChanged();
314 }
315 
316 PlasmaWindowManagement::PlasmaWindowManagement(QObject *parent)
317  : QObject(parent)
318  , d(new Private(this))
319 {
320 }
321 
322 PlasmaWindowManagement::~PlasmaWindowManagement()
323 {
324  release();
325 }
326 
327 void PlasmaWindowManagement::destroy()
328 {
329  if (!d->wm) {
330  return;
331  }
332  Q_EMIT interfaceAboutToBeDestroyed();
333  d->wm.destroy();
334 }
335 
337 {
338  if (!d->wm) {
339  return;
340  }
341  Q_EMIT interfaceAboutToBeReleased();
342  d->wm.release();
343 }
344 
345 void PlasmaWindowManagement::setup(org_kde_plasma_window_management *wm)
346 {
347  d->setup(wm);
348 }
349 
350 void PlasmaWindowManagement::setEventQueue(EventQueue *queue)
351 {
352  d->queue = queue;
353 }
354 
355 EventQueue *PlasmaWindowManagement::eventQueue()
356 {
357  return d->queue;
358 }
359 
360 bool PlasmaWindowManagement::isValid() const
361 {
362  return d->wm.isValid();
363 }
364 
365 PlasmaWindowManagement::operator org_kde_plasma_window_management *()
366 {
367  return d->wm;
368 }
369 
370 PlasmaWindowManagement::operator org_kde_plasma_window_management *() const
371 {
372  return d->wm;
373 }
374 
375 void PlasmaWindowManagement::hideDesktop()
376 {
377  setShowingDesktop(false);
378 }
379 
380 void PlasmaWindowManagement::showDesktop()
381 {
382  setShowingDesktop(true);
383 }
384 
385 void PlasmaWindowManagement::setShowingDesktop(bool show)
386 {
387  org_kde_plasma_window_management_show_desktop(d->wm,
388  show ? ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED
389  : ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED);
390 }
391 
392 bool PlasmaWindowManagement::isShowingDesktop() const
393 {
394  return d->showingDesktop;
395 }
396 
397 QList<PlasmaWindow *> PlasmaWindowManagement::windows() const
398 {
399  return d->windows;
400 }
401 
402 PlasmaWindow *PlasmaWindowManagement::activeWindow() const
403 {
404  return d->activeWindow;
405 }
406 
407 PlasmaWindowModel *PlasmaWindowManagement::createWindowModel()
408 {
409  return new PlasmaWindowModel(this);
410 }
411 
412 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 73)
413 QVector<quint32> PlasmaWindowManagement::stackingOrder() const
414 {
415  return d->stackingOrder;
416 }
417 #endif
418 
419 QVector<QByteArray> PlasmaWindowManagement::stackingOrderUuids() const
420 {
421  return d->stackingOrderUuids;
422 }
423 
424 org_kde_plasma_window_listener PlasmaWindow::Private::s_listener = {
425  titleChangedCallback,
426  appIdChangedCallback,
427  stateChangedCallback,
428  virtualDesktopChangedCallback,
429  themedIconNameChangedCallback,
430  unmappedCallback,
431  initialStateCallback,
432  parentWindowCallback,
433  windowGeometryCallback,
434  iconChangedCallback,
435  pidChangedCallback,
436  virtualDesktopEnteredCallback,
437  virtualDesktopLeftCallback,
438  appmenuChangedCallback,
439  activityEnteredCallback,
440  activityLeftCallback,
441  resourceNameChangedCallback,
442 };
443 
444 void PlasmaWindow::Private::appmenuChangedCallback(void *data, org_kde_plasma_window *window, const char *service_name, const char *object_path)
445 {
446  Q_UNUSED(window)
447 
448  Private *p = cast(data);
449 
450  p->applicationMenuServiceName = QString::fromUtf8(service_name);
451  p->applicationMenuObjectPath = QString::fromUtf8(object_path);
452 
453  Q_EMIT p->q->applicationMenuChanged();
454 }
455 
456 void PlasmaWindow::Private::parentWindowCallback(void *data, org_kde_plasma_window *window, org_kde_plasma_window *parent)
457 {
458  Q_UNUSED(window)
459  Private *p = cast(data);
460  const auto windows = p->wm->windows();
461  auto it = std::find_if(windows.constBegin(), windows.constEnd(), [parent](const PlasmaWindow *w) {
462  return *w == parent;
463  });
464  p->setParentWindow(it != windows.constEnd() ? *it : nullptr);
465 }
466 
467 void PlasmaWindow::Private::windowGeometryCallback(void *data, org_kde_plasma_window *window, int32_t x, int32_t y, uint32_t width, uint32_t height)
468 {
469  Q_UNUSED(window)
470  Private *p = cast(data);
471  QRect geo(x, y, width, height);
472  if (geo == p->geometry) {
473  return;
474  }
475  p->geometry = geo;
476  Q_EMIT p->q->geometryChanged();
477 }
478 
479 void PlasmaWindow::Private::setParentWindow(PlasmaWindow *parent)
480 {
481  const auto old = parentWindow;
482  QObject::disconnect(parentWindowUnmappedConnection);
483  if (parent && !parent->d->unmapped) {
484  parentWindow = QPointer<PlasmaWindow>(parent);
485  parentWindowUnmappedConnection = QObject::connect(parent, &PlasmaWindow::unmapped, q, [this] {
486  setParentWindow(nullptr);
487  });
488  } else {
489  parentWindow = QPointer<PlasmaWindow>();
490  parentWindowUnmappedConnection = QMetaObject::Connection();
491  }
492  if (parentWindow.data() != old.data()) {
493  Q_EMIT q->parentWindowChanged();
494  }
495 }
496 
497 void PlasmaWindow::Private::initialStateCallback(void *data, org_kde_plasma_window *window)
498 {
499  Q_UNUSED(window)
500  Private *p = cast(data);
501  if (!p->unmapped) {
502  Q_EMIT p->wm->windowCreated(p->q);
503  }
504 }
505 
506 void PlasmaWindow::Private::titleChangedCallback(void *data, org_kde_plasma_window *window, const char *title)
507 {
508  Q_UNUSED(window)
509  Private *p = cast(data);
510  const QString t = QString::fromUtf8(title);
511  if (p->title == t) {
512  return;
513  }
514  p->title = t;
515  Q_EMIT p->q->titleChanged();
516 }
517 
518 void PlasmaWindow::Private::appIdChangedCallback(void *data, org_kde_plasma_window *window, const char *appId)
519 {
520  Q_UNUSED(window)
521  Private *p = cast(data);
522  const QString s = QString::fromUtf8(appId);
523  if (s == p->appId) {
524  return;
525  }
526  p->appId = s;
527  Q_EMIT p->q->appIdChanged();
528 }
529 
530 void PlasmaWindow::Private::pidChangedCallback(void *data, org_kde_plasma_window *window, uint32_t pid)
531 {
532  Q_UNUSED(window)
533  Private *p = cast(data);
534  if (p->pid == static_cast<quint32>(pid)) {
535  return;
536  }
537  p->pid = pid;
538 }
539 
540 void PlasmaWindow::Private::resourceNameChangedCallback(void *data, org_kde_plasma_window *window, const char *resourceName)
541 {
542  Q_UNUSED(window)
543  Private *p = cast(data);
544  const QString s = QString::fromUtf8(resourceName);
545  if (s == p->resourceName) {
546  return;
547  }
548  p->resourceName = s;
549  Q_EMIT p->q->resourceNameChanged();
550 }
551 
552 void PlasmaWindow::Private::virtualDesktopChangedCallback([[maybe_unused]] void *data,
553  [[maybe_unused]] org_kde_plasma_window *window,
554  [[maybe_unused]] int32_t number)
555 {
556  // Can't remove this method as it's used in PlasmaWindow::Private::s_listener struct
557 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 52)
558  Q_UNUSED(window)
559  Private *p = cast(data);
560  if (p->desktop == static_cast<quint32>(number)) {
561  return;
562  }
563  p->desktop = number;
564  Q_EMIT p->q->virtualDesktopChanged();
565 #endif
566 }
567 
568 void PlasmaWindow::Private::unmappedCallback(void *data, org_kde_plasma_window *window)
569 {
570  auto p = cast(data);
571  Q_UNUSED(window);
572  p->unmapped = true;
573  Q_EMIT p->q->unmapped();
574  p->q->deleteLater();
575 }
576 
577 void PlasmaWindow::Private::virtualDesktopEnteredCallback(void *data, org_kde_plasma_window *window, const char *id)
578 {
579  auto p = cast(data);
580  Q_UNUSED(window);
581  const QString stringId(QString::fromUtf8(id));
582  p->plasmaVirtualDesktops << stringId;
583  Q_EMIT p->q->plasmaVirtualDesktopEntered(stringId);
584  if (p->plasmaVirtualDesktops.count() == 1) {
585  Q_EMIT p->q->onAllDesktopsChanged();
586  }
587 }
588 
589 void PlasmaWindow::Private::virtualDesktopLeftCallback(void *data, org_kde_plasma_window *window, const char *id)
590 {
591  auto p = cast(data);
592  Q_UNUSED(window);
593  const QString stringId(QString::fromUtf8(id));
594  p->plasmaVirtualDesktops.removeAll(stringId);
595  Q_EMIT p->q->plasmaVirtualDesktopLeft(stringId);
596  if (p->plasmaVirtualDesktops.isEmpty()) {
597  Q_EMIT p->q->onAllDesktopsChanged();
598  }
599 }
600 
601 void PlasmaWindow::Private::activityEnteredCallback(void *data, org_kde_plasma_window *window, const char *id)
602 {
603  auto p = cast(data);
604  Q_UNUSED(window);
605  const QString stringId(QString::fromUtf8(id));
606  p->plasmaActivities << stringId;
607  Q_EMIT p->q->plasmaActivityEntered(stringId);
608 }
609 
610 void PlasmaWindow::Private::activityLeftCallback(void *data, org_kde_plasma_window *window, const char *id)
611 {
612  auto p = cast(data);
613  Q_UNUSED(window);
614  const QString stringId(QString::fromUtf8(id));
615  p->plasmaActivities.removeAll(stringId);
616  Q_EMIT p->q->plasmaActivityLeft(stringId);
617 }
618 
619 void PlasmaWindow::Private::stateChangedCallback(void *data, org_kde_plasma_window *window, uint32_t state)
620 {
621  auto p = cast(data);
622  Q_UNUSED(window);
623  p->setActive(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE);
624  p->setMinimized(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED);
625  p->setMaximized(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED);
626  p->setFullscreen(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREEN);
627  p->setKeepAbove(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE);
628  p->setKeepBelow(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW);
629  p->setOnAllDesktops(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ON_ALL_DESKTOPS);
630  p->setDemandsAttention(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_DEMANDS_ATTENTION);
631  p->setCloseable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_CLOSEABLE);
632  p->setFullscreenable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE);
633  p->setMaximizeable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZABLE);
634  p->setMinimizeable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZABLE);
635  p->setSkipTaskbar(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR);
636  p->setSkipSwitcher(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER);
637  p->setShadeable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE);
638  p->setShaded(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED);
639  p->setMovable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE);
640  p->setResizable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE);
641  p->setVirtualDesktopChangeable(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE);
642 }
643 
644 void PlasmaWindow::Private::themedIconNameChangedCallback(void *data, org_kde_plasma_window *window, const char *name)
645 {
646  auto p = cast(data);
647  Q_UNUSED(window);
648  const QString themedName = QString::fromUtf8(name);
649  if (!themedName.isEmpty()) {
650  QIcon icon = QIcon::fromTheme(themedName);
651  p->icon = icon;
652  } else {
653  p->icon = QIcon();
654  }
655  Q_EMIT p->q->iconChanged();
656 }
657 
658 static int readData(int fd, QByteArray &data)
659 {
660  // implementation based on QtWayland file qwaylanddataoffer.cpp
661  char buf[4096];
662  int retryCount = 0;
663  int n;
664  while (true) {
665  n = QT_READ(fd, buf, sizeof buf);
666  if (n > 0) {
667  data.append(buf, n);
668  } else if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
669  usleep(1000);
670  } else {
671  break;
672  }
673  }
674  return n;
675 }
676 
677 void PlasmaWindow::Private::iconChangedCallback(void *data, org_kde_plasma_window *window)
678 {
679  auto p = cast(data);
680  Q_UNUSED(window);
681  int pipeFds[2];
682  if (pipe2(pipeFds, O_CLOEXEC | O_NONBLOCK) != 0) {
683  return;
684  }
685  org_kde_plasma_window_get_icon(p->window, pipeFds[1]);
686  close(pipeFds[1]);
687  const int pipeFd = pipeFds[0];
688  auto readIcon = [pipeFd]() -> QIcon {
689  QByteArray content;
690  if (readData(pipeFd, content) != 0) {
691  close(pipeFd);
692  return QIcon();
693  }
694  close(pipeFd);
695  QDataStream ds(content);
696  QIcon icon;
697  ds >> icon;
698  return icon;
699  };
700  QFutureWatcher<QIcon> *watcher = new QFutureWatcher<QIcon>(p->q);
701  QObject::connect(watcher, &QFutureWatcher<QIcon>::finished, p->q, [p, watcher] {
702  watcher->deleteLater();
703  QIcon icon = watcher->result();
704  if (!icon.isNull()) {
705  p->icon = icon;
706  } else {
707  p->icon = QIcon::fromTheme(QStringLiteral("wayland"));
708  }
709  Q_EMIT p->q->iconChanged();
710  });
711  watcher->setFuture(QtConcurrent::run(readIcon));
712 }
713 
714 void PlasmaWindow::Private::setActive(bool set)
715 {
716  if (active == set) {
717  return;
718  }
719  active = set;
720  Q_EMIT q->activeChanged();
721 }
722 
723 void PlasmaWindow::Private::setFullscreen(bool set)
724 {
725  if (fullscreen == set) {
726  return;
727  }
728  fullscreen = set;
729  Q_EMIT q->fullscreenChanged();
730 }
731 
732 void PlasmaWindow::Private::setKeepAbove(bool set)
733 {
734  if (keepAbove == set) {
735  return;
736  }
737  keepAbove = set;
738  Q_EMIT q->keepAboveChanged();
739 }
740 
741 void PlasmaWindow::Private::setKeepBelow(bool set)
742 {
743  if (keepBelow == set) {
744  return;
745  }
746  keepBelow = set;
747  Q_EMIT q->keepBelowChanged();
748 }
749 
750 void PlasmaWindow::Private::setMaximized(bool set)
751 {
752  if (maximized == set) {
753  return;
754  }
755  maximized = set;
756  Q_EMIT q->maximizedChanged();
757 }
758 
759 void PlasmaWindow::Private::setMinimized(bool set)
760 {
761  if (minimized == set) {
762  return;
763  }
764  minimized = set;
765  Q_EMIT q->minimizedChanged();
766 }
767 
768 void PlasmaWindow::Private::setOnAllDesktops(bool set)
769 {
770  if (onAllDesktops == set) {
771  return;
772  }
773  onAllDesktops = set;
774  Q_EMIT q->onAllDesktopsChanged();
775 }
776 
777 void PlasmaWindow::Private::setDemandsAttention(bool set)
778 {
779  if (demandsAttention == set) {
780  return;
781  }
782  demandsAttention = set;
783  Q_EMIT q->demandsAttentionChanged();
784 }
785 
786 void PlasmaWindow::Private::setCloseable(bool set)
787 {
788  if (closeable == set) {
789  return;
790  }
791  closeable = set;
792  Q_EMIT q->closeableChanged();
793 }
794 
795 void PlasmaWindow::Private::setFullscreenable(bool set)
796 {
797  if (fullscreenable == set) {
798  return;
799  }
800  fullscreenable = set;
801  Q_EMIT q->fullscreenableChanged();
802 }
803 
804 void PlasmaWindow::Private::setMaximizeable(bool set)
805 {
806  if (maximizeable == set) {
807  return;
808  }
809  maximizeable = set;
810  Q_EMIT q->maximizeableChanged();
811 }
812 
813 void PlasmaWindow::Private::setMinimizeable(bool set)
814 {
815  if (minimizeable == set) {
816  return;
817  }
818  minimizeable = set;
819  Q_EMIT q->minimizeableChanged();
820 }
821 
822 void PlasmaWindow::Private::setSkipTaskbar(bool skip)
823 {
824  if (skipTaskbar == skip) {
825  return;
826  }
827  skipTaskbar = skip;
828  Q_EMIT q->skipTaskbarChanged();
829 }
830 
831 void PlasmaWindow::Private::setSkipSwitcher(bool skip)
832 {
833  if (skipSwitcher == skip) {
834  return;
835  }
836  skipSwitcher = skip;
837  Q_EMIT q->skipSwitcherChanged();
838 }
839 
840 void PlasmaWindow::Private::setShadeable(bool set)
841 {
842  if (shadeable == set) {
843  return;
844  }
845  shadeable = set;
846  Q_EMIT q->shadeableChanged();
847 }
848 
849 void PlasmaWindow::Private::setShaded(bool set)
850 {
851  if (shaded == set) {
852  return;
853  }
854  shaded = set;
855  Q_EMIT q->shadedChanged();
856 }
857 
858 void PlasmaWindow::Private::setMovable(bool set)
859 {
860  if (movable == set) {
861  return;
862  }
863  movable = set;
864  Q_EMIT q->movableChanged();
865 }
866 
867 void PlasmaWindow::Private::setResizable(bool set)
868 {
869  if (resizable == set) {
870  return;
871  }
872  resizable = set;
873  Q_EMIT q->resizableChanged();
874 }
875 
876 void PlasmaWindow::Private::setVirtualDesktopChangeable(bool set)
877 {
878  if (virtualDesktopChangeable == set) {
879  return;
880  }
881  virtualDesktopChangeable = set;
882  Q_EMIT q->virtualDesktopChangeableChanged();
883 }
884 
885 PlasmaWindow::Private::Private(org_kde_plasma_window *w, quint32 internalId, const char *uuid, PlasmaWindow *q)
886  : internalId(internalId)
887  , uuid(uuid)
888  , q(q)
889 {
890  Q_ASSERT(!this->uuid.isEmpty());
891  window.setup(w);
892  org_kde_plasma_window_add_listener(w, &s_listener, this);
893 }
894 
895 PlasmaWindow::PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *window, quint32 internalId, const char *uuid)
896  : QObject(parent)
897  , d(new Private(window, internalId, uuid, this))
898 {
899 }
900 
901 PlasmaWindow::~PlasmaWindow()
902 {
903  release();
904 }
905 
907 {
908  d->window.destroy();
909 }
910 
912 {
913  d->window.release();
914 }
915 
917 {
918  return d->window.isValid();
919 }
920 
921 PlasmaWindow::operator org_kde_plasma_window *() const
922 {
923  return d->window;
924 }
925 
926 PlasmaWindow::operator org_kde_plasma_window *()
927 {
928  return d->window;
929 }
930 
932 {
933  return d->appId;
934 }
935 
936 quint32 PlasmaWindow::pid() const
937 {
938  return d->pid;
939 }
940 
942 {
943  return d->resourceName;
944 }
945 
947 {
948  return d->title;
949 }
950 
951 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 52)
953 {
954  return d->desktop;
955 }
956 #endif
957 
959 {
960  return d->active;
961 }
962 
964 {
965  return d->fullscreen;
966 }
967 
969 {
970  return d->keepAbove;
971 }
972 
974 {
975  return d->keepBelow;
976 }
977 
979 {
980  return d->maximized;
981 }
982 
984 {
985  return d->minimized;
986 }
987 
989 {
990  // from protocol version 8 virtual desktops are managed by plasmaVirtualDesktops
991  if (org_kde_plasma_window_get_version(d->window) < 8) {
992  return d->onAllDesktops;
993  } else {
994  return d->plasmaVirtualDesktops.isEmpty();
995  }
996 }
997 
999 {
1000  return d->demandsAttention;
1001 }
1002 
1004 {
1005  return d->closeable;
1006 }
1007 
1009 {
1010  return d->fullscreenable;
1011 }
1012 
1014 {
1015  return d->maximizeable;
1016 }
1017 
1019 {
1020  return d->minimizeable;
1021 }
1022 
1024 {
1025  return d->skipTaskbar;
1026 }
1027 
1029 {
1030  return d->skipSwitcher;
1031 }
1032 
1034 {
1035  return d->icon;
1036 }
1037 
1039 {
1040  return d->shadeable;
1041 }
1042 
1044 {
1045  return d->shaded;
1046 }
1047 
1049 {
1050  return d->resizable;
1051 }
1052 
1054 {
1055  return d->movable;
1056 }
1057 
1059 {
1060  return d->virtualDesktopChangeable;
1061 }
1062 
1064 {
1065  return d->applicationMenuObjectPath;
1066 }
1067 
1069 {
1070  return d->applicationMenuServiceName;
1071 }
1072 
1074 {
1075  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE);
1076 }
1077 
1079 {
1080  org_kde_plasma_window_close(d->window);
1081 }
1082 
1084 {
1085  org_kde_plasma_window_request_move(d->window);
1086 }
1087 
1089 {
1090  org_kde_plasma_window_request_resize(d->window);
1091 }
1092 
1093 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 52)
1095 {
1096  org_kde_plasma_window_set_virtual_desktop(d->window, desktop);
1097 }
1098 #endif
1099 
1101 {
1102  if (d->keepAbove) {
1103  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, 0);
1104  } else {
1105  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE);
1106  }
1107 }
1108 
1110 {
1111  if (d->keepBelow) {
1112  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, 0);
1113  } else {
1114  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW);
1115  }
1116 }
1117 
1119 {
1120  if (d->minimized) {
1121  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, 0);
1122  } else {
1123  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED);
1124  }
1125 }
1126 
1128 {
1129  if (d->maximized) {
1130  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, 0);
1131  } else {
1132  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED);
1133  }
1134 }
1135 
1137 {
1138  org_kde_plasma_window_set_minimized_geometry(d->window, *panel, geom.x(), geom.y(), geom.width(), geom.height());
1139 }
1140 
1142 {
1143  org_kde_plasma_window_unset_minimized_geometry(d->window, *panel);
1144 }
1145 
1147 {
1148  if (d->shaded) {
1149  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, 0);
1150  } else {
1151  org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED);
1152  }
1153 }
1154 
1155 #if KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(5, 73)
1157 {
1158  return d->internalId;
1159 }
1160 #endif
1161 
1163 {
1164  return d->uuid;
1165 }
1166 
1168 {
1169  return d->parentWindow;
1170 }
1171 
1173 {
1174  return d->geometry;
1175 }
1176 
1178 {
1179  org_kde_plasma_window_request_enter_virtual_desktop(d->window, id.toUtf8());
1180 }
1181 
1183 {
1184  org_kde_plasma_window_request_enter_new_virtual_desktop(d->window);
1185 }
1186 
1188 {
1189  org_kde_plasma_window_request_leave_virtual_desktop(d->window, id.toUtf8());
1190 }
1191 
1193 {
1194  return d->plasmaVirtualDesktops;
1195 }
1196 
1198 {
1199  org_kde_plasma_window_request_enter_activity(d->window, id.toUtf8());
1200 }
1201 
1203 {
1204  org_kde_plasma_window_request_leave_activity(d->window, id.toUtf8());
1205 }
1206 
1208 {
1209  return d->plasmaActivities;
1210 }
1211 
1213 {
1214  if (org_kde_plasma_window_get_version(d->window) >= ORG_KDE_PLASMA_WINDOW_SEND_TO_OUTPUT_SINCE_VERSION) {
1215  org_kde_plasma_window_send_to_output(d->window, *output);
1216  }
1217 }
1218 
1219 class Q_DECL_HIDDEN PlasmaActivationFeedback::Private
1220 {
1221 public:
1222  Private(PlasmaActivationFeedback *q);
1223  WaylandPointer<org_kde_plasma_activation_feedback, org_kde_plasma_activation_feedback_destroy> feedback;
1224  EventQueue *queue = nullptr;
1225 
1226  void setup(org_kde_plasma_activation_feedback *feedback);
1227 
1228 private:
1229  static void activationCallback(void *data, struct org_kde_plasma_activation_feedback *feedback, struct org_kde_plasma_activation *id);
1230 
1231  static struct org_kde_plasma_activation_feedback_listener s_listener;
1233 };
1234 
1235 PlasmaActivationFeedback::Private::Private(PlasmaActivationFeedback *q)
1236  : q(q)
1237 {
1238 }
1239 
1240 org_kde_plasma_activation_feedback_listener PlasmaActivationFeedback::Private::s_listener = {
1241  activationCallback,
1242 };
1243 
1244 void PlasmaActivationFeedback::Private::activationCallback(void *data, org_kde_plasma_activation_feedback *interface, struct org_kde_plasma_activation *id)
1245 {
1246  auto feedbackPrivate = reinterpret_cast<PlasmaActivationFeedback::Private *>(data);
1247  Q_ASSERT(feedbackPrivate->feedback == interface);
1248  auto activation = new PlasmaActivation(feedbackPrivate->q, id);
1249  Q_EMIT feedbackPrivate->q->activation(activation);
1250 }
1251 
1252 void PlasmaActivationFeedback::Private::setup(org_kde_plasma_activation_feedback *m)
1253 {
1254  Q_ASSERT(!feedback);
1255  Q_ASSERT(m);
1256  feedback.setup(m);
1257  org_kde_plasma_activation_feedback_add_listener(m, &s_listener, this);
1258 }
1259 
1260 PlasmaActivationFeedback::PlasmaActivationFeedback(QObject *parent)
1261  : QObject(parent)
1262  , d(new Private(this))
1263 {
1264 }
1265 
1266 PlasmaActivationFeedback::~PlasmaActivationFeedback()
1267 {
1268  release();
1269 }
1270 
1272 {
1273  if (!d->feedback) {
1274  return;
1275  }
1277  d->feedback.destroy();
1278 }
1279 
1281 {
1282  if (!d->feedback) {
1283  return;
1284  }
1286  d->feedback.release();
1287 }
1288 
1289 void PlasmaActivationFeedback::setup(org_kde_plasma_activation_feedback *wm)
1290 {
1291  d->setup(wm);
1292 }
1293 
1295 {
1296  d->queue = queue;
1297 }
1298 
1300 {
1301  return d->queue;
1302 }
1303 
1305 {
1306  return d->feedback.isValid();
1307 }
1308 
1309 PlasmaActivationFeedback::operator org_kde_plasma_activation_feedback *()
1310 {
1311  return d->feedback;
1312 }
1313 
1314 PlasmaActivationFeedback::operator org_kde_plasma_activation_feedback *() const
1315 {
1316  return d->feedback;
1317 }
1318 
1319 class Q_DECL_HIDDEN PlasmaActivation::Private
1320 {
1321 public:
1322  Private(org_kde_plasma_activation *activation, PlasmaActivation *q)
1323  : activation(activation)
1324  {
1325  org_kde_plasma_activation_add_listener(activation, &s_listener, q);
1326  }
1327 
1328  static PlasmaActivation *cast(void *data)
1329  {
1330  return reinterpret_cast<PlasmaActivation *>(data);
1331  }
1332  WaylandPointer<org_kde_plasma_activation, org_kde_plasma_activation_destroy> activation;
1333 
1334  static org_kde_plasma_activation_listener s_listener;
1335  static void app_idCallback(void *data, struct org_kde_plasma_activation *org_kde_plasma_activation, const char *app_id);
1336  static void finishedCallback(void *data, struct org_kde_plasma_activation *org_kde_plasma_activation);
1337 };
1338 
1339 org_kde_plasma_activation_listener PlasmaActivation::Private::s_listener = {
1340  app_idCallback,
1341  finishedCallback,
1342 };
1343 
1344 void PlasmaActivation::Private::app_idCallback(void *data, org_kde_plasma_activation *activation, const char *appId)
1345 {
1346  Q_UNUSED(activation)
1347  Q_EMIT cast(data)->applicationId(QString::fromUtf8(appId));
1348 }
1349 
1350 void PlasmaActivation::Private::finishedCallback(void *data, org_kde_plasma_activation *)
1351 {
1352  auto q = cast(data);
1353  Q_EMIT q->finished();
1354  Q_EMIT q->deleteLater();
1355  q->d->activation.release();
1356 }
1357 
1358 PlasmaActivation::PlasmaActivation(PlasmaActivationFeedback *parent, org_kde_plasma_activation *activation)
1359  : QObject(parent)
1360  , d(new PlasmaActivation::Private(activation, this))
1361 {
1362 }
1363 
1364 PlasmaActivation::~PlasmaActivation() = default;
1365 }
1366 }
void setEventQueue(EventQueue *queue)
Sets the queue to use for creating a PlasmaActivationFeedback.
void requestEnterNewVirtualDesktop()
Make the window enter a new virtual desktop.
QStringList plasmaVirtualDesktops() const
Return all the virtual desktop ids this window is associated to.
QFuture< T > run(Function function,...)
void requestClose()
Requests to close the window.
QPointer< PlasmaWindow > parentWindow() const
The parent window of this PlasmaWindow.
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Wrapper for the wl_output interface.
Definition: output.h:54
QString fromUtf8(const char *str, int size)
void interfaceAboutToBeReleased()
This signal is emitted right before the interface is released.
void requestToggleKeepAbove()
Requests the window at this model row index have its keep above state toggled.
Q_EMITQ_EMIT
virtual void release(quint64 objid)
QByteArray & append(char ch)
Wrapper for the wl_surface interface.
Definition: surface.h:43
void setSingleShot(bool singleShot)
void sendToOutput(KWayland::Client::Output *output) const
Sends the current window to output.
void destroy()
Destroys the data held by this PlasmaActivationFeedback.
void requestVirtualDesktop(quint32 desktop)
Requests to send the window to virtual desktop.
QIcon fromTheme(const QString &name)
int width() const const
int x() const const
int y() const const
Exposes the window list and window state as a Qt item model.
void requestLeaveVirtualDesktop(const QString &id)
Ask the server to make the window the window exit a virtual desktop.
const QList< QKeySequence > & close()
T * data()
QString applicationMenuServiceName() const
Return the D-BUS service name for a window's application menu.
void requestEnterVirtualDesktop(const QString &id)
Ask the server to make the window enter a virtual desktop.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString applicationMenuObjectPath() const
Return the D-BUS object path to a windows's application menu.
void destroyed(QObject *obj)
void requestResize()
Requests to start an interactive resize operation.
void start(int msec)
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:54
QByteArray uuid() const
A unique identifier for the window.
void timeout()
bool isEmpty() const const
void setup(org_kde_plasma_activation_feedback *manager)
Setup this PlasmaActivationFeedback to manage the manager.
QueuedConnection
void unsetMinimizedGeometry(Surface *panel)
Remove the task geometry information for a particular panel.
GeoCoordinates geo(const QVariant &location)
void resize(int size)
void requestEnterActivity(const QString &id)
Ask the server to make the window enter an activity.
void setMinimizedGeometry(Surface *panel, const QRect &geom)
Sets the geometry of the taskbar entry for this window relative to a panel in particular.
Wrapper for the org_kde_plasma_window interface.
void destroy()
Destroys the data held by this PlasmaWindow.
void interfaceAboutToBeDestroyed()
This signal is emitted right before the data is destroyed.
void setFuture(const QFuture< T > &future)
int height() const const
QStringList plasmaActivities() const
Return all the activity ids this window is associated to.
KIOCORE_EXPORT QString number(KIO::filesize_t size)
void release()
Releases the org_kde_plasma_window interface.
void requestToggleMinimized()
Requests the window at this model row index have its minimized state toggled.
void requestToggleShaded()
Requests the window at this model row index have its shaded state toggled.
quint32 internalId() const
An internal window identifier.
void requestMove()
Requests to start an interactive window move operation.
KJOBWIDGETS_EXPORT QWidget * window(KJob *job)
void setInterval(int msec)
void requestToggleKeepBelow()
Requests the window at this model row index have its keep below state toggled.
void requestActivate()
Requests to activate the window.
void release()
Releases the org_kde_plasma_activation_feedback interface.
void requestToggleMaximized()
Requests the window at this model row index have its maximized state toggled.
void requestLeaveActivity(const QString &id)
Ask the server to make the window exit an activity.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:56:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.