Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.h
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 62 | { | |||
---|---|---|---|---|---|
79 | Q_PROPERTY(bool isCurrentTab READ isCurrentTab) | 79 | Q_PROPERTY(bool isCurrentTab READ isCurrentTab) | ||
80 | /** | 80 | /** | ||
81 | * Whether this Client is active or not. Use Workspace::activateClient() to activate a Client. | 81 | * Whether this Client is active or not. Use Workspace::activateClient() to activate a Client. | ||
82 | * @see Workspace::activateClient | 82 | * @see Workspace::activateClient | ||
83 | **/ | 83 | **/ | ||
84 | Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) | 84 | Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) | ||
85 | /** | 85 | /** | ||
86 | * The desktop this Client is on. If the Client is on all desktops the property has value -1. | 86 | * The desktop this Client is on. If the Client is on all desktops the property has value -1. | ||
87 | * This is a legacy property, use x11DesktopIds instead | ||||
87 | **/ | 88 | **/ | ||
88 | Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged) | 89 | Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged) | ||
89 | /** | 90 | /** | ||
90 | * Whether the Client is on all desktops. That is desktop is -1. | 91 | * Whether the Client is on all desktops. That is desktop is -1. | ||
91 | **/ | 92 | **/ | ||
92 | Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops WRITE setOnAllDesktops NOTIFY desktopChanged) | 93 | Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops WRITE setOnAllDesktops NOTIFY desktopChanged) | ||
93 | /** | 94 | /** | ||
95 | * The x11 ids for all desktops this client is in. On X11 this list will always have a length of 1 | ||||
96 | **/ | ||||
97 | Q_PROPERTY(QList<int> x11DesktopIds READ x11DesktopIds NOTIFY x11DesktopIdsChanged) | ||||
98 | /** | ||||
94 | * Indicates that the window should not be included on a taskbar. | 99 | * Indicates that the window should not be included on a taskbar. | ||
95 | **/ | 100 | **/ | ||
96 | Q_PROPERTY(bool skipTaskbar READ skipTaskbar WRITE setSkipTaskbar NOTIFY skipTaskbarChanged) | 101 | Q_PROPERTY(bool skipTaskbar READ skipTaskbar WRITE setSkipTaskbar NOTIFY skipTaskbarChanged) | ||
97 | /** | 102 | /** | ||
98 | * Indicates that the window should not be included on a Pager. | 103 | * Indicates that the window should not be included on a Pager. | ||
99 | **/ | 104 | **/ | ||
100 | Q_PROPERTY(bool skipPager READ skipPager WRITE setSkipPager NOTIFY skipPagerChanged) | 105 | Q_PROPERTY(bool skipPager READ skipPager WRITE setSkipPager NOTIFY skipPagerChanged) | ||
101 | /** | 106 | /** | ||
▲ Show 20 Lines • Show All 316 Lines • ▼ Show 20 Line(s) | 294 | public: | |||
418 | void sendToScreen(int screen); | 423 | void sendToScreen(int screen); | ||
419 | const QKeySequence &shortcut() const { | 424 | const QKeySequence &shortcut() const { | ||
420 | return _shortcut; | 425 | return _shortcut; | ||
421 | } | 426 | } | ||
422 | void setShortcut(const QString &cut); | 427 | void setShortcut(const QString &cut); | ||
423 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | 428 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | ||
424 | void setOnAllDesktops(bool set); | 429 | void setOnAllDesktops(bool set); | ||
425 | void setDesktop(int); | 430 | void setDesktop(int); | ||
431 | Q_INVOKABLE virtual void unSetDesktop(int desktop); | ||||
426 | int desktop() const override { | 432 | int desktop() const override { | ||
427 | return m_desktop; | 433 | return m_desktops.isEmpty() ? (int)NET::OnAllDesktops : m_desktops.last()->x11DesktopNumber(); | ||
434 | } | ||||
435 | virtual QList<VirtualDesktop *> desktops() const { | ||||
436 | return m_desktops; | ||||
428 | } | 437 | } | ||
438 | void removeDesktop(VirtualDesktop *desktop) { | ||||
439 | m_desktops.removeAll(desktop); | ||||
440 | } | ||||
441 | QList<int> x11DesktopIds() const; | ||||
442 | | ||||
429 | void setMinimized(bool set); | 443 | void setMinimized(bool set); | ||
430 | /** | 444 | /** | ||
431 | * Minimizes this client plus its transients | 445 | * Minimizes this client plus its transients | ||
432 | */ | 446 | */ | ||
433 | void minimize(bool avoid_animation = false); | 447 | void minimize(bool avoid_animation = false); | ||
434 | void unminimize(bool avoid_animation = false); | 448 | void unminimize(bool avoid_animation = false); | ||
435 | bool isMinimized() const { | 449 | bool isMinimized() const { | ||
436 | return m_minimized; | 450 | return m_minimized; | ||
▲ Show 20 Lines • Show All 315 Lines • ▼ Show 20 Line(s) | 759 | Q_SIGNALS: | |||
752 | void keepAboveChanged(bool); | 766 | void keepAboveChanged(bool); | ||
753 | void keepBelowChanged(bool); | 767 | void keepBelowChanged(bool); | ||
754 | /** | 768 | /** | ||
755 | * Emitted whenever the demands attention state changes. | 769 | * Emitted whenever the demands attention state changes. | ||
756 | **/ | 770 | **/ | ||
757 | void demandsAttentionChanged(); | 771 | void demandsAttentionChanged(); | ||
758 | void desktopPresenceChanged(KWin::AbstractClient*, int); // to be forwarded by Workspace | 772 | void desktopPresenceChanged(KWin::AbstractClient*, int); // to be forwarded by Workspace | ||
759 | void desktopChanged(); | 773 | void desktopChanged(); | ||
774 | void x11DesktopIdsChanged(); | ||||
760 | void shadeChanged(); | 775 | void shadeChanged(); | ||
761 | void minimizedChanged(); | 776 | void minimizedChanged(); | ||
762 | void clientMinimized(KWin::AbstractClient* client, bool animate); | 777 | void clientMinimized(KWin::AbstractClient* client, bool animate); | ||
763 | void clientUnminimized(KWin::AbstractClient* client, bool animate); | 778 | void clientUnminimized(KWin::AbstractClient* client, bool animate); | ||
764 | void paletteChanged(const QPalette &p); | 779 | void paletteChanged(const QPalette &p); | ||
765 | void colorSchemeChanged(); | 780 | void colorSchemeChanged(); | ||
766 | void captionChanged(); | 781 | void captionChanged(); | ||
767 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | 782 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | ||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 1107 | private: | |||
1102 | bool m_skipSwitcher = false; | 1117 | bool m_skipSwitcher = false; | ||
1103 | QIcon m_icon; | 1118 | QIcon m_icon; | ||
1104 | bool m_active = false; | 1119 | bool m_active = false; | ||
1105 | bool m_keepAbove = false; | 1120 | bool m_keepAbove = false; | ||
1106 | bool m_keepBelow = false; | 1121 | bool m_keepBelow = false; | ||
1107 | bool m_demandsAttention = false; | 1122 | bool m_demandsAttention = false; | ||
1108 | bool m_minimized = false; | 1123 | bool m_minimized = false; | ||
1109 | QTimer *m_autoRaiseTimer = nullptr; | 1124 | QTimer *m_autoRaiseTimer = nullptr; | ||
1110 | int m_desktop = 0; // 0 means not on any desktop yet | 1125 | QList <VirtualDesktop *> m_desktops; | ||
zzag: Coding style nitpick:
```lang=cpp
QList<VirtualDesktop*> m_desktops;
``` | |||||
even for types inside templates, i've always assumed the normal variable declaration of ldelibs style (which kwin uses, tough still not everywhere as it was converted from a radically different style in the past) mart: even for types inside templates, i've always assumed the normal variable declaration of ldelibs… | |||||
zzag: Yeah, you're right about whitespace before '*'.
Looks like Qt does the same. | |||||
1111 | 1126 | | |||
1112 | QString m_colorScheme; | 1127 | QString m_colorScheme; | ||
1113 | std::shared_ptr<Decoration::DecorationPalette> m_palette; | 1128 | std::shared_ptr<Decoration::DecorationPalette> m_palette; | ||
1114 | static QHash<QString, std::weak_ptr<Decoration::DecorationPalette>> s_palettes; | 1129 | static QHash<QString, std::weak_ptr<Decoration::DecorationPalette>> s_palettes; | ||
1115 | static std::shared_ptr<Decoration::DecorationPalette> s_defaultPalette; | 1130 | static std::shared_ptr<Decoration::DecorationPalette> s_defaultPalette; | ||
1116 | 1131 | | |||
1117 | KWayland::Server::PlasmaWindowInterface *m_windowManagementInterface = nullptr; | 1132 | KWayland::Server::PlasmaWindowInterface *m_windowManagementInterface = nullptr; | ||
1118 | 1133 | | |||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
Coding style nitpick: