added screen accessor and removed client from window before we send signal

This commit is contained in:
fluxgen 2003-05-14 12:07:06 +00:00
parent 860b70e5b6
commit 9d5eb092fa
2 changed files with 13 additions and 8 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: WinClient.cc,v 1.8 2003/05/10 22:59:32 fluxgen Exp $ // $Id: WinClient.cc,v 1.9 2003/05/14 12:07:06 fluxgen Exp $
#include "WinClient.hh" #include "WinClient.hh"
@ -56,13 +56,18 @@ WinClient::WinClient(Window win, FluxboxWindow &fbwin):FbTk::FbWindow(win),
m_win(&fbwin), m_win(&fbwin),
modal(false), modal(false),
m_title(""), m_icon_title(""), m_title(""), m_icon_title(""),
m_diesig(*this) { } m_diesig(*this), m_screen(fbwin.screen()) { }
WinClient::~WinClient() { WinClient::~WinClient() {
#ifdef DEBUG #ifdef DEBUG
cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl; cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl;
#endif // DEBUG #endif // DEBUG
FbTk::EventManager::instance()->remove(window());
if (m_win != 0)
m_win->removeClient(*this);
// this takes care of any focus issues // this takes care of any focus issues
m_diesig.notify(); m_diesig.notify();
@ -93,11 +98,7 @@ WinClient::~WinClient() {
if (window()) if (window())
fluxbox->removeWindowSearch(window()); fluxbox->removeWindowSearch(window());
if (m_win != 0)
m_win->removeClient(*this);
FbTk::EventManager::instance()->remove(window());
m_win = 0; m_win = 0;
} }
void WinClient::updateRect(int x, int y, void WinClient::updateRect(int x, int y,

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: WinClient.hh,v 1.4 2003/05/10 14:16:38 fluxgen Exp $ // $Id: WinClient.hh,v 1.5 2003/05/14 12:07:05 fluxgen Exp $
#ifndef WINCLIENT_HH #ifndef WINCLIENT_HH
#define WINCLIENT_HH #define WINCLIENT_HH
@ -31,6 +31,8 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <string> #include <string>
class BScreen;
/// Holds client window info /// Holds client window info
class WinClient:public FbTk::FbWindow { class WinClient:public FbTk::FbWindow {
public: public:
@ -48,7 +50,8 @@ public:
bool getWMIconName(XTextProperty &textprop) const; bool getWMIconName(XTextProperty &textprop) const;
void updateTitle(); void updateTitle();
void updateIconTitle(); void updateIconTitle();
BScreen &screen() { return m_screen; }
const BScreen &screen() const { return m_screen; }
/// notifies when this client dies /// notifies when this client dies
FbTk::Subject &dieSig() { return m_diesig; } FbTk::Subject &dieSig() { return m_diesig; }
@ -109,6 +112,7 @@ private:
bool modal; bool modal;
std::string m_title, m_icon_title; std::string m_title, m_icon_title;
WinClientSubj m_diesig; WinClientSubj m_diesig;
BScreen &m_screen;
}; };
#endif // WINCLIENT_HH #endif // WINCLIENT_HH