From 7a53811fa7b42cf9751ace862dd712d29690da84 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 18 Jul 2011 12:20:53 +0200 Subject: Attach modifiedSig handlers to the session.screenX.defaultDeco resource --- src/Screen.hh | 2 +- src/Window.cc | 13 +++++++++++-- src/Window.hh | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Screen.hh b/src/Screen.hh index 1057229..2ff87db 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -108,7 +108,7 @@ public: bool getMaxDisableMove() const { return *resource.max_disable_move; } bool getMaxDisableResize() const { return *resource.max_disable_resize; } bool doShowWindowPos() const { return *resource.show_window_pos; } - const std::string &defaultDeco() const { return *resource.default_deco; } + FbTk::StringResource &defaultDecoResource() { return resource.default_deco; } const std::string windowMenuFilename() const; FbTk::ImageControl &imageControl() { return *m_image_control.get(); } // menus diff --git a/src/Window.cc b/src/Window.cc index 2ceb3d9..81d5059 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -423,13 +423,15 @@ void FluxboxWindow::init() { m_workspace_number = m_screen.currentWorkspaceID(); // set default decorations but don't apply them - setDecorationMask(WindowState::getDecoMaskFromString(screen().defaultDeco()), + setDecorationMask(WindowState::getDecoMaskFromString(*screen().defaultDecoResource()), false); functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true; updateMWMHintsFromClient(*m_client); + join(screen().defaultDecoResource().modifiedSig(), + FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::decorationsChanged)); autoRaiseDelayChanged(*fluxbox.getAutoRaiseDelayResource()); join(fluxbox.getAutoRaiseDelayResource().modifiedSig(), FbTk::MemFun(*this, @@ -1110,7 +1112,7 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) { } unsigned int mask = decorationMask(); - mask &= WindowState::getDecoMaskFromString(screen().defaultDeco()); + mask &= WindowState::getDecoMaskFromString(*screen().defaultDecoResource()); setDecorationMask(mask, false); // functions.tabable is ours, not special one @@ -2660,6 +2662,13 @@ void FluxboxWindow::themeReconfigured() { sendConfigureNotify(); } +void FluxboxWindow::decorationsChanged() { + setDecorationMask(WindowState::getDecoMaskFromString(*screen().defaultDecoResource()), + false); + updateMWMHintsFromClient(*m_client); + applyDecorations(); +} + void FluxboxWindow::workspaceAreaChanged(BScreen &screen) { frame().applyState(); } diff --git a/src/Window.hh b/src/Window.hh index bdcf4cd..4e4f681 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -477,6 +477,7 @@ private: void grabButtons(); void themeReconfigured(); + void decorationsChanged(); /** * Calculates insertition position in the list by -- cgit v0.11.2