This commit is contained in:
Mathias Gumz 2012-07-14 10:08:28 +02:00
commit a076bdcbda
11 changed files with 122 additions and 39 deletions

View file

@ -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.

View file

@ -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.

View file

@ -1,7 +1,7 @@
'\" t
.\" Title: fluxbox-apps
.\" Author: Jim Ramsay <i.am@jimramsay.com>
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" 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

View file

@ -1,7 +1,7 @@
'\" t
.\" Title: fluxbox-keys
.\" Author: Jim Ramsay <i.am@jimramsay.com>
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" 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

View file

@ -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;

View file

@ -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?

View file

@ -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

View file

@ -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; }

View file

@ -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);
}
@ -3609,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;
}

View file

@ -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;

View file

@ -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 {