From 0faf88ddfef4aeeb674bc84493bfc24b906d0c19 Mon Sep 17 00:00:00 2001 From: Joe Wingbermuehle Date: Thu, 2 Apr 2015 19:08:10 -0500 Subject: [PATCH] Add nofullscreen group option (issue #163). --- jwm.1.in | 6 +++++ src/client.c | 3 +++ src/client.h | 24 +++++++++++--------- src/group.c | 3 +++ src/group.h | 63 ++++++++++++++++++++++++++-------------------------- src/parse.c | 1 + 6 files changed, 58 insertions(+), 42 deletions(-) diff --git a/jwm.1.in b/jwm.1.in index ab284c66..568bc212 100644 --- a/jwm.1.in +++ b/jwm.1.in @@ -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 diff --git a/src/client.c b/src/client.c index e7ec801a..a3d591da 100644 --- a/src/client.c +++ b/src/client.c @@ -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); diff --git a/src/client.h b/src/client.h index a2f2b42e..bd5dc09f 100644 --- a/src/client.h +++ b/src/client.h @@ -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 diff --git a/src/group.c b/src/group.c index 7a8e4cfb..b355072e 100644 --- a/src/group.c +++ b/src/group.c @@ -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; diff --git a/src/group.h b/src/group.h index 6f33b3ec..2d7a55e1 100644 --- a/src/group.h +++ b/src/group.h @@ -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) diff --git a/src/parse.c b/src/parse.c index df603b00..49e23a94 100644 --- a/src/parse.c +++ b/src/parse.c @@ -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 },