diff options
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r-- | src/SystemTray.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index c296efb..1aced06 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc | |||
@@ -326,7 +326,6 @@ void SystemTray::removeClient(Window win) { | |||
326 | 326 | ||
327 | void SystemTray::exposeEvent(XExposeEvent &event) { | 327 | void SystemTray::exposeEvent(XExposeEvent &event) { |
328 | m_window.clear(); | 328 | m_window.clear(); |
329 | update(0); | ||
330 | } | 329 | } |
331 | 330 | ||
332 | void SystemTray::handleEvent(XEvent &event) { | 331 | void SystemTray::handleEvent(XEvent &event) { |
@@ -350,6 +349,8 @@ void SystemTray::handleEvent(XEvent &event) { | |||
350 | // copy of position | 349 | // copy of position |
351 | (*it)->moveResize((*it)->x(), (*it)->y(), | 350 | (*it)->moveResize((*it)->x(), (*it)->y(), |
352 | (*it)->width(), (*it)->height()); | 351 | (*it)->width(), (*it)->height()); |
352 | // this was why gaim wasn't centring the icon | ||
353 | (*it)->sendConfigureNotify(0, 0, (*it)->width(), (*it)->height()); | ||
353 | } | 354 | } |
354 | // so toolbar know that we changed size | 355 | // so toolbar know that we changed size |
355 | resizeSig().notify(); | 356 | resizeSig().notify(); |
@@ -359,19 +360,23 @@ void SystemTray::handleEvent(XEvent &event) { | |||
359 | } | 360 | } |
360 | 361 | ||
361 | void SystemTray::rearrangeClients() { | 362 | void SystemTray::rearrangeClients() { |
363 | const unsigned int h = height(); | ||
364 | const unsigned int bw = m_theme.border().width(); | ||
365 | int final_size = m_clients.size()*h + bw; | ||
366 | resize(final_size, h); | ||
367 | update(0); | ||
368 | |||
362 | // move and resize clients | 369 | // move and resize clients |
363 | ClientList::iterator client_it = m_clients.begin(); | 370 | ClientList::iterator client_it = m_clients.begin(); |
364 | ClientList::iterator client_it_end = m_clients.end(); | 371 | ClientList::iterator client_it_end = m_clients.end(); |
365 | int next_x = 0; | 372 | int next_x = bw; |
366 | const unsigned int h = height(); | ||
367 | const unsigned int b = m_theme.border().width(); | ||
368 | for (; client_it != client_it_end; | 373 | for (; client_it != client_it_end; |
369 | ++client_it, next_x += h - 2 * b) { | 374 | ++client_it, next_x += h+bw) { |
370 | (*client_it)->moveResize(next_x, b, h - b, h - b); | 375 | (*client_it)->moveResize(next_x, bw, h, h); |
376 | (*client_it)->sendConfigureNotify(next_x, bw, h, h); | ||
371 | } | 377 | } |
372 | 378 | ||
373 | resize(next_x, height()); | 379 | client_it = m_clients.begin(); |
374 | update(0); | ||
375 | } | 380 | } |
376 | 381 | ||
377 | void SystemTray::removeAllClients() { | 382 | void SystemTray::removeAllClients() { |