fix disappearing close button
This commit is contained in:
parent
39e9e25d5b
commit
4d83785792
3 changed files with 16 additions and 7 deletions
|
@ -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.
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue