From 9d5e2f143ba2dc33c5f79a1a18646512b04c942d Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 4 Jan 2007 19:13:55 +0000 Subject: add session.screenN.defaultDeco: to the apps file --- ChangeLog | 4 ++++ doc/asciidoc/fluxbox.txt | 5 +++++ src/Screen.cc | 1 + src/Screen.hh | 4 +++- src/Window.cc | 20 ++++++-------------- src/Window.hh | 2 +- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae88888..d7ab7f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ (Format: Year/Month/Day) Changes for 1.0rc3: *07/01/04: + * Added new resource for init file to control default window decorations: + session.screenN.defaultDeco: , where the bitmask corresponds + to the one used for [Deco] in the apps file (Mark) + Screen.cc/hh Window.cc/hh doc/asciidoc/fluxbox.txt * Move minimized windows to the back of the focused list (Mark) Window.cc FocusControl.cc/hh *07/01/03: diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt index 6533e07..f5e2519 100644 --- a/doc/asciidoc/fluxbox.txt +++ b/doc/asciidoc/fluxbox.txt @@ -946,6 +946,11 @@ session.screen0.decorateTransient: This controls whether or not transient windows get window decorations, such as a titlebar. Default: False +session.screen0.defaultDeco: + This specifies the default window decorations, according to the same + bitmask as used by the `[Deco]' option in the `apps' file, described later + in this document. Default: all bits set. + session.screen0.menuMode: Delay|Click This setting controls the circumstances under which submenus open. With `Click', the user must click on the menu item in order for the submenu to diff --git a/src/Screen.cc b/src/Screen.cc index 804321f..2e4a6dd 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -270,6 +270,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, auto_raise(rm, false, scrname+".autoRaise", altscrname+".AutoRaise"), click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"), decorate_transient(rm, false, scrname+".decorateTransient", altscrname+".DecorateTransient"), + default_deco(rm, FluxboxWindow::DECORM_LAST-1, scrname+".defaultDeco", altscrname+".DefaultDeco"), rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"), tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), diff --git a/src/Screen.hh b/src/Screen.hh index 1778308..739c458 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -120,6 +120,7 @@ public: bool doFullMax() const { return *resource.full_max; } bool doShowWindowPos() const { return *resource.show_window_pos; } bool decorateTransient() const { return *resource.decorate_transient; } + unsigned int defaultDeco() const { return *resource.default_deco; } const std::string &windowMenuFilename() const { return *resource.windowmenufile; } FbTk::ImageControl &imageControl() { return *m_image_control.get(); } // menus @@ -440,7 +441,8 @@ private: workspace_warping, desktop_wheeling, reverse_wheeling, show_window_pos, auto_raise, click_raises, decorate_transient; - FbTk::Resource rootcommand; + FbTk::Resource default_deco; + FbTk::Resource rootcommand; FbTk::Resource resize_model; FbTk::Resource tab_placement; FbTk::Resource windowmenufile; diff --git a/src/Window.cc b/src/Window.cc index f8b4457..523fd66 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -447,18 +447,8 @@ void FluxboxWindow::init() { m_blackbox_attrib.premax_x = m_blackbox_attrib.premax_y = 0; m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; - //use tab as default - decorations.tab = true; - // enable decorations - decorations.enabled = true; - - // set default values for decoration - decorations.menu = true; //override menu option - // all decorations on by default - decorations.titlebar = decorations.border = decorations.handle = true; - decorations.maximize = decorations.close = - decorations.sticky = decorations.shade = decorations.tab = true; - + // set default decorations but don't apply them + setDecorationMask(screen().defaultDeco(), false); functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true; decorations.close = false; @@ -3298,7 +3288,7 @@ unsigned int FluxboxWindow::decorationMask() const { return ret; } -void FluxboxWindow::setDecorationMask(unsigned int mask) { +void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) { decorations.titlebar = mask & DECORM_TITLEBAR; decorations.handle = mask & DECORM_HANDLE; decorations.border = mask & DECORM_BORDER; @@ -3310,7 +3300,9 @@ void FluxboxWindow::setDecorationMask(unsigned int mask) { decorations.shade = mask & DECORM_SHADE; decorations.tab = mask & DECORM_TAB; decorations.enabled = mask & DECORM_ENABLED; - applyDecorations(); + // we don't want to do this during initialization + if (apply) + applyDecorations(); } void FluxboxWindow::startMoving(int x, int y) { diff --git a/src/Window.hh b/src/Window.hh index b58a87a..142b451 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -281,7 +281,7 @@ public: void toggleDecoration(); unsigned int decorationMask() const; - void setDecorationMask(unsigned int mask); + void setDecorationMask(unsigned int mask, bool apply = true); /** * Start moving process, grabs the pointer and draws move rectangle * @param x position of pointer -- cgit v0.11.2