fix winclient death signalling
This commit is contained in:
parent
e82122eb44
commit
16c567638c
9 changed files with 139 additions and 129 deletions
|
@ -1,5 +1,9 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 0.9.4:
|
||||
*03/07/05:
|
||||
* Fix winclient death signalling - fixes remember issues with applying
|
||||
attributes to wrong windows (Simon)
|
||||
Remember.hh/cc AtomHandler.hh fluxbox.cc ToolbarHandler.hh/cc Ewmh.hh Gnome.hh
|
||||
*03/07/04:
|
||||
* Add support in remember for grouping apps (Simon)
|
||||
Achieved by using [group], e.g.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: AtomHandler.hh,v 1.9 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: AtomHandler.hh,v 1.10 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#ifndef ATOMHANDLER_HH
|
||||
#define ATOMHANDLER_HH
|
||||
|
@ -43,7 +43,8 @@ public:
|
|||
virtual void updateCurrentWorkspace(BScreen &screen) = 0;
|
||||
virtual void updateWorkspaceCount(BScreen &screen) = 0;
|
||||
|
||||
virtual void updateWindowClose(FluxboxWindow &win) = 0;
|
||||
virtual void updateFrameClose(FluxboxWindow &win) = 0;
|
||||
virtual void updateClientClose(WinClient &winclient) = 0;
|
||||
virtual void updateWorkspace(FluxboxWindow &win) = 0;
|
||||
virtual void updateState(FluxboxWindow &win) = 0;
|
||||
virtual void updateHints(FluxboxWindow &win) = 0;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Ewmh.hh,v 1.8 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: Ewmh.hh,v 1.9 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#include "AtomHandler.hh"
|
||||
|
||||
|
@ -51,7 +51,8 @@ public:
|
|||
|
||||
bool propertyNotify(FluxboxWindow &win, Atom the_property);
|
||||
//ignore these ones
|
||||
void updateWindowClose(FluxboxWindow &win) {}
|
||||
void updateFrameClose(FluxboxWindow &win) {}
|
||||
void updateClientClose(WinClient &winclient) {}
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Gnome.hh,v 1.8 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: Gnome.hh,v 1.9 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#ifndef GNOME_HH
|
||||
#define GNOME_HH
|
||||
|
@ -81,7 +81,8 @@ public:
|
|||
bool checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, FluxboxWindow * const win);
|
||||
|
||||
// ignore these ones
|
||||
void updateWindowClose(FluxboxWindow &win) {}
|
||||
void updateFrameClose(FluxboxWindow &win) {}
|
||||
void updateClientClose(WinClient &winclient) {}
|
||||
bool propertyNotify(FluxboxWindow &win, Atom the_property) { return false; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Remember.cc,v 1.25 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: Remember.cc,v 1.26 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#include "Remember.hh"
|
||||
#include "ClientPattern.hh"
|
||||
|
@ -216,7 +216,8 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
|
|||
}
|
||||
|
||||
row++;
|
||||
if (line[0] != '#') { //the line is commented
|
||||
if (line[0] == '#')
|
||||
continue; //the line is commented
|
||||
int parse_pos = 0, err = 0;
|
||||
string str_key, str_label;
|
||||
err = FbTk::StringUtil::getStringBetween(str_key,
|
||||
|
@ -306,7 +307,6 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
|
@ -684,29 +684,10 @@ void Remember::setupClient(WinClient &winclient) {
|
|||
}
|
||||
}
|
||||
|
||||
void Remember::updateWindowClose(FluxboxWindow &win) {
|
||||
// This doesn't work at present since fluxbox.cc is missing the windowclose stuff.
|
||||
// I don't trust it (particularly winClient()) while this is the case
|
||||
|
||||
// scan all winclients and remove this fbw
|
||||
Patterns::iterator it = m_pats.begin();
|
||||
while (it != m_pats.end()) {
|
||||
if (&win == it->second->group)
|
||||
it->second->group = 0;
|
||||
++it;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
WinClient &winclient = win.winClient();
|
||||
void Remember::updateClientClose(WinClient &winclient) {
|
||||
Application *app = find(winclient);
|
||||
Clients::iterator wc_it = m_clients.find(&win.winClient());
|
||||
|
||||
if (wc_it != m_clients.end())
|
||||
m_clients.erase(wc_it);
|
||||
|
||||
if (!app || !(app->save_on_close_remember && app->save_on_close))
|
||||
return;
|
||||
if (app && (app->save_on_close_remember && app->save_on_close)) {
|
||||
|
||||
for (int attrib = 0; attrib <= REM_LASTATTRIB; attrib++) {
|
||||
if (isRemembered(winclient, (Attribute) attrib)) {
|
||||
|
@ -715,4 +696,23 @@ void Remember::updateWindowClose(FluxboxWindow &win) {
|
|||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
// we need to get rid of references to this client
|
||||
Clients::iterator wc_it = m_clients.find(&winclient);
|
||||
|
||||
if (wc_it != m_clients.end()) {
|
||||
m_clients.erase(wc_it);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Remember::updateFrameClose(FluxboxWindow &win) {
|
||||
// scan all applications and remove this fbw if it is a recorded group
|
||||
Patterns::iterator it = m_pats.begin();
|
||||
while (it != m_pats.end()) {
|
||||
if (&win == it->second->group)
|
||||
it->second->group = 0;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Remember.hh,v 1.9 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: Remember.hh,v 1.10 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
/* Based on the original "Remember patch" by Xavier Brouckaert */
|
||||
|
||||
|
@ -166,7 +166,8 @@ public:
|
|||
// Functions we actually use
|
||||
void setupFrame(FluxboxWindow &win);
|
||||
void setupClient(WinClient &winclient);
|
||||
void updateWindowClose(FluxboxWindow &win);
|
||||
void updateFrameClose(FluxboxWindow &win);
|
||||
void updateClientClose(WinClient &winclient);
|
||||
|
||||
// Functions we ignore (zero from AtomHandler)
|
||||
// Leaving here in case they might be useful later
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: ToolbarHandler.cc,v 1.20 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: ToolbarHandler.cc,v 1.21 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
/**
|
||||
* The ToolbarHandler class acts as a rough interface to the toolbar.
|
||||
|
@ -295,7 +295,7 @@ void ToolbarHandler::setupFrame(FluxboxWindow &win) {
|
|||
}
|
||||
}
|
||||
|
||||
void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
|
||||
void ToolbarHandler::updateFrameClose(FluxboxWindow &win) {
|
||||
if (&win.screen() != &m_screen)
|
||||
return;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: ToolbarHandler.hh,v 1.5 2003/07/04 01:03:40 rathnor Exp $
|
||||
// $Id: ToolbarHandler.hh,v 1.6 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#ifndef TOOLBARHANDLER_HH
|
||||
#define TOOLBARHANDLER_HH
|
||||
|
@ -61,7 +61,8 @@ public:
|
|||
void setupClient(WinClient &winclient) {}
|
||||
|
||||
void updateState(FluxboxWindow &win);
|
||||
void updateWindowClose(FluxboxWindow &win);
|
||||
void updateFrameClose(FluxboxWindow &win);
|
||||
void updateClientClose(WinClient &winclient) {}
|
||||
void updateWorkspace(FluxboxWindow &win);
|
||||
void updateCurrentWorkspace(BScreen &screen);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: fluxbox.cc,v 1.168 2003/07/04 01:03:41 rathnor Exp $
|
||||
// $Id: fluxbox.cc,v 1.169 2003/07/04 14:06:20 rathnor Exp $
|
||||
|
||||
#include "fluxbox.hh"
|
||||
|
||||
|
@ -1262,7 +1262,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
|||
} else if ((&(win.dieSig())) == changedsub) { // window death signal
|
||||
for (size_t i=0; i<m_atomhandler.size(); ++i) {
|
||||
if (m_atomhandler[i]->update())
|
||||
m_atomhandler[i]->updateWindowClose(win);
|
||||
m_atomhandler[i]->updateFrameClose(win);
|
||||
}
|
||||
// make sure each workspace get this
|
||||
BScreen &scr = win.screen();
|
||||
|
@ -1309,15 +1309,16 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
|||
WinClient::WinClientSubj *subj = dynamic_cast<WinClient::WinClientSubj *>(changedsub);
|
||||
WinClient &client = subj->winClient();
|
||||
|
||||
// TODO: don't assume it is diesig (need to fix as soon as another signal appears)
|
||||
for (size_t i=0; i<m_atomhandler.size(); ++i) {
|
||||
if (m_atomhandler[i]->update())
|
||||
m_atomhandler[i]->updateClientClose(client);
|
||||
}
|
||||
BScreen &screen = client.screen();
|
||||
screen.updateNetizenWindowDel(client.window());
|
||||
screen.removeClient(client);
|
||||
|
||||
removeWindowSearch(client.window());
|
||||
//!! TODO
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__FUNCTION__<<") TODO: signal stuff for client death!!"<<endl;
|
||||
#endif // DEBUG
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue