From 84a118a9c9b3094cf0cd05f6d748bc49646e83f7 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 b8d589b..ba2d6ea 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -107,7 +107,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 9974bc5..e55414c 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -411,13 +411,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)); m_timer.setTimeout(*fluxbox.getAutoRaiseDelayResource()); join(fluxbox.getAutoRaiseDelayResource().modifiedSig(), FbTk::MemFun(m_timer, @@ -1100,7 +1102,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 @@ -2693,6 +2695,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 a5bcb66..5c2e595 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -475,6 +475,7 @@ private: void grabButtons(); void themeReconfigured(); + void decorationsChanged(); /** * Calculates insertition position in the list by -- cgit v0.11.2