diff options
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r-- | src/SystemTray.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index c1a4f53..728b6bb 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: SystemTray.cc,v 1.11 2004/06/20 10:29:51 rathnor Exp $ | 22 | // $Id: SystemTray.cc,v 1.12 2004/06/27 21:47:16 fluxgen Exp $ |
23 | 23 | ||
24 | #include "SystemTray.hh" | 24 | #include "SystemTray.hh" |
25 | 25 | ||
@@ -209,6 +209,10 @@ bool SystemTray::clientMessage(const XClientMessageEvent &event) { | |||
209 | 209 | ||
210 | int type = event.data.l[1]; | 210 | int type = event.data.l[1]; |
211 | if (type == SYSTEM_TRAY_REQUEST_DOCK) { | 211 | if (type == SYSTEM_TRAY_REQUEST_DOCK) { |
212 | #ifndef DEBUG | ||
213 | cerr<<"SystemTray::"<<__FUNCTION__<<": SYSTEM_TRAY_REQUEST_DOCK"<<endl; | ||
214 | cerr<<"window = event.data.l[2] = "<<event.data.l[2]<<endl; | ||
215 | #endif // DEBUG | ||
212 | addClient(event.data.l[2]); | 216 | addClient(event.data.l[2]); |
213 | } | 217 | } |
214 | /* | 218 | /* |
@@ -245,7 +249,7 @@ void SystemTray::addClient(Window win) { | |||
245 | return; | 249 | return; |
246 | 250 | ||
247 | #ifdef DEBUG | 251 | #ifdef DEBUG |
248 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<win<<dec<<endl; | 252 | cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<<hex<<win<<dec<<endl; |
249 | #endif // DEBUG | 253 | #endif // DEBUG |
250 | if (m_clients.empty()) | 254 | if (m_clients.empty()) |
251 | show(); | 255 | show(); |
@@ -258,6 +262,10 @@ void SystemTray::addClient(Window win) { | |||
258 | traywin->reparent(m_window, 0, 0); | 262 | traywin->reparent(m_window, 0, 0); |
259 | traywin->show(); | 263 | traywin->show(); |
260 | 264 | ||
265 | #ifdef DEBUG | ||
266 | cerr<<"number of clients = "<<m_clients.size()<<endl; | ||
267 | #endif // DEBUG | ||
268 | |||
261 | rearrangeClients(); | 269 | rearrangeClients(); |
262 | } | 270 | } |
263 | 271 | ||
@@ -295,14 +303,19 @@ void SystemTray::handleEvent(XEvent &event) { | |||
295 | } else if (event.type == ConfigureNotify) { | 303 | } else if (event.type == ConfigureNotify) { |
296 | // we got configurenotify from an client | 304 | // we got configurenotify from an client |
297 | // check and see if we need to update it's size | 305 | // check and see if we need to update it's size |
298 | // we don't let them be their size, we enforce ours (mwahaha) | 306 | // and we must reposition and resize them to fit |
307 | // our toolbar | ||
299 | ClientList::iterator it = findClient(event.xconfigure.window); | 308 | ClientList::iterator it = findClient(event.xconfigure.window); |
300 | if (it != m_clients.end()) { | 309 | if (it != m_clients.end()) { |
301 | if (static_cast<unsigned int>(event.xconfigure.width) != (*it)->width() || | 310 | if (static_cast<unsigned int>(event.xconfigure.width) != (*it)->width() || |
302 | static_cast<unsigned int>(event.xconfigure.height) != (*it)->height()) { | 311 | static_cast<unsigned int>(event.xconfigure.height) != (*it)->height()) { |
303 | (*it)->resize((*it)->width(), (*it)->height()); | 312 | // the position might differ so we update from our local |
313 | // copy of position | ||
314 | (*it)->moveResize((*it)->x(), (*it)->y(), | ||
315 | (*it)->width(), (*it)->height()); | ||
304 | } | 316 | } |
305 | } | 317 | } |
318 | |||
306 | } | 319 | } |
307 | } | 320 | } |
308 | 321 | ||
@@ -313,10 +326,6 @@ void SystemTray::rearrangeClients() { | |||
313 | int next_x = 0; | 326 | int next_x = 0; |
314 | for (; client_it != client_it_end; ++client_it, next_x += height()) { | 327 | for (; client_it != client_it_end; ++client_it, next_x += height()) { |
315 | (*client_it)->moveResize(next_x, 0, height(), height()); | 328 | (*client_it)->moveResize(next_x, 0, height(), height()); |
316 | |||
317 | #ifdef DEBUG | ||
318 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): "<<(*client_it)->width()<<", "<<(*client_it)->height()<<endl; | ||
319 | #endif // DEBUG | ||
320 | } | 329 | } |
321 | 330 | ||
322 | resize(next_x, height()); | 331 | resize(next_x, height()); |