all repos — fluxbox @ f1e492da01498d6c0d84e81b166f1c3b86b142e7

custom fork of the fluxbox windowmanager

fixed resize after client death
fluxgen fluxgen
commit

f1e492da01498d6c0d84e81b166f1c3b86b142e7

parent

118d9ad1589fecd41b373e651c4150bac2054038

1 files changed, 13 insertions(+), 7 deletions(-)

jump to
M src/SystemTray.ccsrc/SystemTray.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: SystemTray.cc,v 1.3 2003/08/27 00:11:24 fluxgen Exp $ +// $Id: SystemTray.cc,v 1.4 2003/08/28 13:44:58 fluxgen Exp $ #include "SystemTray.hh"

@@ -30,7 +30,6 @@ #include "fluxbox.hh"

#include <X11/Xutil.h> -#include <iostream> #include <string> using namespace std;

@@ -155,7 +154,7 @@ m_window.show();

} unsigned int SystemTray::width() const { - return m_clients.size()*height(); //*m_tray_width; + return m_clients.size()*height(); } unsigned int SystemTray::height() const {

@@ -214,16 +213,19 @@

#ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<win<<dec<<endl; #endif // DEBUG + if (m_clients.size() == 0) + show(); FbTk::FbWindow *traywin = new TrayWindow(win); m_clients.push_back(traywin); FbTk::EventManager::instance()->add(*this, win); + FbTk::EventManager::instance()->addParent(*this, window()); XChangeSaveSet(FbTk::App::instance()->display(), win, SetModeInsert); traywin->reparent(m_window, 0, 0); traywin->show(); resize(width(), m_clients.size()*height()); - + rearrangeClients(); }

@@ -235,12 +237,16 @@

#ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<win<<dec<<endl; #endif // DEBUG - FbTk::FbWindow *traywin = *tray_it; m_clients.erase(tray_it); delete traywin; resize(width(), height()); rearrangeClients(); + if (m_clients.size() == 0) { + // so we send configurenotify signal to parent + m_window.resize(1, 1); + hide(); + } } void SystemTray::exposeEvent(XExposeEvent &event) {

@@ -248,9 +254,9 @@ m_window.clear();

} void SystemTray::handleEvent(XEvent &event) { - if (event.type == DestroyNotify) + if (event.type == DestroyNotify) { removeClient(event.xdestroywindow.window); - else if (event.type == ConfigureNotify) { + } else if (event.type == ConfigureNotify) { // we got configurenotify from an client // check and see if we need to update it's size ClientList::iterator it = findClient(event.xconfigure.window);