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