From 74fab5c8c5b326332da446135220fbd02c6a6938 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 8 Jun 2007 19:29:53 +0000 Subject: don't tab transient windows from apps file, and change their layers along with main window --- ChangeLog | 4 ++++ src/Remember.cc | 6 ++++-- src/WinClient.cc | 17 ++++++----------- src/Window.cc | 42 ++++++++++++++++++++++++++++++++---------- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index f08d9f8..36be402 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ (Format: Year/Month/Day) Changes for 1.1: +*07/06/08: + * Fix transient windows getting tabbed from apps file and not changing layers + when main window is in a lowered tab (Mark) + WinClient.cc Window.cc Remember.cc *07/06/04: * Fix submenu placement with xinerama after moving the menu between heads, bug #1479517 (Mark) diff --git a/src/Remember.cc b/src/Remember.cc index 6f86ade..1ee60d7 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -1132,8 +1132,10 @@ void Remember::setupFrame(FluxboxWindow &win) { void Remember::setupClient(WinClient &winclient) { - if (winclient.screen().isRestart()) - return; // don't mess up windows on restart + // leave windows alone on restart + // don't apply settings to transient windows + if (winclient.screen().isRestart() || winclient.transientFor()) + return; Application *app = find(winclient); if (app == 0) diff --git a/src/WinClient.cc b/src/WinClient.cc index da4810d..ab9d967 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -104,6 +104,11 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): // clear transient waiting list for this window s_transient_wait.erase(win); } + + // also check if this window is a transient + // this needs to be done before creating an fbwindow, so this doesn't get + // tabbed using the apps file + updateTransientInfo(); } WinClient::~WinClient() { @@ -263,13 +268,6 @@ void WinClient::updateWMClassHint() { } void WinClient::updateTransientInfo() { -#ifdef DEBUG - cerr<<__FUNCTION__<<": fbwindow() = "<transientList().remove(this); @@ -293,7 +291,7 @@ void WinClient::updateTransientInfo() { return; } - if (win != None && fbwindow()->screen().rootWindow() == win) { + if (win != None && screen().rootWindow() == win) { // transient for root window... = transient for group // I don't think we are group-aware yet return; @@ -334,9 +332,6 @@ void WinClient::updateTransientInfo() { // we need to add ourself to the right client in // the transientFor() window so we search client transient_for->transientList().push_back(this); - - if (transientFor()->fbwindow() && transientFor()->fbwindow()->isStuck()) - fbwindow()->stick(); } } diff --git a/src/Window.cc b/src/Window.cc index b50ee38..44fd4c9 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -432,8 +432,9 @@ void FluxboxWindow::init() { /* Read state above here, apply state below here. */ /**************************************************/ - // update transient infomation - m_client->updateTransientInfo(); + if (m_client->transientFor() && m_client->transientFor()->fbwindow() && + m_client->transientFor()->fbwindow()->isStuck()) + stick(); // adjust the window decorations based on transience and window sizes if (m_client->isTransient() && !screen().decorateTransient()) { @@ -1855,6 +1856,19 @@ void FluxboxWindow::stick() { m_workspacesig.notify(); } + ClientList::iterator client_it = clientList().begin(); + ClientList::iterator client_it_end = clientList().end(); + for (; client_it != client_it_end; ++client_it) { + + WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); + WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); + for (; it != it_end; ++it) { + if ((*it)->fbwindow() && (*it)->fbwindow()->isStuck() != stuck) + (*it)->fbwindow()->stick(); + } + + } + } @@ -1955,16 +1969,24 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { layernum = win->layerItem().getLayerNum(); win->setLayerNum(layernum); - WinClient::TransientList::const_iterator it = client->transientList().begin(); - WinClient::TransientList::const_iterator it_end = client->transientList().end(); - for (; it != it_end; ++it) { - win = (*it)->fbwindow(); - if (win && !win->isIconic()) { - screen().updateNetizenWindowRaise((*it)->window()); - win->layerItem().moveToLayer(layernum); - win->setLayerNum(layernum); + // move all the transients, too + ClientList::iterator client_it = win->clientList().begin(); + ClientList::iterator client_it_end = win->clientList().end(); + for (; client_it != client_it_end; ++client_it) { + + WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); + WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); + for (; it != it_end; ++it) { + FluxboxWindow *fbwin = (*it)->fbwindow(); + if (fbwin && !fbwin->isIconic()) { + screen().updateNetizenWindowRaise((*it)->window()); + fbwin->layerItem().moveToLayer(layernum); + fbwin->setLayerNum(layernum); + } } + } + } void FluxboxWindow::setFocusHidden(bool value) { -- cgit v0.11.2