From 610a15ac47371c5cbd4c2dcf6eec696aec5bb4fa Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sun, 1 Jul 2012 21:22:01 -0700 Subject: add fullscreen, maximizedhorizontal, and maximizedvertical tests to ClientPattern --- doc/asciidoc/client-patterns.txt | 9 +++++++++ src/ClientPattern.cc | 18 +++++++++++++++++- src/ClientPattern.hh | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/asciidoc/client-patterns.txt b/doc/asciidoc/client-patterns.txt index 5bb50a0..ed1229d 100644 --- a/doc/asciidoc/client-patterns.txt +++ b/doc/asciidoc/client-patterns.txt @@ -32,9 +32,18 @@ The following values are accepted for 'propertyname'::: *Maximized*;; Either *yes* or *no*, depending on whether the window is maximized or not. +*MaximizedHorizontal*;; + Either *yes* or *no*, depending on whether the window is maximized + horizontally or not. +*MaximizedVertical*;; + Either *yes* or *no*, depending on whether the window is maximized + vertically or not. *Minimized*;; Either *yes* or *no*, depending on whether the window is minimized (iconified) or not. +*Fullscreen*;; + Either *yes* or *no*, depending on whether the window is fullscreen or + not. *Shaded*;; Either *yes* or *no*, depending on whether the window is shaded or not. diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index f49f7fd..f57513d 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -67,13 +67,17 @@ struct Name2WinProperty { ClientPattern::WinProperty prop; }; -const Name2WinProperty name_2_winproperties[] = { // sorted for 'bsearch' +// sorted alphabetically for 'bsearch' +const Name2WinProperty name_2_winproperties[] = { { "class", ClientPattern::CLASS }, { "focushidden", ClientPattern::FOCUSHIDDEN }, + { "fullscreen", ClientPattern::FULLSCREEN }, { "head", ClientPattern::HEAD }, { "iconhidden", ClientPattern::ICONHIDDEN }, { "layer", ClientPattern::LAYER }, { "maximized", ClientPattern::MAXIMIZED }, + { "maximizedhorizontal", ClientPattern::HORZMAX }, + { "maximizedvertical", ClientPattern::VERTMAX }, { "minimized", ClientPattern::MINIMIZED }, { "name", ClientPattern::NAME }, { "role", ClientPattern::ROLE }, @@ -132,6 +136,9 @@ Prop2String property_2_strings[] = { // sorted by 'prop' { ClientPattern::URGENT, "urgent" }, { ClientPattern::SCREEN, "screen" }, { ClientPattern::XPROP, "@" }, + { ClientPattern::FULLSCREEN, "fullscreen" }, + { ClientPattern::VERTMAX, "maximizedvertical" }, + { ClientPattern::HORZMAX, "maximizedhorizontal" }, }; @@ -411,6 +418,15 @@ FbTk::FbString ClientPattern::getProperty(WinProperty prop, const Focusable &cli case MINIMIZED: result = (fbwin && fbwin->isIconic()) ? "yes" : "no"; break; + case FULLSCREEN: + result = (fbwin && fbwin->isFullscreen()) ? "yes" : "no"; + break; + case VERTMAX: + result = (fbwin && fbwin->isMaximizedVert()) ? "yes" : "no"; + break; + case HORZMAX: + result = (fbwin && fbwin->isMaximizedHorz()) ? "yes" : "no"; + break; case SHADED: result = (fbwin && fbwin->isShaded()) ? "yes" : "no"; break; diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh index 315edb1..a5b7206 100644 --- a/src/ClientPattern.hh +++ b/src/ClientPattern.hh @@ -55,7 +55,7 @@ public: TITLE = 0, CLASS, NAME, ROLE, TRANSIENT, MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN, - XPROP + XPROP, FULLSCREEN, VERTMAX, HORZMAX }; /// Does this client match this pattern? -- cgit v0.11.2 From 9eecd58bf30c8b1c0d72b9070bf91e2c60f32fa5 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Fri, 6 Jul 2012 19:30:39 -0700 Subject: make alt-tab skip modal windows --- src/FocusControl.cc | 2 +- src/Focusable.hh | 4 +++- src/Window.cc | 4 ++++ src/Window.hh | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 5bf113f..383de61 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -53,7 +53,7 @@ namespace { bool doSkipWindow(const Focusable &win, const ClientPattern *pat) { const FluxboxWindow *fbwin = win.fbwindow(); - if (!fbwin || fbwin->isFocusHidden()) + if (!fbwin || fbwin->isFocusHidden() || fbwin->isModal()) return true; // skip if no fbwindow or if focushidden if (pat && !pat->match(win)) return true; // skip if it doesn't match the pattern diff --git a/src/Focusable.hh b/src/Focusable.hh index 679e00b..fd0705b 100644 --- a/src/Focusable.hh +++ b/src/Focusable.hh @@ -54,8 +54,10 @@ public: /// @return true if the focusable has input focus virtual bool isFocused() const { return m_focused; } - /// @return return true if it can be focused + /// @return true if it can be focused virtual bool acceptsFocus() const { return true; } + /// @return true if temporarily prevented from being focused + virtual bool isModal() const { return false; } /// @return true if icon button should appear focused bool getAttentionState() const { return m_attention_state; } diff --git a/src/Window.cc b/src/Window.cc index f5a2fe2..3c8f87b 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3306,6 +3306,10 @@ bool FluxboxWindow::acceptsFocus() const { return (m_client ? m_client->acceptsFocus() : false); } +bool FluxboxWindow::isModal() const { + return (m_client ? m_client->isModal() : true); +} + const FbTk::PixmapWithMask &FluxboxWindow::icon() const { return (m_client ? m_client->icon() : m_icon); } diff --git a/src/Window.hh b/src/Window.hh index 0d2cadd..8c97c7b 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -414,6 +414,7 @@ public: FbTk::FbWindow &parent() { return m_parent; } bool acceptsFocus() const; + bool isModal() const; const FbTk::PixmapWithMask &icon() const; const FbTk::BiDiString &title() const; const FbTk::FbString &getWMClassName() const; -- cgit v0.11.2 From fb52be0c47bb41793fe1ac1eed710fb5375ec3d6 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sun, 8 Jul 2012 17:35:48 -0700 Subject: fix documentation of TAB decoration mask --- doc/asciidoc/fluxbox-apps.txt | 9 ++++----- doc/fluxbox-apps.5.in | 45 ++++++++++++++++++++++++++++++++++--------- doc/fluxbox-keys.5.in | 42 +++++++++++++++++++++++++++++++--------- 3 files changed, 73 insertions(+), 23 deletions(-) diff --git a/doc/asciidoc/fluxbox-apps.txt b/doc/asciidoc/fluxbox-apps.txt index 07bac0e..31a26fa 100644 --- a/doc/asciidoc/fluxbox-apps.txt +++ b/doc/asciidoc/fluxbox-apps.txt @@ -137,10 +137,10 @@ Specify the decoration state. There are several predefined 'value' sets:;; Standard decorations *NONE*;; No decorations - *TAB* - Like TAB except keep the tabs - *Border*;; + *BORDER*;; Like NONE except keep the X window border + *TAB*;; + Like BORDER except keep external tabs (if enabled) *TINY*;; Titlebar with only an iconify button *TOOL*;; @@ -150,8 +150,7 @@ Specify the decoration state. There are several predefined 'value' sets:;; + The 'value' may also be a bitmask for finer-grained control. The bits are, from (1<<0) to (1<<10): Titlebar, Handle/Grips, Border, Iconify Button, Maximize -Button, Close Button, Menu Enabled, Sticky Button, Shade Button, Tabbing -enabled, Focus Enabled. +Button, Close Button, Menu Button, Sticky Button, Shade Button, External Tabs, Focus Enabled. *[Shaded]* {'bool'}:: Whether the window is Shaded (rolled-up) or not. diff --git a/doc/fluxbox-apps.5.in b/doc/fluxbox-apps.5.in index 88b947c..9b32ca6 100644 --- a/doc/fluxbox-apps.5.in +++ b/doc/fluxbox-apps.5.in @@ -1,7 +1,7 @@ '\" t .\" Title: fluxbox-apps .\" Author: Jim Ramsay -.\" Generator: DocBook XSL Stylesheets v1.75.2 +.\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 28 October 2011 .\" Manual: Fluxbox Manual .\" Source: fluxbox-apps.txt @@ -137,18 +137,18 @@ head specified (Xinerama only)\&. Specify the layer to open the window on (by number)\&. Each layer has a number\&. The named ones are: 2\-AboveDock, 4\-Dock, 6\-Top, 8\-Normal, 10\-Bottom, 12\-Desktop\&. .RE .PP -\fB[Dimensions]\fR {\fIwidth\fR \fIheight\fR} +\fB[Dimensions]\fR {\fIwidth[%]\fR \fIheight[%]\fR} .RS 4 Opens the application with the specified \fIwidth\fR and -\fIheight\fR, in pixels\&. +\fIheight\fR, in pixels\&. If the value is given in percent, then the window size will be based on the current screen\(cqs size\&. .RE .PP -\fB[Position]\fR (\fIanchor\fR) {\fIX\fR \fIY\fR} +\fB[Position]\fR (\fIanchor\fR) {\fIX[%]\fR \fIY[%]\fR} .RS 4 Position the application at a particular spot\&. By default the upper\-left corner is placed at screen coordinates (\fIX\fR,\fIY\fR)\&. If you specify an -\fIanchor\fR, say BottomRight, then the lower\-right corner of the window is positioned (\fIX\fR,\fIY\fR) pixels from the lower\-right corner of the screen\&. +\fIanchor\fR, say BottomRight, then the lower\-right corner of the window is positioned (\fIX\fR,\fIY\fR) pixels from the lower\-right corner of the screen\&. If the value is given in percent, then the coordinates will be based on the current screen\(cqs size\&. .PP \fIanchor\fR may be set to one of: .RS 4 @@ -171,15 +171,18 @@ Standard decorations \fBNONE\fR .RS 4 No decorations -\fBTAB\fR -Like TAB except keep the tabs .RE .PP -\fBBorder\fR +\fBBORDER\fR .RS 4 Like NONE except keep the X window border .RE .PP +\fBTAB\fR +.RS 4 +Like BORDER except keep external tabs (if enabled) +.RE +.PP \fBTINY\fR .RS 4 Titlebar with only an iconify button @@ -192,7 +195,7 @@ Titlebar only .sp The \fIvalue\fR -may also be a bitmask for finer\-grained control\&. The bits are, from (1<<0) to (1<<10): Titlebar, Handle/Grips, Border, Iconify Button, Maximize Button, Close Button, Menu Enabled, Sticky Button, Shade Button, Tabbing enabled, Focus Enabled\&. +may also be a bitmask for finer\-grained control\&. The bits are, from (1<<0) to (1<<10): Titlebar, Handle/Grips, Border, Iconify Button, Maximize Button, Close Button, Menu Button, Sticky Button, Shade Button, External Tabs, Focus Enabled\&. .RE .RE .PP @@ -348,6 +351,22 @@ or \fBno\fR, depending on whether the window is maximized or not\&. .RE .PP +\fBMaximizedHorizontal\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is maximized horizontally or not\&. +.RE +.PP +\fBMaximizedVertical\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is maximized vertically or not\&. +.RE +.PP \fBMinimized\fR .RS 4 Either @@ -356,6 +375,14 @@ or \fBno\fR, depending on whether the window is minimized (iconified) or not\&. .RE .PP +\fBFullscreen\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is fullscreen or not\&. +.RE +.PP \fBShaded\fR .RS 4 Either diff --git a/doc/fluxbox-keys.5.in b/doc/fluxbox-keys.5.in index 50b79d8..7ff39f5 100644 --- a/doc/fluxbox-keys.5.in +++ b/doc/fluxbox-keys.5.in @@ -1,7 +1,7 @@ '\" t .\" Title: fluxbox-keys .\" Author: Jim Ramsay -.\" Generator: DocBook XSL Stylesheets v1.75.2 +.\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 28 October 2011 .\" Manual: Fluxbox Manual .\" Source: fluxbox-keys.txt @@ -417,24 +417,24 @@ Reorder the tabs in the current tab group, swapping the current tab with the one Remove the current tab from the tab group, placing it in its own window\&. .RE .PP -\fBResizeTo\fR \fIwidth\fR \fIheight\fR +\fBResizeTo\fR \fIwidth[%]\fR \fIheight[%]\fR .RS 4 -Resizes the window to the given width and height\&. +Resizes the window to the given width and height\&. If the value is given in percent, then the window size will be based on the current screen\(cqs size\&. .RE .PP -\fBResize\fR \fIdelta\-width\fR \fIdelta\-height\fR +\fBResize\fR \fIdelta\-width[%]\fR \fIdelta\-height[%]\fR .RS 4 -Resizes the window relative to the current width and height\&. +Resizes the window relative to the current width and height\&. If the value is given in percent, then the window size will be based on the current window\(cqs size\&. .RE .PP -\fBResizeHorizontal\fR \fIdelta\-width\fR / \fBResizeVertical\fR \fIdelta\-height\fR +\fBResizeHorizontal\fR \fIdelta\-width[%]\fR / \fBResizeVertical\fR \fIdelta\-height[%]\fR .RS 4 -Resizes the window in one dimension only +Resizes the window in one dimension only\&. If the value is given in percent, then the window size will be based on the current window\(cqs size\&. .RE .PP -\fBMoveTo\fR \fIx\fR \fIy\fR [\fIanchor\fR] +\fBMoveTo\fR \fIx[%]\fR \fIy[%]\fR [\fIanchor\fR] .RS 4 -Moves the window to the given coordinates, given in pixels\&. +Moves the window to the given coordinates, given in pixels or relatively to the current screen size if % is specified after the value\&. .sp If either \fIx\fR @@ -1034,6 +1034,22 @@ or \fBno\fR, depending on whether the window is maximized or not\&. .RE .PP +\fBMaximizedHorizontal\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is maximized horizontally or not\&. +.RE +.PP +\fBMaximizedVertical\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is maximized vertically or not\&. +.RE +.PP \fBMinimized\fR .RS 4 Either @@ -1042,6 +1058,14 @@ or \fBno\fR, depending on whether the window is minimized (iconified) or not\&. .RE .PP +\fBFullscreen\fR +.RS 4 +Either +\fByes\fR +or +\fBno\fR, depending on whether the window is fullscreen or not\&. +.RE +.PP \fBShaded\fR .RS 4 Either -- cgit v0.11.2 From 2944cd0014cde6a219822f120fff9588225e8776 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sun, 8 Jul 2012 17:56:26 -0700 Subject: make the menu bit of decoration masks control whether or not menu button is shown on window (it did nothing before) --- src/Window.cc | 17 +++++++++-------- src/WindowState.hh | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 3c8f87b..747c909 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3613,15 +3613,16 @@ void FluxboxWindow::updateButtons() { } break; case WinButton::MENUICON: - winbtn = new WinButton(*this, m_button_theme, - screen().pressedWinButtonTheme(), - dir[i], - frame().titlebar(), - 0, 0, 10, 10); - winbtn->join(titleSig(), + if (m_state.deco_mask & WindowState::DECORM_MENU) { + winbtn = new WinButton(*this, m_button_theme, + screen().pressedWinButtonTheme(), + dir[i], + frame().titlebar(), + 0, 0, 10, 10); + winbtn->join(titleSig(), FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll)); - - winbtn->setOnClick(show_menu_cmd); + winbtn->setOnClick(show_menu_cmd); + } break; } diff --git a/src/WindowState.hh b/src/WindowState.hh index 58664fa..6b45a44 100644 --- a/src/WindowState.hh +++ b/src/WindowState.hh @@ -90,10 +90,10 @@ public: enum Decoration { DECOR_NONE = 0, DECOR_NORMAL = DECORM_LAST - 1, - DECOR_TINY = DECORM_TITLEBAR|DECORM_ICONIFY|DECORM_MENU|DECORM_TAB, - DECOR_TOOL = DECORM_TITLEBAR|DECORM_MENU, - DECOR_BORDER = DECORM_BORDER|DECORM_MENU, - DECOR_TAB = DECORM_BORDER|DECORM_MENU|DECORM_TAB + DECOR_TINY = DECORM_TITLEBAR|DECORM_ICONIFY, + DECOR_TOOL = DECORM_TITLEBAR, + DECOR_BORDER = DECORM_BORDER, + DECOR_TAB = DECORM_BORDER|DECORM_TAB }; enum WindowType { -- cgit v0.11.2