Changeset View
Changeset View
Standalone View
Standalone View
workspace.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 106 | Workspace::Workspace(const QString &sessionKey) | |||
---|---|---|---|---|---|
113 | , active_client(nullptr) | 113 | , active_client(nullptr) | ||
114 | , last_active_client(nullptr) | 114 | , last_active_client(nullptr) | ||
115 | , most_recently_raised(nullptr) | 115 | , most_recently_raised(nullptr) | ||
116 | , movingClient(nullptr) | 116 | , movingClient(nullptr) | ||
117 | , delayfocus_client(nullptr) | 117 | , delayfocus_client(nullptr) | ||
118 | , force_restacking(false) | 118 | , force_restacking(false) | ||
119 | , showing_desktop(false) | 119 | , showing_desktop(false) | ||
120 | , was_user_interaction(false) | 120 | , was_user_interaction(false) | ||
121 | , session_saving(false) | | |||
122 | , block_focus(0) | 121 | , block_focus(0) | ||
123 | , m_userActionsMenu(new UserActionsMenu(this)) | 122 | , m_userActionsMenu(new UserActionsMenu(this)) | ||
124 | , client_keys_dialog(nullptr) | 123 | , client_keys_dialog(nullptr) | ||
125 | , client_keys_client(nullptr) | 124 | , client_keys_client(nullptr) | ||
126 | , global_shortcuts_disabled_for_client(false) | 125 | , global_shortcuts_disabled_for_client(false) | ||
127 | , workspaceInit(true) | 126 | , workspaceInit(true) | ||
128 | , startup(nullptr) | 127 | , startup(nullptr) | ||
129 | , set_active_client_recursion(0) | 128 | , set_active_client_recursion(0) | ||
Show All 21 Lines | 146 | #endif | |||
151 | 150 | | |||
152 | options->loadConfig(); | 151 | options->loadConfig(); | ||
153 | options->loadCompositingConfig(false); | 152 | options->loadCompositingConfig(false); | ||
154 | 153 | | |||
155 | delayFocusTimer = nullptr; | 154 | delayFocusTimer = nullptr; | ||
156 | 155 | | |||
157 | if (!sessionKey.isEmpty()) | 156 | if (!sessionKey.isEmpty()) | ||
158 | loadSessionInfo(sessionKey); | 157 | loadSessionInfo(sessionKey); | ||
159 | connect(qApp, &QGuiApplication::commitDataRequest, this, &Workspace::commitData); | | |||
160 | connect(qApp, &QGuiApplication::saveStateRequest, this, &Workspace::saveState); | 158 | connect(qApp, &QGuiApplication::saveStateRequest, this, &Workspace::saveState); | ||
161 | 159 | | |||
162 | RuleBook::create(this)->load(); | 160 | RuleBook::create(this)->load(); | ||
163 | 161 | | |||
164 | ScreenEdges::create(this); | 162 | ScreenEdges::create(this); | ||
165 | 163 | | |||
166 | // VirtualDesktopManager needs to be created prior to init shortcuts | 164 | // VirtualDesktopManager needs to be created prior to init shortcuts | ||
167 | // and prior to TabBox, due to TabBox connecting to signals | 165 | // and prior to TabBox, due to TabBox connecting to signals | ||
Show All 16 Lines | 174 | #endif | |||
184 | connect(this, &Workspace::currentDesktopChanged, m_compositor, &Compositor::addRepaintFull); | 182 | connect(this, &Workspace::currentDesktopChanged, m_compositor, &Compositor::addRepaintFull); | ||
185 | connect(m_compositor, &QObject::destroyed, this, [this] { m_compositor = nullptr; }); | 183 | connect(m_compositor, &QObject::destroyed, this, [this] { m_compositor = nullptr; }); | ||
186 | 184 | | |||
187 | auto decorationBridge = Decoration::DecorationBridge::create(this); | 185 | auto decorationBridge = Decoration::DecorationBridge::create(this); | ||
188 | decorationBridge->init(); | 186 | decorationBridge->init(); | ||
189 | connect(this, &Workspace::configChanged, decorationBridge, &Decoration::DecorationBridge::reconfigure); | 187 | connect(this, &Workspace::configChanged, decorationBridge, &Decoration::DecorationBridge::reconfigure); | ||
190 | 188 | | |||
191 | new DBusInterface(this); | 189 | new DBusInterface(this); | ||
190 | new SessionManager(this); | ||||
192 | 191 | | |||
193 | Outline::create(this); | 192 | Outline::create(this); | ||
194 | 193 | | |||
195 | initShortcuts(); | 194 | initShortcuts(); | ||
196 | 195 | | |||
197 | init(); | 196 | init(); | ||
198 | } | 197 | } | ||
199 | 198 | | |||
▲ Show 20 Lines • Show All 1622 Lines • ▼ Show 20 Line(s) | 1819 | { | |||
1822 | 1821 | | |||
1823 | markXStackingOrderAsDirty(); | 1822 | markXStackingOrderAsDirty(); | ||
1824 | updateStackingOrder(true); | 1823 | updateStackingOrder(true); | ||
1825 | updateClientArea(); | 1824 | updateClientArea(); | ||
1826 | 1825 | | |||
1827 | emit internalClientRemoved(client); | 1826 | emit internalClientRemoved(client); | ||
1828 | } | 1827 | } | ||
1829 | 1828 | | |||
1829 | void Workspace::setSessionState(SessionState state) | ||||
1830 | { | ||||
1831 | if (state == m_sessionState) { | ||||
1832 | return; | ||||
1833 | } | ||||
1834 | //starting session save | ||||
zzag: Put whitespace between `//` and the text. | |||||
davidedmundson: I can't wait for clang-format! | |||||
zzag: Unfortunately clang-format doesn't format comments. | |||||
1835 | if (state == SessionState::Saving) { | ||||
1836 | RuleBook::self()->setUpdatesDisabled(true); | ||||
1837 | } | ||||
1838 | //Session save is done | ||||
1839 | if (m_sessionState == SessionState::Saving) { | ||||
1840 | RuleBook::self()->setUpdatesDisabled(false); | ||||
1841 | foreach (X11Client *c, clients) { | ||||
zzag: * Don't use foreach in new code.
* Change `c` to `client` | |||||
1842 | c->setSessionActivityOverride(false); | ||||
1843 | } | ||||
1844 | } | ||||
1845 | m_sessionState = state; | ||||
1846 | emit sessionStateChanged(); | ||||
1847 | } | ||||
1848 | | ||||
1849 | SessionState Workspace::sessionState() const | ||||
1850 | { | ||||
1851 | return m_sessionState; | ||||
1852 | } | ||||
1853 | | ||||
1830 | } // namespace | 1854 | } // namespace |
Put whitespace between // and the text.