From 4d83785792954c42f080ce8e975a404a38bf1c66 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 21 Sep 2003 12:49:48 +0000 Subject: fix disappearing close button --- ChangeLog | 3 +++ src/WinClient.cc | 13 +++++++++---- src/WinClient.hh | 7 ++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41f8051..fcc5d7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.6: +*03/09/21: + * Fix disappearing close button (Simon) + WinClient.hh/cc *03/09/19: * fbsetbg update (Thanks Han) - fixes fbsetbg -l after a changing the wallpapersetter. diff --git a/src/WinClient.cc b/src/WinClient.cc index d6cd585..cb75166 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.cc,v 1.24 2003/09/11 19:55:27 rathnor Exp $ +// $Id: WinClient.cc,v 1.25 2003/09/21 12:49:47 rathnor Exp $ #include "WinClient.hh" @@ -54,7 +54,8 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb m_win(fbwin), m_modal(0), send_focus_message(false), - closable(false), + send_close_message(false), + closable(true), m_win_gravity(0), m_title(""), m_icon_title(""), m_class_name(""), m_instance_name(""), @@ -169,7 +170,7 @@ bool WinClient::sendFocus() { } void WinClient::sendClose(bool forceful) { - if (forceful || !isClosable()) + if (forceful || !send_close_message) XKillClient(FbTk::App::instance()->display(), window()); else { // send WM_DELETE message @@ -584,9 +585,13 @@ void WinClient::updateWMProtocols() { if (XGetWMProtocols(FbTk::App::instance()->display(), window(), &proto, &num_return)) { + // defaults + send_focus_message = false; + send_close_message = false; + // could be added to netizens twice... for (int i = 0; i < num_return; ++i) { if (proto[i] == fbatoms->getWMDeleteAtom()) - closable = true; + send_close_message = true; else if (proto[i] == fbatoms->getWMTakeFocusAtom()) send_focus_message = true; else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom()) diff --git a/src/WinClient.hh b/src/WinClient.hh index bb89c99..6bdfe3f 100644 --- a/src/WinClient.hh +++ b/src/WinClient.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.hh,v 1.13 2003/09/11 19:55:27 rathnor Exp $ +// $Id: WinClient.hh,v 1.14 2003/09/21 12:49:48 rathnor Exp $ #ifndef WINCLIENT_HH #define WINCLIENT_HH @@ -46,7 +46,8 @@ public: bool sendFocus(); // returns whether we sent a message or not // i.e. whether we assume the focus will get taken void sendClose(bool forceful = false); - inline bool isClosable() const { return closable; } + // not aware of anything that makes this false at present + inline bool isClosable() const { return true; } void reparent(Window win, int x, int y); bool getAttrib(XWindowAttributes &attr) const; bool getWMName(XTextProperty &textprop) const; @@ -157,7 +158,7 @@ private: // number of transients which we are modal for // or indicates that we are modal if don't have any transients int m_modal; - bool send_focus_message, closable; + bool send_focus_message, send_close_message; int m_win_gravity; -- cgit v0.11.2