Changeset View
Standalone View
workspace.h
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Line(s) | 67 | public: | |||
---|---|---|---|---|---|
239 | * @returns List of all internal clients currently managed by Workspace | 239 | * @returns List of all internal clients currently managed by Workspace | ||
240 | */ | 240 | */ | ||
241 | const QList<InternalClient *> &internalClients() const { | 241 | const QList<InternalClient *> &internalClients() const { | ||
242 | return m_internalClients; | 242 | return m_internalClients; | ||
243 | } | 243 | } | ||
244 | 244 | | |||
245 | void stackScreenEdgesUnderOverrideRedirect(); | 245 | void stackScreenEdgesUnderOverrideRedirect(); | ||
246 | 246 | | |||
247 | public: | 247 | public: | ||
zzag: Style: Put whitespace before `*`.
| |||||
248 | QPoint cascadeOffset(const AbstractClient *c) const; | 248 | QPoint cascadeOffset(const AbstractClient *c) const; | ||
249 | 249 | | |||
250 | private: | 250 | private: | ||
251 | Compositor *m_compositor; | 251 | Compositor *m_compositor; | ||
252 | 252 | | |||
253 | //------------------------------------------------- | 253 | //------------------------------------------------- | ||
254 | // Unsorted | 254 | // Unsorted | ||
255 | 255 | | |||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 256 | public: | |||
334 | 334 | | |||
335 | void focusToNull(); // SELI TODO: Public? | 335 | void focusToNull(); // SELI TODO: Public? | ||
336 | 336 | | |||
337 | void clientShortcutUpdated(AbstractClient* c); | 337 | void clientShortcutUpdated(AbstractClient* c); | ||
338 | bool shortcutAvailable(const QKeySequence &cut, AbstractClient* ignore = nullptr) const; | 338 | bool shortcutAvailable(const QKeySequence &cut, AbstractClient* ignore = nullptr) const; | ||
339 | bool globalShortcutsDisabled() const; | 339 | bool globalShortcutsDisabled() const; | ||
340 | void disableGlobalShortcutsForClient(bool disable); | 340 | void disableGlobalShortcutsForClient(bool disable); | ||
341 | 341 | | |||
342 | void sessionSaveStarted(); | | |||
343 | void sessionSaveDone(); | | |||
344 | void setWasUserInteraction(); | 342 | void setWasUserInteraction(); | ||
345 | bool wasUserInteraction() const; | 343 | bool wasUserInteraction() const; | ||
346 | bool sessionSaving() const; | 344 | bool sessionSaving() const; | ||
347 | 345 | | |||
348 | int packPositionLeft(const AbstractClient *client, int oldX, bool leftEdge) const; | 346 | int packPositionLeft(const AbstractClient *client, int oldX, bool leftEdge) const; | ||
349 | int packPositionRight(const AbstractClient *client, int oldX, bool rightEdge) const; | 347 | int packPositionRight(const AbstractClient *client, int oldX, bool rightEdge) const; | ||
350 | int packPositionUp(const AbstractClient *client, int oldY, bool topEdge) const; | 348 | int packPositionUp(const AbstractClient *client, int oldY, bool topEdge) const; | ||
351 | int packPositionDown(const AbstractClient *client, int oldY, bool bottomEdge) const; | 349 | int packPositionDown(const AbstractClient *client, int oldY, bool bottomEdge) const; | ||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 417 | public Q_SLOTS: | |||
474 | 472 | | |||
475 | void slotKillWindow(); | 473 | void slotKillWindow(); | ||
476 | 474 | | |||
477 | void slotSetupWindowShortcut(); | 475 | void slotSetupWindowShortcut(); | ||
478 | void setupWindowShortcutDone(bool); | 476 | void setupWindowShortcutDone(bool); | ||
479 | 477 | | |||
480 | void updateClientArea(); | 478 | void updateClientArea(); | ||
481 | 479 | | |||
480 | /** | ||||
481 | * Updates kwin's internal knowledge of the state of the | ||||
482 | * session outside. | ||||
483 | */ | ||||
484 | void setSessionState(SessionState state); | ||||
485 | SessionState sessionState() const; | ||||
Hmm, that's kinda domain of SessionManager. Also, the last one doesn't qualify as a slot. What do you think about moving these two to SessionManager? zzag: Hmm, that's kinda domain of SessionManager. Also, the last one doesn't qualify as a slot.
What… | |||||
Yeah, I was torn originally, so no objections. My reasoning against was that I didn't want to have the state in one place and Workspace::sessionSaving() in another, but I could port all the relevant code calling that. davidedmundson: Yeah, I was torn originally, so no objections.
My reasoning against was that I didn't want to… | |||||
zzag: Yes please | |||||
486 | | ||||
482 | private Q_SLOTS: | 487 | private Q_SLOTS: | ||
483 | void desktopResized(); | 488 | void desktopResized(); | ||
484 | void selectWmInputEventMask(); | 489 | void selectWmInputEventMask(); | ||
485 | void slotUpdateToolWindows(); | 490 | void slotUpdateToolWindows(); | ||
486 | void delayFocus(); | 491 | void delayFocus(); | ||
487 | void slotReloadConfig(); | 492 | void slotReloadConfig(); | ||
488 | void updateCurrentActivity(const QString &new_activity); | 493 | void updateCurrentActivity(const QString &new_activity); | ||
489 | // virtual desktop handling | 494 | // virtual desktop handling | ||
490 | void slotDesktopCountChanged(uint previousCount, uint newCount); | 495 | void slotDesktopCountChanged(uint previousCount, uint newCount); | ||
491 | void slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop); | 496 | void slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop); | ||
492 | 497 | | |||
493 | // session management | 498 | // session management | ||
494 | void saveState(QSessionManager &sm); | 499 | void saveState(QSessionManager &sm); | ||
495 | void commitData(QSessionManager &sm); | | |||
496 | 500 | | |||
497 | Q_SIGNALS: | 501 | Q_SIGNALS: | ||
498 | /** | 502 | /** | ||
499 | * Emitted after the Workspace has setup the complete initialization process. | 503 | * Emitted after the Workspace has setup the complete initialization process. | ||
500 | * This can be used to connect to for performing post-workspace initialization. | 504 | * This can be used to connect to for performing post-workspace initialization. | ||
501 | */ | 505 | */ | ||
502 | void workspaceInitialized(); | 506 | void workspaceInitialized(); | ||
503 | 507 | | |||
Show All 22 Lines | |||||
526 | */ | 530 | */ | ||
527 | void internalClientAdded(KWin::InternalClient *client); | 531 | void internalClientAdded(KWin::InternalClient *client); | ||
528 | 532 | | |||
529 | /** | 533 | /** | ||
530 | * This signal is emitted whenever an internal client gets removed. | 534 | * This signal is emitted whenever an internal client gets removed. | ||
531 | */ | 535 | */ | ||
532 | void internalClientRemoved(KWin::InternalClient *client); | 536 | void internalClientRemoved(KWin::InternalClient *client); | ||
533 | 537 | | |||
538 | void sessionStateChanged(); | ||||
539 | | ||||
534 | private: | 540 | private: | ||
535 | void init(); | 541 | void init(); | ||
536 | void initWithX11(); | 542 | void initWithX11(); | ||
537 | void initShortcuts(); | 543 | void initShortcuts(); | ||
538 | template <typename Slot> | 544 | template <typename Slot> | ||
539 | void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, | 545 | void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, | ||
540 | Slot slot, const QVariant &data = QVariant()); | 546 | Slot slot, const QVariant &data = QVariant()); | ||
541 | template <typename T, typename Slot> | 547 | template <typename T, typename Slot> | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
611 | QList<AbstractClient*> attention_chain; | 617 | QList<AbstractClient*> attention_chain; | ||
612 | 618 | | |||
613 | bool showing_desktop; | 619 | bool showing_desktop; | ||
614 | 620 | | |||
615 | GroupList groups; | 621 | GroupList groups; | ||
616 | 622 | | |||
617 | bool was_user_interaction; | 623 | bool was_user_interaction; | ||
618 | QScopedPointer<X11EventFilter> m_wasUserInteractionFilter; | 624 | QScopedPointer<X11EventFilter> m_wasUserInteractionFilter; | ||
619 | bool session_saving; | 625 | | ||
626 | SessionState m_sessionState = SessionState::Normal; | ||||
620 | int session_active_client; | 627 | int session_active_client; | ||
621 | int session_desktop; | 628 | int session_desktop; | ||
622 | 629 | | |||
623 | int block_focus; | 630 | int block_focus; | ||
624 | 631 | | |||
625 | /** | 632 | /** | ||
626 | * Holds the menu containing the user actions which is shown | 633 | * Holds the menu containing the user actions which is shown | ||
627 | * on e.g. right click the window decoration. | 634 | * on e.g. right click the window decoration. | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 742 | { | |||
737 | return stacking_order; | 744 | return stacking_order; | ||
738 | } | 745 | } | ||
739 | 746 | | |||
740 | inline bool Workspace::wasUserInteraction() const | 747 | inline bool Workspace::wasUserInteraction() const | ||
741 | { | 748 | { | ||
742 | return was_user_interaction; | 749 | return was_user_interaction; | ||
743 | } | 750 | } | ||
744 | 751 | | |||
745 | inline void Workspace::sessionSaveStarted() | | |||
746 | { | | |||
747 | session_saving = true; | | |||
748 | } | | |||
749 | | ||||
750 | inline bool Workspace::sessionSaving() const | 752 | inline bool Workspace::sessionSaving() const | ||
Style: We still follow the Frameworks coding style, which says that we have to put whitespace before *. One could argue that return types have special meaning, but a coding review is not a place to enforce personal preferences that are uncommon or haven't been agreed upon by other developers. Such matter must be raised to the discussion in other places, e.g. a task or a mailing list. Also, no such a tool exists that would format code with this style. zzag: Style: We still follow the Frameworks coding style, which says that we have to put whitespace… | |||||
zzag: This inline comment is not addressed. | |||||
751 | { | 753 | { | ||
752 | return session_saving; | 754 | return m_sessionState == SessionState::Saving; | ||
753 | } | 755 | } | ||
754 | 756 | | |||
755 | inline bool Workspace::showingDesktop() const | 757 | inline bool Workspace::showingDesktop() const | ||
756 | { | 758 | { | ||
757 | return showing_desktop; | 759 | return showing_desktop; | ||
758 | } | 760 | } | ||
759 | 761 | | |||
760 | inline bool Workspace::globalShortcutsDisabled() const | 762 | inline bool Workspace::globalShortcutsDisabled() const | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
Style: Put whitespace before *.