Changeset View
Changeset View
Standalone View
Standalone View
toplevel.cpp
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
160 | } | 160 | } | ||
161 | 161 | | |||
162 | void Toplevel::getWmClientLeader() | 162 | void Toplevel::getWmClientLeader() | ||
163 | { | 163 | { | ||
164 | auto prop = fetchWmClientLeader(); | 164 | auto prop = fetchWmClientLeader(); | ||
165 | readWmClientLeader(prop); | 165 | readWmClientLeader(prop); | ||
166 | } | 166 | } | ||
167 | 167 | | |||
168 | /*! | 168 | /** | ||
169 | Returns sessionId for this client, | 169 | * Returns sessionId for this client, | ||
170 | taken either from its window or from the leader window. | 170 | * taken either from its window or from the leader window. | ||
171 | */ | 171 | **/ | ||
172 | QByteArray Toplevel::sessionId() const | 172 | QByteArray Toplevel::sessionId() const | ||
173 | { | 173 | { | ||
174 | QByteArray result = Xcb::StringProperty(window(), atoms->sm_client_id); | 174 | QByteArray result = Xcb::StringProperty(window(), atoms->sm_client_id); | ||
175 | if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window()) | 175 | if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window()) | ||
176 | result = Xcb::StringProperty(wmClientLeaderWin, atoms->sm_client_id); | 176 | result = Xcb::StringProperty(wmClientLeaderWin, atoms->sm_client_id); | ||
177 | return result; | 177 | return result; | ||
178 | } | 178 | } | ||
179 | 179 | | |||
180 | /*! | 180 | /** | ||
181 | Returns command property for this client, | 181 | * Returns command property for this client, | ||
182 | taken either from its window or from the leader window. | 182 | * taken either from its window or from the leader window. | ||
183 | */ | 183 | **/ | ||
184 | QByteArray Toplevel::wmCommand() | 184 | QByteArray Toplevel::wmCommand() | ||
185 | { | 185 | { | ||
186 | QByteArray result = Xcb::StringProperty(window(), XCB_ATOM_WM_COMMAND); | 186 | QByteArray result = Xcb::StringProperty(window(), XCB_ATOM_WM_COMMAND); | ||
187 | if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window()) | 187 | if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window()) | ||
188 | result = Xcb::StringProperty(wmClientLeaderWin, XCB_ATOM_WM_COMMAND); | 188 | result = Xcb::StringProperty(wmClientLeaderWin, XCB_ATOM_WM_COMMAND); | ||
189 | result.replace(0, ' '); | 189 | result.replace(0, ' '); | ||
190 | return result; | 190 | return result; | ||
191 | } | 191 | } | ||
192 | 192 | | |||
193 | void Toplevel::getWmClientMachine() | 193 | void Toplevel::getWmClientMachine() | ||
194 | { | 194 | { | ||
195 | m_clientMachine->resolve(window(), wmClientLeader()); | 195 | m_clientMachine->resolve(window(), wmClientLeader()); | ||
196 | } | 196 | } | ||
197 | 197 | | |||
198 | /*! | 198 | /** | ||
199 | Returns client machine for this client, | 199 | * Returns client machine for this client, | ||
200 | taken either from its window or from the leader window. | 200 | * taken either from its window or from the leader window. | ||
201 | */ | 201 | **/ | ||
202 | QByteArray Toplevel::wmClientMachine(bool use_localhost) const | 202 | QByteArray Toplevel::wmClientMachine(bool use_localhost) const | ||
203 | { | 203 | { | ||
204 | if (!m_clientMachine) { | 204 | if (!m_clientMachine) { | ||
205 | // this should never happen | 205 | // this should never happen | ||
206 | return QByteArray(); | 206 | return QByteArray(); | ||
207 | } | 207 | } | ||
208 | if (use_localhost && m_clientMachine->isLocal()) { | 208 | if (use_localhost && m_clientMachine->isLocal()) { | ||
209 | // special name for the local machine (localhost) | 209 | // special name for the local machine (localhost) | ||
210 | return ClientMachine::localhost(); | 210 | return ClientMachine::localhost(); | ||
211 | } | 211 | } | ||
212 | return m_clientMachine->hostName(); | 212 | return m_clientMachine->hostName(); | ||
213 | } | 213 | } | ||
214 | 214 | | |||
215 | /*! | 215 | /** | ||
216 | Returns client leader window for this client. | 216 | * Returns client leader window for this client. | ||
217 | Returns the client window itself if no leader window is defined. | 217 | * Returns the client window itself if no leader window is defined. | ||
218 | */ | 218 | **/ | ||
219 | Window Toplevel::wmClientLeader() const | 219 | Window Toplevel::wmClientLeader() const | ||
220 | { | 220 | { | ||
221 | if (wmClientLeaderWin) | 221 | if (wmClientLeaderWin) | ||
222 | return wmClientLeaderWin; | 222 | return wmClientLeaderWin; | ||
223 | return window(); | 223 | return window(); | ||
224 | } | 224 | } | ||
225 | 225 | | |||
226 | void Toplevel::getResourceClass() | 226 | void Toplevel::getResourceClass() | ||
▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines |