From f71e53fbe919125d40f9c5578ce14b75680f7037 Mon Sep 17 00:00:00 2001 From: rathnor Date: Mon, 28 Jul 2003 16:29:25 +0000 Subject: some more fixing of wm_protocols --- src/Screen.cc | 3 ++- src/WinClient.cc | 4 +++- src/Window.cc | 20 ++++++++++++++------ src/Window.hh | 3 ++- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 3838528..6242b4a 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.208 2003/07/28 15:06:33 rathnor Exp $ +// $Id: Screen.cc,v 1.209 2003/07/28 16:29:24 rathnor Exp $ #include "Screen.hh" @@ -1035,6 +1035,7 @@ void BScreen::updateNetizenConfigNotify(XEvent &e) { } FluxboxWindow *BScreen::createWindow(Window client) { + XSync(FbTk::App::instance()->display(), false); WinClient *winclient = new WinClient(client, *this); if (winclient->initial_state == WithdrawnState) { diff --git a/src/WinClient.cc b/src/WinClient.cc index 6fce6f5..3f817d8 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.21 2003/07/28 15:46:00 rathnor Exp $ +// $Id: WinClient.cc,v 1.22 2003/07/28 16:29:25 rathnor Exp $ #include "WinClient.hh" @@ -592,6 +592,8 @@ void WinClient::updateWMProtocols() { } XFree(proto); + if (m_win) + m_win->updateFunctions(); } else { cerr<<"Warning: Failed to read WM Protocols. "<isClosable(); - //!! // fetch client size and placement XWindowAttributes wattrib; @@ -1035,10 +1033,20 @@ void FluxboxWindow::getMWMHints() { functions.close = true; } } - - } +void FluxboxWindow::updateFunctions() { + if (!m_client) + return; + bool changed = false; + if (m_client->isClosable() != functions.close) { + functions.close = m_client->isClosable(); + changed = true; + } + + if (changed) + setupWindow(); +} void FluxboxWindow::getBlackboxHints() { const FluxboxWindow::BlackboxHints *hint = m_client->getBlackboxHint(); @@ -3461,7 +3469,7 @@ void FluxboxWindow::setupWindow() { newbutton->setOnClick(maximize_horiz_cmd, 3); newbutton->setOnClick(maximize_vert_cmd, 2); - } else if (isClosable() && (*dir)[i] == Fluxbox::CLOSE) { + } else if (m_client->isClosable() && (*dir)[i] == Fluxbox::CLOSE) { newbutton = new WinButton(*this, winbutton_theme, WinButton::CLOSE, frame.titlebar(), diff --git a/src/Window.hh b/src/Window.hh index 4bcef1f..135c172 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.89 2003/07/28 15:06:35 rathnor Exp $ +// $Id: Window.hh,v 1.90 2003/07/28 16:29:25 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH @@ -214,6 +214,7 @@ public: void setWorkspace(int n); void changeBlackboxHints(const BlackboxHints &bh); + void updateFunctions(); void restoreAttributes(); void showMenu(int mx, int my); // popup menu on last button press position -- cgit v0.11.2