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 307 Lines • ▼ Show 20 Line(s) | 286 | public: | |||
409 | void sendToScreen(int screen); | 414 | void sendToScreen(int screen); | ||
410 | const QKeySequence &shortcut() const { | 415 | const QKeySequence &shortcut() const { | ||
411 | return _shortcut; | 416 | return _shortcut; | ||
412 | } | 417 | } | ||
413 | void setShortcut(const QString &cut); | 418 | void setShortcut(const QString &cut); | ||
414 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | 419 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | ||
415 | void setOnAllDesktops(bool set); | 420 | void setOnAllDesktops(bool set); | ||
416 | void setDesktop(int); | 421 | void setDesktop(int); | ||
422 | Q_INVOKABLE virtual void unSetDesktop(int desktop); | ||||
417 | int desktop() const override { | 423 | int desktop() const override { | ||
418 | return m_desktop; | 424 | return m_desktops.isEmpty() ? (int)NET::OnAllDesktops : m_desktops.last()->x11DesktopNumber(); | ||
425 | } | ||||
426 | virtual QList<VirtualDesktop *> desktops() const { | ||||
427 | return m_desktops; | ||||
419 | } | 428 | } | ||
429 | void removeDesktop(VirtualDesktop *desktop) { | ||||
430 | m_desktops.removeAll(desktop); | ||||
431 | } | ||||
432 | QList<int> x11DesktopIds() const; | ||||
433 | | ||||
420 | void setMinimized(bool set); | 434 | void setMinimized(bool set); | ||
421 | /** | 435 | /** | ||
422 | * Minimizes this client plus its transients | 436 | * Minimizes this client plus its transients | ||
423 | */ | 437 | */ | ||
424 | void minimize(bool avoid_animation = false); | 438 | void minimize(bool avoid_animation = false); | ||
425 | void unminimize(bool avoid_animation = false); | 439 | void unminimize(bool avoid_animation = false); | ||
426 | bool isMinimized() const { | 440 | bool isMinimized() const { | ||
427 | return m_minimized; | 441 | return m_minimized; | ||
▲ Show 20 Lines • Show All 303 Lines • ▼ Show 20 Line(s) | 738 | Q_SIGNALS: | |||
731 | void keepAboveChanged(bool); | 745 | void keepAboveChanged(bool); | ||
732 | void keepBelowChanged(bool); | 746 | void keepBelowChanged(bool); | ||
733 | /** | 747 | /** | ||
734 | * Emitted whenever the demands attention state changes. | 748 | * Emitted whenever the demands attention state changes. | ||
735 | **/ | 749 | **/ | ||
736 | void demandsAttentionChanged(); | 750 | void demandsAttentionChanged(); | ||
737 | void desktopPresenceChanged(KWin::AbstractClient*, int); // to be forwarded by Workspace | 751 | void desktopPresenceChanged(KWin::AbstractClient*, int); // to be forwarded by Workspace | ||
738 | void desktopChanged(); | 752 | void desktopChanged(); | ||
753 | void x11DesktopIdsChanged(); | ||||
739 | void shadeChanged(); | 754 | void shadeChanged(); | ||
740 | void minimizedChanged(); | 755 | void minimizedChanged(); | ||
741 | void clientMinimized(KWin::AbstractClient* client, bool animate); | 756 | void clientMinimized(KWin::AbstractClient* client, bool animate); | ||
742 | void clientUnminimized(KWin::AbstractClient* client, bool animate); | 757 | void clientUnminimized(KWin::AbstractClient* client, bool animate); | ||
743 | void paletteChanged(const QPalette &p); | 758 | void paletteChanged(const QPalette &p); | ||
744 | void captionChanged(); | 759 | void captionChanged(); | ||
745 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | 760 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | ||
746 | void clientMaximizedStateChanged(KWin::AbstractClient* c, bool h, bool v); | 761 | void clientMaximizedStateChanged(KWin::AbstractClient* c, bool h, bool v); | ||
▲ Show 20 Lines • Show All 333 Lines • ▼ Show 20 Line(s) | 1085 | private: | |||
1080 | bool m_skipSwitcher = false; | 1095 | bool m_skipSwitcher = false; | ||
1081 | QIcon m_icon; | 1096 | QIcon m_icon; | ||
1082 | bool m_active = false; | 1097 | bool m_active = false; | ||
1083 | bool m_keepAbove = false; | 1098 | bool m_keepAbove = false; | ||
1084 | bool m_keepBelow = false; | 1099 | bool m_keepBelow = false; | ||
1085 | bool m_demandsAttention = false; | 1100 | bool m_demandsAttention = false; | ||
1086 | bool m_minimized = false; | 1101 | bool m_minimized = false; | ||
1087 | QTimer *m_autoRaiseTimer = nullptr; | 1102 | QTimer *m_autoRaiseTimer = nullptr; | ||
1088 | int m_desktop = 0; // 0 means not on any desktop yet | 1103 | 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. | |||||
1089 | 1104 | | |||
1090 | QString m_colorScheme; | 1105 | QString m_colorScheme; | ||
1091 | std::shared_ptr<Decoration::DecorationPalette> m_palette; | 1106 | std::shared_ptr<Decoration::DecorationPalette> m_palette; | ||
1092 | static QHash<QString, std::weak_ptr<Decoration::DecorationPalette>> s_palettes; | 1107 | static QHash<QString, std::weak_ptr<Decoration::DecorationPalette>> s_palettes; | ||
1093 | static std::shared_ptr<Decoration::DecorationPalette> s_defaultPalette; | 1108 | static std::shared_ptr<Decoration::DecorationPalette> s_defaultPalette; | ||
1094 | 1109 | | |||
1095 | KWayland::Server::PlasmaWindowInterface *m_windowManagementInterface = nullptr; | 1110 | KWayland::Server::PlasmaWindowInterface *m_windowManagementInterface = nullptr; | ||
1096 | 1111 | | |||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
Coding style nitpick: