Skip to content

Commit

Permalink
Add nofullscreen group option (issue #163).
Browse files Browse the repository at this point in the history
  • Loading branch information
joewing committed Apr 3, 2015
1 parent 014d01c commit 0faf88d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 42 deletions.
6 changes: 6 additions & 0 deletions jwm.1.in
Expand Up @@ -758,6 +758,12 @@ Prevent windows in this group from being moved.
Prevent windows in this group from being resized.
.RE

.P
.B nofullscreen
.RS
Prevent windows in this group from being fullscreen.
.RE

.P
.B notitle
.RS
Expand Down
3 changes: 3 additions & 0 deletions src/client.c
Expand Up @@ -732,6 +732,9 @@ void SetClientFullScreen(ClientNode *np, char fullScreen)
if(!fullScreen == !(np->state.status & STAT_FULLSCREEN)) {
return;
}
if(!(np->state.border & BORDER_FULLSCREEN)) {
return;
}

if(np->state.status & STAT_SHADED) {
UnshadeClient(np);
Expand Down
24 changes: 13 additions & 11 deletions src/client.h
Expand Up @@ -33,19 +33,21 @@ typedef unsigned short BorderFlags;
#define BORDER_MAX_H (1 << 8) /**< Maximize horizontally. */
#define BORDER_SHADE (1 << 9) /**< Allow shading. */
#define BORDER_CONSTRAIN (1 << 10) /**< Constrain to the screen. */
#define BORDER_FULLSCREEN (1 << 11) /**< Allow fullscreen. */

/** The default border flags. */
#define BORDER_DEFAULT ( \
BORDER_OUTLINE \
| BORDER_TITLE \
| BORDER_MIN \
| BORDER_MAX \
| BORDER_CLOSE \
| BORDER_RESIZE \
| BORDER_MOVE \
| BORDER_MAX_V \
| BORDER_MAX_H \
| BORDER_SHADE )
#define BORDER_DEFAULT ( \
BORDER_OUTLINE \
| BORDER_TITLE \
| BORDER_MIN \
| BORDER_MAX \
| BORDER_CLOSE \
| BORDER_RESIZE \
| BORDER_MOVE \
| BORDER_MAX_V \
| BORDER_MAX_H \
| BORDER_SHADE \
| BORDER_FULLSCREEN )

/** Window status flags.
* We use an unsigned int for storing these, so we get 32 on
Expand Down
3 changes: 3 additions & 0 deletions src/group.c
Expand Up @@ -319,6 +319,9 @@ void ApplyGroup(const GroupType *gp, ClientNode *np)
case OPTION_FULLSCREEN:
np->state.status |= STAT_FULLSCREEN;
break;
case OPTION_NOFULLSCREEN:
np->state.border &= ~BORDER_FULLSCREEN;
break;
default:
Debug("invalid option: %d", lp->option);
break;
Expand Down
63 changes: 32 additions & 31 deletions src/group.h
Expand Up @@ -15,37 +15,38 @@ struct GroupType;

/** Enumeration of group options. */
typedef unsigned char OptionType;
#define OPTION_INVALID 0
#define OPTION_STICKY 1 /**< Start in the sticky state. */
#define OPTION_LAYER 2 /**< Start on a specific layer. */
#define OPTION_DESKTOP 3 /**< Start on a specific desktop. */
#define OPTION_ICON 4 /**< Set the icon to use. */
#define OPTION_NOLIST 5 /**< Don't display in the task list. */
#define OPTION_BORDER 6 /**< Force a window border. */
#define OPTION_NOBORDER 7 /**< Don't draw a window border. */
#define OPTION_TITLE 8 /**< Force a window title bar. */
#define OPTION_NOTITLE 9 /**< Don't draw a window title bar. */
#define OPTION_PIGNORE 10 /**< Ignore program-specified location. */
#define OPTION_MAXIMIZED 11 /**< Start maximized. */
#define OPTION_MINIMIZED 12 /**< Start minimized. */
#define OPTION_SHADED 13 /**< Start shaded. */
#define OPTION_OPACITY 14 /**< Set the opacity. */
#define OPTION_MAX_H 15 /**< Use horizontal maximization. */
#define OPTION_MAX_V 16 /**< Use vertical maximization. */
#define OPTION_NOFOCUS 17 /**< Don't focus on map. */
#define OPTION_NOSHADE 18 /**< Don't allow shading. */
#define OPTION_CENTERED 19 /**< Centered placement. */
#define OPTION_TILED 20 /**< Tiled placement. */
#define OPTION_IIGNORE 21 /**< Ignore increment when maximized. */
#define OPTION_NOPAGER 22 /**< Do not show in pager. */
#define OPTION_NOTURGENT 23 /**< Ignore the urgency hint. */
#define OPTION_CONSTRAIN 24 /**< Constrain the window to the screen. */
#define OPTION_FULLSCREEN 25 /**< Start fullscreen. */
#define OPTION_NOMIN 26 /**< Disallow minimization. */
#define OPTION_NOMAX 27 /**< Disallow maximization. */
#define OPTION_NOCLOSE 28 /**< Disallow closing (from title bar). */
#define OPTION_NOMOVE 29 /**< Disallow moving. */
#define OPTION_NORESIZE 30 /**< Disallow resizing. */
#define OPTION_INVALID 0
#define OPTION_STICKY 1 /**< Start in the sticky state. */
#define OPTION_LAYER 2 /**< Start on a specific layer. */
#define OPTION_DESKTOP 3 /**< Start on a specific desktop. */
#define OPTION_ICON 4 /**< Set the icon to use. */
#define OPTION_NOLIST 5 /**< Don't display in the task list. */
#define OPTION_BORDER 6 /**< Force a window border. */
#define OPTION_NOBORDER 7 /**< Don't draw a window border. */
#define OPTION_TITLE 8 /**< Force a window title bar. */
#define OPTION_NOTITLE 9 /**< Don't draw a window title bar. */
#define OPTION_PIGNORE 10 /**< Ignore program-specified location. */
#define OPTION_MAXIMIZED 11 /**< Start maximized. */
#define OPTION_MINIMIZED 12 /**< Start minimized. */
#define OPTION_SHADED 13 /**< Start shaded. */
#define OPTION_OPACITY 14 /**< Set the opacity. */
#define OPTION_MAX_H 15 /**< Use horizontal maximization. */
#define OPTION_MAX_V 16 /**< Use vertical maximization. */
#define OPTION_NOFOCUS 17 /**< Don't focus on map. */
#define OPTION_NOSHADE 18 /**< Don't allow shading. */
#define OPTION_CENTERED 19 /**< Centered placement. */
#define OPTION_TILED 20 /**< Tiled placement. */
#define OPTION_IIGNORE 21 /**< Ignore increment when maximized. */
#define OPTION_NOPAGER 22 /**< Do not show in pager. */
#define OPTION_NOTURGENT 23 /**< Ignore the urgency hint. */
#define OPTION_CONSTRAIN 24 /**< Constrain the window to the screen. */
#define OPTION_FULLSCREEN 25 /**< Start fullscreen. */
#define OPTION_NOMIN 26 /**< Disallow minimization. */
#define OPTION_NOMAX 27 /**< Disallow maximization. */
#define OPTION_NOCLOSE 28 /**< Disallow closing (from title bar). */
#define OPTION_NOMOVE 29 /**< Disallow moving. */
#define OPTION_NORESIZE 30 /**< Disallow resizing. */
#define OPTION_NOFULLSCREEN 31 /**< Disallow fullscreen. */

/*@{*/
#define InitializeGroups() (void)(0)
Expand Down
1 change: 1 addition & 0 deletions src/parse.c
Expand Up @@ -91,6 +91,7 @@ static const StringMappingType OPTION_MAP[] = {
{ "noborder", OPTION_NOBORDER },
{ "noclose", OPTION_NOCLOSE },
{ "nofocus", OPTION_NOFOCUS },
{ "nofullscreen", OPTION_NOFULLSCREEN },
{ "nolist", OPTION_NOLIST },
{ "nomax", OPTION_NOMAX },
{ "nomin", OPTION_NOMIN },
Expand Down

0 comments on commit 0faf88d

Please sign in to comment.