diff options
author | rathnor <rathnor> | 2003-09-21 12:49:48 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-09-21 12:49:48 (GMT) |
commit | 4d83785792954c42f080ce8e975a404a38bf1c66 (patch) | |
tree | f9c78178ccd41b7ae362998b8996992cb1ff7768 /src | |
parent | 39e9e25d5b0df95ddb72f79d95743cc619f12cf8 (diff) | |
download | fluxbox_lack-4d83785792954c42f080ce8e975a404a38bf1c66.zip fluxbox_lack-4d83785792954c42f080ce8e975a404a38bf1c66.tar.bz2 |
fix disappearing close button
Diffstat (limited to 'src')
-rw-r--r-- | src/WinClient.cc | 13 | ||||
-rw-r--r-- | src/WinClient.hh | 7 |
2 files changed, 13 insertions, 7 deletions
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 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinClient.cc,v 1.24 2003/09/11 19:55:27 rathnor Exp $ | 22 | // $Id: WinClient.cc,v 1.25 2003/09/21 12:49:47 rathnor Exp $ |
23 | 23 | ||
24 | #include "WinClient.hh" | 24 | #include "WinClient.hh" |
25 | 25 | ||
@@ -54,7 +54,8 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb | |||
54 | m_win(fbwin), | 54 | m_win(fbwin), |
55 | m_modal(0), | 55 | m_modal(0), |
56 | send_focus_message(false), | 56 | send_focus_message(false), |
57 | closable(false), | 57 | send_close_message(false), |
58 | closable(true), | ||
58 | m_win_gravity(0), | 59 | m_win_gravity(0), |
59 | m_title(""), m_icon_title(""), | 60 | m_title(""), m_icon_title(""), |
60 | m_class_name(""), m_instance_name(""), | 61 | m_class_name(""), m_instance_name(""), |
@@ -169,7 +170,7 @@ bool WinClient::sendFocus() { | |||
169 | } | 170 | } |
170 | 171 | ||
171 | void WinClient::sendClose(bool forceful) { | 172 | void WinClient::sendClose(bool forceful) { |
172 | if (forceful || !isClosable()) | 173 | if (forceful || !send_close_message) |
173 | XKillClient(FbTk::App::instance()->display(), window()); | 174 | XKillClient(FbTk::App::instance()->display(), window()); |
174 | else { | 175 | else { |
175 | // send WM_DELETE message | 176 | // send WM_DELETE message |
@@ -584,9 +585,13 @@ void WinClient::updateWMProtocols() { | |||
584 | 585 | ||
585 | if (XGetWMProtocols(FbTk::App::instance()->display(), window(), &proto, &num_return)) { | 586 | if (XGetWMProtocols(FbTk::App::instance()->display(), window(), &proto, &num_return)) { |
586 | 587 | ||
588 | // defaults | ||
589 | send_focus_message = false; | ||
590 | send_close_message = false; | ||
591 | // could be added to netizens twice... | ||
587 | for (int i = 0; i < num_return; ++i) { | 592 | for (int i = 0; i < num_return; ++i) { |
588 | if (proto[i] == fbatoms->getWMDeleteAtom()) | 593 | if (proto[i] == fbatoms->getWMDeleteAtom()) |
589 | closable = true; | 594 | send_close_message = true; |
590 | else if (proto[i] == fbatoms->getWMTakeFocusAtom()) | 595 | else if (proto[i] == fbatoms->getWMTakeFocusAtom()) |
591 | send_focus_message = true; | 596 | send_focus_message = true; |
592 | else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom()) | 597 | 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 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinClient.hh,v 1.13 2003/09/11 19:55:27 rathnor Exp $ | 22 | // $Id: WinClient.hh,v 1.14 2003/09/21 12:49:48 rathnor Exp $ |
23 | 23 | ||
24 | #ifndef WINCLIENT_HH | 24 | #ifndef WINCLIENT_HH |
25 | #define WINCLIENT_HH | 25 | #define WINCLIENT_HH |
@@ -46,7 +46,8 @@ public: | |||
46 | bool sendFocus(); // returns whether we sent a message or not | 46 | bool sendFocus(); // returns whether we sent a message or not |
47 | // i.e. whether we assume the focus will get taken | 47 | // i.e. whether we assume the focus will get taken |
48 | void sendClose(bool forceful = false); | 48 | void sendClose(bool forceful = false); |
49 | inline bool isClosable() const { return closable; } | 49 | // not aware of anything that makes this false at present |
50 | inline bool isClosable() const { return true; } | ||
50 | void reparent(Window win, int x, int y); | 51 | void reparent(Window win, int x, int y); |
51 | bool getAttrib(XWindowAttributes &attr) const; | 52 | bool getAttrib(XWindowAttributes &attr) const; |
52 | bool getWMName(XTextProperty &textprop) const; | 53 | bool getWMName(XTextProperty &textprop) const; |
@@ -157,7 +158,7 @@ private: | |||
157 | // number of transients which we are modal for | 158 | // number of transients which we are modal for |
158 | // or indicates that we are modal if don't have any transients | 159 | // or indicates that we are modal if don't have any transients |
159 | int m_modal; | 160 | int m_modal; |
160 | bool send_focus_message, closable; | 161 | bool send_focus_message, send_close_message; |
161 | 162 | ||
162 | int m_win_gravity; | 163 | int m_win_gravity; |
163 | 164 | ||