KWindowSystem

kwindowsystem.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Matthias Ettrich <[email protected]>
4  SPDX-FileCopyrightText: 2007 Lubos Lunak <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8 /*
9  * kwindowsystem.h. Part of the KDE project.
10  */
11 
12 #ifndef KWINDOWSYSTEM_H
13 #define KWINDOWSYSTEM_H
14 
15 #include <QObject>
16 #include <QWidgetList> //For WId
17 #include <kwindowinfo.h>
18 #include <kwindowsystem_export.h>
19 #include <netwm_def.h>
20 
21 class KWindowSystemPrivate;
22 class NETWinInfo;
23 
24 /**
25  *
26  * Convenience access to certain properties and features of the
27  * window manager.
28  *
29  * The class KWindowSystem provides information about the state of the
30  * window manager and allows asking the window manager to change them
31  * using a more high-level interface than the NETWinInfo/NETRootInfo
32  * lowlevel classes.
33  *
34  * Because of limitations of the way Qt is implemented on Mac OSX, the WId's
35  * returned by methods in this class are not compatible with those expected
36  * by other Qt methods. So while it should be fine to pass WId's retrieved by
37  * for example calling the winId method on a QWidget to methods in this class
38  * the reverse is not true. You should never pass a WId obtained from this class
39  * to a Qt method accepting a WId parameter.
40  *
41  * @short Class for interaction with the window manager.
42  * @author Matthias Ettrich ([email protected])
43  */
44 class KWINDOWSYSTEM_EXPORT KWindowSystem : public QObject, public NET
45 {
46  Q_OBJECT
47 
48 public:
49  /**
50  * Access to the singleton instance. Useful mainly for connecting to signals.
51  */
52  static KWindowSystem *self();
53 
54  /**
55  * Returns the list of all toplevel windows currently managed by the
56  * window manager in the order of creation. Please do not rely on
57  * indexes of this list: Whenever you enter Qt's event loop in your
58  * application, it may happen that entries are removed or added.
59  * Your module should perhaps work on a copy of this list and verify a
60  * window with hasWId() before any operations.
61  *
62  * Iteration over this list can be done easily with
63  * \code
64  * QList<WId> windows = KWindowSystem::windows();
65  * for (auto it = windows.cbegin(), end = windows.cend(); it != end; ++it) {
66  * ... do something here, (*it) is the current WId.
67  * }
68  * \endcode
69  * @return the list of all toplevel windows
70  */
71  static QList<WId> windows();
72 
73  /**
74  * Test to see if @p id still managed at present.
75  * @param id the window id to test
76  * @return true if the window id is still managed
77  **/
78  static bool hasWId(WId id);
79 
80 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
81  /**
82  * Returns information about window @p win. It is recommended to check
83  * whether the returned info is valid by calling the valid() method.
84  * @param win the id of the window
85  * @param properties all properties that should be retrieved (see NET::Property
86  * enum for details). Unlisted properties cause related information to be invalid
87  * in the returned data, but make this function faster when not all data is needed.
88  * @param properties2 additional properties (see NET::Property2 enum)
89  * @return the window information
90  * @deprecated Since 5.0, use KWindowInfo directly
91  */
92  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowInfo(WId, NET::Properties, NET::Properties2")
93  static KWindowInfo windowInfo(WId win, NET::Properties properties, NET::Properties2 properties2 = NET::Properties2());
94 #endif
95 
96  /**
97  * Returns the list of all toplevel windows currently managed by the
98  * window manager in the current stacking order (from lower to
99  * higher). May be useful for pagers.
100  * @return the list of all toplevel windows in stacking order
101  */
102  static QList<WId> stackingOrder();
103 
104  /**
105  * Returns the currently active window, or 0 if no window is active.
106  * @return the window id of the active window, or 0 if no window is
107  * active
108  **/
109  static WId activeWindow();
110 
111  /**
112  * Requests that window @p win is activated.
113  *
114  * There are two ways how to activate a window, by calling
115  * activateWindow() and forceActiveWindow(). Generally,
116  * applications shouldn't make attempts to explicitly activate
117  * their windows, and instead let the user to activate them.
118  * In the special cases where this may be needed, applications
119  * should use activateWindow(). Window manager may consider whether
120  * this request wouldn't result in focus stealing, which
121  * would be obtrusive, and may refuse the request.
122  *
123  * The usage of forceActiveWindow() is meant only for pagers
124  * and similar tools, which represent direct user actions
125  * related to window manipulation.
126  * Except for rare cases, this request will be always honored,
127  * and normal applications are forbidden to use it.
128  *
129  * In case of problems, consult the KWin README in the kdebase
130  * package (kdebase/kwin/README), or ask on the [email protected]
131  * mailing list.
132  *
133  * @param win the id of the window to make active
134  * @param time X server timestamp of the user activity that
135  * caused this request
136  */
137  static void activateWindow(WId win, long time = 0);
138 
139  /**
140  * Sets window @p win to be the active window. Note that this
141  * should be called only in special cases, applications
142  * shouldn't force themselves or other windows to be the active
143  * window. Generally, this call should used only by pagers
144  * and similar tools. See the explanation in description
145  * of activateWindow().
146  *
147  * @param win the id of the window to make active
148  * @param time X server timestamp of the user activity that
149  * caused this request
150  */
151  static void forceActiveWindow(WId win, long time = 0);
152 
153  /**
154  * When application finishes some operation and wants to notify
155  * the user about it, it can call demandAttention(). Instead
156  * of activating the window, which could be obtrusive, the window
157  * will be marked specially as demanding user's attention.
158  * See also explanation in description of activateWindow().
159  *
160  * Note that it's usually better to use KNotifyClient.
161  */
162  static void demandAttention(WId win, bool set = true);
163 
164  /**
165  * Returns true if a compositing manager is running (i.e. ARGB windows
166  * are supported, effects will be provided, etc.).
167  */
168  static bool compositingActive();
169 
170  /**
171  * Returns the current virtual desktop.
172  * @return the current virtual desktop
173  **/
174  static int currentDesktop();
175 
176  /**
177  * Returns the number of virtual desktops.
178  * @return the number of virtual desktops
179  **/
180  static int numberOfDesktops();
181 
182  /**
183  * Convenience function to set the current desktop to @p desktop.
184  * See NETRootInfo.
185  * @param desktop the number of the new desktop
186  */
187  static void setCurrentDesktop(int desktop);
188 
189  /**
190  * Sets window @p win to be present on all virtual desktops if @p
191  * is true. Otherwise the window lives only on one single desktop.
192  *
193  * @param win the id of the window
194  * @param b true to show the window on all desktops, false
195  * otherwise
196  */
197  static void setOnAllDesktops(WId win, bool b);
198 
199  /**
200  * Moves window @p win to desktop @p desktop.
201  *
202  * @param win the id of the window
203  * @param desktop the number of the new desktop
204  */
205  static void setOnDesktop(WId win, int desktop);
206 
207  /**
208  * Moves window @p win to activities @p activities.
209  *
210  * @param win the id of the window
211  * @param activities the list of activity UUIDs
212  *
213  * @since 5.1
214  * @see KWindowInfo::activities
215  */
216  static void setOnActivities(WId win, const QStringList &activities);
217 
218  /**
219  * Sets the parent window of @p subwindow to be @p mainwindow.
220  * This overrides the parent set the usual way as the QWidget or QWindow parent,
221  * but only for the window manager - e.g. stacking order and window grouping
222  * will be affected, but features like automatic deletion of children
223  * when the parent is deleted are unaffected and normally use
224  * the QObject parent.
225  *
226  * This function should be used before a dialog is shown for a window
227  * that belongs to another application.
228  */
229  static void setMainWindow(QWindow *subwindow, WId mainwindow);
230 
231 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 62)
232  /**
233  * Sets the parent window of @p subwindow to be @p mainwindow.
234  * This overrides the parent set the usual way as the QWidget parent,
235  * but only for the window manager - e.g. stacking order and window grouping
236  * will be affected, but features like automatic deletion of children
237  * when the parent is deleted are unaffected and normally use
238  * the QWidget parent.
239  *
240  * This function should be used before a dialog is shown for a window
241  * that belongs to another application.
242  * @deprecated since 5.62, use setMainWindow(QWindow *). If all you have is a QWidget*,
243  * you might need to call setAttribute(Qt::WA_NativeWindow, true); before calling
244  * >window()->windowHandle().
245  */
246  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 62, "Use KWindowSystem::setMainWindow(QWindow *)")
247  static void setMainWindow(QWidget *subwindow, WId mainwindow);
248 #endif
249 
250 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
251  /**
252  * Returns the WM_TRANSIENT_FOR property for the given window, i.e. the mainwindow
253  * for this window.
254  *
255  * @param window the id of the window
256  * @deprecated Since 5.0, use KWindowInfo::transientFor
257  */
258  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowInfo::transientFor()")
259  static WId transientFor(WId window);
260 
261  /**
262  * Returns the leader window for the group the given window is in, if any.
263  * @param window the id of the window
264  * @deprecated Since 5.0, use KWindowInfo::groupLeader
265  */
266  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowInfo::groupLeader()")
267  static WId groupLeader(WId window);
268 #endif
269  /**
270  * Returns an icon for window @p win.
271  *
272  * If @p width and @p height are specified, the best icon for the requested
273  * size is returned.
274  *
275  * If @p scale is true, the icon is smooth-scaled to have exactly
276  * the requested size.
277  *
278  * @param win the id of the window
279  * @param width the desired width, or -1
280  * @param height the desired height, or -1
281  * @param scale if true the icon will be scaled to the desired size. Otherwise the
282  * icon will not be modified.
283  * @return the icon of the window
284  */
285  static QPixmap icon(WId win, int width = -1, int height = -1, bool scale = false);
286 
287  /**
288  * Masks specifying from which sources to read an icon. They are tried from the best
289  * until an icon is found.
290  * @li NETWM from property from the window manager specification
291  * @li WMHints from WMHints property
292  * @li ClassHint load icon after getting name from the classhint
293  * @li XApp load the standard X icon (last fallback)
294  */
295  enum IconSource {
296  NETWM = 1, //!< read from property from the window manager specification
297  WMHints = 2, //!< read from WMHints property
298  ClassHint = 4, //!< load icon after getting name from the classhint
299  XApp = 8, //!< load the standard X icon (last fallback)
300  };
301  /**
302  * @overload
303  *
304  * Overloaded variant that allows specifying from which sources the icon should be read.
305  * You should usually prefer the simpler variant which tries all possibilities to get
306  * an icon.
307  *
308  * @param win the id of the window
309  * @param width the desired width, or -1
310  * @param height the desired height, or -1
311  * @param scale if true the icon will be scaled to the desired size. Otherwise the
312  * icon will not be modified.
313  * @param flags OR-ed flags from the IconSource enum
314  */
315  static QPixmap icon(WId win, int width, int height, bool scale, int flags);
316 
317  /**
318  * @overload
319  *
320  * Overloaded variant that allows passing in the NETWinInfo to use for reading the
321  * information. This variant is only useful on the X11 platform, other platforms do not
322  * use NETWinInfo and delegate to the variant without NETWinInfo. Though if compiled with
323  * X11 support the X11 variant is used on other platforms if info is not @c nullptr.
324  * This can be used by applications using e.g. platform wayland but also connecting to an
325  * XServer.
326  *
327  * The NETWinInfo must be constructed with property NET::WMIcon in order to use the
328  * IconSource flag NETWM. NET::WM2IconPixmap for IconSource flag WMHints and
329  * NET::WM2WindowClass for IconSource flag ClassHint.
330  *
331  * @param win the id of the window
332  * @param width the desired width, or -1
333  * @param height the desired height, or -1
334  * @param scale if true the icon will be scaled to the desired size. Otherwise the
335  * icon will not be modified.
336  * @param flags OR-ed flags from the IconSource enum
337  * @param into the NETWinInfo to use for reading properties.
338  * @since 5.7
339  **/
340  static QPixmap icon(WId win, int width, int height, bool scale, int flags, NETWinInfo *info);
341 
342  /**
343  * Sets an @p icon and a @p miniIcon on window @p win
344  * @param win the id of the window
345  * @param icon the new icon
346  * @param miniIcon the new mini icon
347  */
348  static void setIcons(WId win, const QPixmap &icon, const QPixmap &miniIcon);
349  /**
350  * Sets the type of window @p win to @p windowType.
351  *
352  * @param win the id of the window
353  * @param windowType the type of the window (see NET::WindowType)
354  */
355  static void setType(WId win, NET::WindowType windowType);
356  /**
357  * Sets the state of window @p win to @p state.
358  *
359  * Possible values are or'ed combinations of NET::Modal,
360  * NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded,
361  * NET::SkipTaskbar, NET::SkipPager, NET::Hidden,
362  * NET::FullScreen, NET::KeepAbove, NET::KeepBelow,
363  * NET::SkipSwitcher
364  *
365  * @param win the id of the window
366  * @param state the new flags that will be set
367  */
368  static void setState(WId win, NET::States state);
369 
370  /**
371  * Clears the state of window @p win from @p state.
372  *
373  * Possible values are or'ed combinations of NET::Modal,
374  * NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded,
375  * NET::SkipTaskbar, NET::SkipPager, NET::Hidden,
376  * NET::FullScreen, NET::KeepAbove, NET::KeepBelow,
377  * NET::SkipSwitcher
378  *
379  * @param win the id of the window
380  * @param state the flags that will be cleared
381  */
382  static void clearState(WId win, NET::States state);
383 
384  /**
385  * Minimizes the window with id @p win.
386  * On X11 this follows the protocol described in ICCCM section 4.1.4.
387  *
388  * @param win The window to minimize
389  * @see unminimizeWindow()
390  */
391  static void minimizeWindow(WId win);
392  /**
393  * Unminimizes the window with id @p win.
394  * On X11 this follows the protocol described in ICCCM section 4.1.4.
395  *
396  * @param win The window to unminimize
397  * @see minimizeWindow()
398  **/
399  static void unminimizeWindow(WId win);
400 
401 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
402  /**
403  * @deprecated since 5.0 the @p animation is ignored.
404  */
405  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowSystem::minimizeWindow(WId)")
406  static void minimizeWindow(WId win, bool animation);
407 #endif
408 
409 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
410  /**
411  * @deprecated since 5.0 the @p animation is ignored.
412  */
413  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowSystem::unminimizeWindow(WId)")
414  static void unminimizeWindow(WId win, bool animation);
415 #endif
416 
417  /**
418  * Raises the given window. This call is only for pagers and similar
419  * tools that represent direct user actions. Applications should not
420  * use it, they should keep using QWidget::raise() or XRaiseWindow()
421  * if necessary.
422  */
423  static void raiseWindow(WId win);
424 
425  /**
426  * Lowers the given window. This call is only for pagers and similar
427  * tools that represent direct user actions. Applications should not
428  * use it, they should keep using QWidget::lower() or XLowerWindow()
429  * if necessary.
430  */
431  static void lowerWindow(WId win);
432 
433  /**
434  * @internal
435  * Returns true if the WM uses IconicState also for windows
436  * on inactive virtual desktops.
437  */
438  static bool icccmCompliantMappingState();
439 
440  /**
441  * Returns the workarea for the specified desktop, or the current
442  * work area if no desktop has been specified.
443  * @param desktop the number of the desktop to check, -1 for the
444  * current desktop
445  * @return the size and position of the desktop
446  **/
447  static QRect workArea(int desktop = -1);
448 
449  /**
450  * Returns the workarea for the specified desktop, or the current
451  * work area if no desktop has been specified. Excludes struts of
452  * clients in the exclude List.
453  *
454  * @param excludes the list of clients whose struts will be excluded
455  * @param desktop the number of the desktop to check, -1 for the
456  * current desktop
457  * @return the size and position of the desktop
458  **/
459  static QRect workArea(const QList<WId> &excludes, int desktop = -1);
460 
461  /**
462  * Returns the name of the specified desktop.
463  * @param desktop the number of the desktop
464  * @return the name of the desktop
465  **/
466  static QString desktopName(int desktop);
467 
468  /**
469  * Sets the name of the specified desktop.
470  * @param desktop the number of the desktop
471  * @param name the new name for the desktop
472  **/
473  static void setDesktopName(int desktop, const QString &name);
474 
475  /**
476  * Returns the state of showing the desktop.
477  */
478  static bool showingDesktop();
479 
480  /**
481  * Sets the state of the "showing desktop" mode of the window manager. If on,
482  * windows are hidden and desktop background is shown and focused.
483  *
484  * @param showing if true, the window manager is put in "showing desktop" mode.
485  * If false, the window manager is put out of that mode.
486  *
487  * @since 5.7.0
488  */
489  static void setShowingDesktop(bool showing);
490 
491  /**
492  * Sets user timestamp @p time on window @p win. The timestamp
493  * is expressed as XServer time. If a window
494  * is shown with user timestamp older than the time of the last
495  * user action, it won't be activated after being shown.
496  * The most common case is the special value 0 which means
497  * not to activate the window after being shown.
498  */
499  static void setUserTime(WId win, long time);
500  /**
501  * Sets the strut of window @p win to @p left_width
502  * ranging from @p left_start to @p left_end on the left edge,
503  * and simiarly for the other edges. For not reserving a strut, pass 0 as the width.
504  * E.g. to reserve 10x10 square in the topleft corner, use e.g.
505  * setExtendedStrut( w, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 ).
506  *
507  * @param win the id of the window
508  * @param left_width width of the strut at the left edge
509  * @param left_start starting y coordinate of the strut at the left edge
510  * @param left_end ending y coordinate of the strut at the left edge
511  * @param right_width width of the strut at the right edge
512  * @param right_start starting y coordinate of the strut at the right edge
513  * @param right_end ending y coordinate of the strut at the right edge
514  * @param top_width width of the strut at the top edge
515  * @param top_start starting x coordinate of the strut at the top edge
516  * @param top_end ending x coordinate of the strut at the top edge
517  * @param bottom_width width of the strut at the bottom edge
518  * @param bottom_start starting x coordinate of the strut at the bottom edge
519  * @param bottom_end ending x coordinate of the strut at the bottom edge
520  */
521  static void setExtendedStrut(WId win,
522  int left_width,
523  int left_start,
524  int left_end,
525  int right_width,
526  int right_start,
527  int right_end,
528  int top_width,
529  int top_start,
530  int top_end,
531  int bottom_width,
532  int bottom_start,
533  int bottom_end);
534 
535  /**
536  * Convenience function for setExtendedStrut() that automatically makes struts
537  * as wide/high as the screen width/height.
538  * Sets the strut of window @p win to @p left, @p right, @p top, @p bottom.
539  *
540  * @param win the id of the window
541  * @param left the left strut
542  * @param right the right strut
543  * @param top the top strut
544  * @param bottom the bottom strut
545  */
546  static void setStrut(WId win, int left, int right, int top, int bottom);
547  /**
548  * Returns true if the WM announces which actions it allows for windows.
549  */
550  static bool allowedActionsSupported();
551  /**
552  * Function that reads and returns the contents of the given text
553  * property (WM_NAME, WM_ICON_NAME,...).
554  */
555  static QString readNameProperty(WId window, unsigned long atom);
556 
557  /**
558  * Allows a window from another process to raise and activate itself.
559  * Depending on the window manager, the grant may only be temporary,
560  * or for a single activation, and it may require the current process
561  * to be the "foreground" one" (ie. the process with the input focus).
562  *
563  * You should call this function before executing actions that may trigger
564  * the showing of a window or dialog in another process, e.g. a dbus signal
565  * or function call, or any other inter-process notification mechanism.
566  *
567  * This is mostly used on Windows, where windows are not allowed to be raised
568  * and activated if their process is not the foreground one, but it may also
569  * apply to other window managers.
570  *
571  * @param pid if specified, the grant only applies to windows belonging to the
572  * specific process. By default, a value of -1 means all processes.
573  */
574  static void allowExternalProcessWindowActivation(int pid = -1);
575 
576  /**
577  * Sets whether the client wishes to block compositing (for better performance)
578  * @since 4.7
579  */
580  static void setBlockingCompositing(WId window, bool active);
581 
582  /**
583  * @internal
584  * Returns true if viewports are mapped to virtual desktops.
585  */
586  static bool mapViewport();
587  /**
588  * @internal
589  * Returns mapped virtual desktop for the given position in the viewport.
590  */
591  static int viewportToDesktop(const QPoint &pos);
592  /**
593  * @internal
594  * Returns mapped virtual desktop for the given window geometry.
595  */
596  static int viewportWindowToDesktop(const QRect &r);
597  /**
598  * @internal
599  * Returns topleft corner of the viewport area for the given mapped virtual desktop.
600  */
601  static QPoint desktopToViewport(int desktop, bool absolute);
602  /**
603  * @internal
604  * @since 4.0.1
605  * Checks the relative difference used to move a window will still be inside
606  * valid desktop area.
607  */
608  static QPoint constrainViewportRelativePosition(const QPoint &pos);
609 
610  /**
611  * Enum describing the windowing system platform used by the QGuiApplication.
612  * @see platform
613  * @since 5.25
614  **/
615  enum class Platform {
616  /**
617  * A platform unknown to the application is used
618  **/
619  Unknown,
620  /**
621  * The xcb/X11 windowing system platorm.
622  **/
623  X11,
624  /**
625  * The Wayland windowing system platform.
626  **/
627  Wayland,
628  };
629  /**
630  * Returns the Platform used by the QGuiApplication.
631  * This method allows to check for the used windowing system in a cheap and reliable way.
632  * The Platform gets resolved the first time the method is invoked and cached for further
633  * usages.
634  * @returns The Platform used by the QGuiApplication.
635  * @since 5.25
636  **/
637  static Platform platform();
638 
639  /**
640  * Convenience method to check whether the Platform is X11.
641  * @see platform
642  * @see isPlatformWayland
643  * @since 5.25
644  **/
645  static bool isPlatformX11();
646 
647  /**
648  * Convenience method to check whether the Platform is Wayland.
649  * @see platform
650  * @see isPlatformX11
651  * @since 5.25
652  **/
653  static bool isPlatformWayland();
654 
655  /**
656  * Requests an xdg_activation_v1 token for a specific window.
657  *
658  * @p win window in behalf this request is made
659  * @p serial of the event that triggered the request
660  * @p app_id identifier of the application that we are launching
661  *
662  * @see currentSerial
663  * @since 5.83
664  */
665  static void requestXdgActivationToken(QWindow *win, uint32_t serial, const QString &app_id);
666 
667  /**
668  * Sets the @p token that will be used when activateWindow is called next
669  *
670  * @since 5.83
671  */
672  static void setCurrentXdgActivationToken(const QString &token);
673 
674  /**
675  * Offers the seat's current serial
676  *
677  * This will mostly be useful on wayland sessions.
678  *
679  * @since 5.83
680  */
681  static quint32 lastInputSerial(QWindow *window);
682 
683 Q_SIGNALS:
684 
685  /**
686  * Switched to another virtual desktop.
687  * @param desktop the number of the new desktop
688  */
689  void currentDesktopChanged(int desktop);
690 
691  /**
692  * A window has been added.
693  * @param id the id of the window
694  */
695  void windowAdded(WId id);
696 
697  /**
698  * A window has been removed.
699  * @param id the id of the window that has been removed
700  */
701  void windowRemoved(WId id);
702 
703  /**
704  * Hint that <Window> is active (= has focus) now.
705  * @param id the id of the window that is active
706  */
707  void activeWindowChanged(WId id);
708 
709  /**
710  * Desktops have been renamed.
711  */
712  void desktopNamesChanged();
713 
714  /**
715  * The number of desktops changed.
716  * @param num the new number of desktops
717  */
718  void numberOfDesktopsChanged(int num);
719 
720  /**
721  * The workarea has changed.
722  */
723  void workAreaChanged();
724 
725  /**
726  * Something changed with the struts, may or may not have changed
727  * the work area. Usually just using the workAreaChanged() signal
728  * is sufficient.
729  */
730  void strutChanged();
731 
732  /**
733  * Emitted when the stacking order of the window changed. The new order
734  * can be obtained with stackingOrder().
735  */
736  void stackingOrderChanged();
737 
738  /**
739  * The window changed.
740  *
741  * Carries the NET::Properties and NET::Properties2 that were changed.
742  *
743  * @param id the id of the window
744  * @param properties the properties that were modified
745  * @param properties2 the properties2 that were modified
746  *
747  * @since 5.0
748  */
749  void windowChanged(WId id, NET::Properties properties, NET::Properties2 properties2); // clazy:exclude=overloaded-signal
750 
751 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
752  /**
753  * The window changed.
754  *
755  * The properties parameter contains the NET properties that
756  * were modified (see netwm_def.h). First element are NET::Property
757  * values, second element are NET::Property2 values (i.e. the format
758  * is the same like for the NETWinInfo class constructor).
759  * @param id the id of the window
760  * @param properties the properties that were modified
761  *
762  * @deprecated since 5.0 use windowChanged(WId, NET::Properties, NET::Properties2)
763  */
764  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowSystem::windowChanged(WId, NET::Properties, NET::Properties2)")
765  QT_MOC_COMPAT void windowChanged(WId id, const unsigned long *properties); // clazy:exclude=overloaded-signal
766 #endif
767 
768 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
769  /**
770  * The window changed.
771  *
772  * The unsigned int parameter contains the NET properties that
773  * were modified (see netwm_def.h).
774  * @param id the id of the window
775  * @param properties the properties that were modified
776  * @deprecated Since 5.0
777  */
778  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KWindowSystem::windowChanged(WId, NET::Properties, NET::Properties2)")
779  QT_MOC_COMPAT void windowChanged(WId id, unsigned int properties); // clazy:exclude=overloaded-signal
780 #endif
781 
782 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 80)
783  /**
784  * The window changed somehow.
785  * @param id the id of the window
786  *
787  * @deprecated since 5.80, use windowChanged(WId, NET::Properties, NET::Properties2);
788  **/
789  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 80, "Use KWindowSystem::windowChanged(WId, NET::Properties, NET::Properties2)")
790  void windowChanged(WId id); // clazy:exclude=overloaded-signal
791 #endif
792 
793  /**
794  * The state of showing the desktop has changed.
795  */
796  void showingDesktopChanged(bool showing);
797 
798  /**
799  * Compositing was enabled or disabled.
800  *
801  * Note that this signal may be emitted before any compositing plugins
802  * have been initialized in the window manager.
803  *
804  * If you need to check if a specific compositing plugin such as the
805  * blur effect is enabled, you should track that separately rather
806  * than test for it in a slot connected to this signal.
807  *
808  * @since 4.7.1
809  */
810  void compositingChanged(bool enabled);
811 
812  /**
813  * Activation @p token to pass to the client.
814  *
815  * @see requestXdgActivationToken
816  * @see setCurrentXdgActivationToken
817  * @since 5.83
818  */
819  void xdgActivationTokenArrived(int serial, const QString &token);
820 
821 protected:
822  void connectNotify(const QMetaMethod &signal) override;
823 
824 private:
825  friend class KWindowSystemStaticContainer;
826 
827  KWindowSystem()
828  {
829  }
830  static KWindowSystemPrivate *d_func();
831 };
832 
833 #endif
Convenience access to certain properties and features of the window manager.
Definition: kwindowsystem.h:44
This class provides information about a given window in the platform specific windowing system...
Definition: kwindowinfo.h:62
IconSource
Masks specifying from which sources to read an icon.
WindowType
Window type.
Definition: netwm_def.h:320
Platform
Enum describing the windowing system platform used by the QGuiApplication.
Base namespace class.
Definition: netwm_def.h:297
Common API for application window properties/protocols.
Definition: netwm.h:944
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Aug 3 2021 22:40:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.