Defaults are split between defines and conf_init(); normalize these, as
well as give 'sticky' groups its own variable.
This commit is contained in:
parent
dcdbf54e85
commit
6889482fc7
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $OpenBSD: calmwm.h,v 1.319 2016/09/30 21:44:51 okan Exp $
|
* $OpenBSD: calmwm.h,v 1.320 2016/10/03 14:42:34 okan Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CALMWM_H_
|
#ifndef _CALMWM_H_
|
||||||
@ -284,34 +284,26 @@ struct conf {
|
|||||||
struct autogroupwin_q autogroupq;
|
struct autogroupwin_q autogroupq;
|
||||||
struct ignore_q ignoreq;
|
struct ignore_q ignoreq;
|
||||||
struct cmd_q cmdq;
|
struct cmd_q cmdq;
|
||||||
#define CONF_STICKY_GROUPS 0x0001
|
int stickygroups;
|
||||||
int flags;
|
|
||||||
#define CONF_BWIDTH 1
|
|
||||||
int bwidth;
|
int bwidth;
|
||||||
#define CONF_MAMOUNT 1
|
|
||||||
int mamount;
|
int mamount;
|
||||||
#define CONF_SNAPDIST 0
|
|
||||||
int snapdist;
|
int snapdist;
|
||||||
struct gap gap;
|
struct gap gap;
|
||||||
char *color[CWM_COLOR_NITEMS];
|
char *color[CWM_COLOR_NITEMS];
|
||||||
char known_hosts[PATH_MAX];
|
char known_hosts[PATH_MAX];
|
||||||
#define CONF_FONT "sans-serif:pixelsize=14:bold"
|
|
||||||
char *font;
|
char *font;
|
||||||
Cursor cursor[CF_NITEMS];
|
Cursor cursor[CF_NITEMS];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* MWM hints */
|
/* MWM hints */
|
||||||
struct mwm_hints {
|
struct mwm_hints {
|
||||||
unsigned long flags;
|
|
||||||
unsigned long functions;
|
|
||||||
unsigned long decorations;
|
|
||||||
};
|
|
||||||
#define MWM_HINTS_ELEMENTS 3L
|
#define MWM_HINTS_ELEMENTS 3L
|
||||||
|
#define MWM_FLAGS_STATUS (1<<3)
|
||||||
|
|
||||||
#define MWM_FLAGS_FUNCTIONS (1<<0)
|
#define MWM_FLAGS_FUNCTIONS (1<<0)
|
||||||
#define MWM_FLAGS_DECORATIONS (1<<1)
|
#define MWM_FLAGS_DECORATIONS (1<<1)
|
||||||
#define MWM_FLAGS_INPUT_MODE (1<<2)
|
#define MWM_FLAGS_INPUT_MODE (1<<2)
|
||||||
#define MWM_FLAGS_STATUS (1<<3)
|
unsigned long flags;
|
||||||
|
|
||||||
#define MWM_FUNCS_ALL (1<<0)
|
#define MWM_FUNCS_ALL (1<<0)
|
||||||
#define MWM_FUNCS_RESIZE (1<<1)
|
#define MWM_FUNCS_RESIZE (1<<1)
|
||||||
@ -319,6 +311,7 @@ struct mwm_hints {
|
|||||||
#define MWM_FUNCS_MINIMIZE (1<<3)
|
#define MWM_FUNCS_MINIMIZE (1<<3)
|
||||||
#define MWM_FUNCS_MAXIMIZE (1<<4)
|
#define MWM_FUNCS_MAXIMIZE (1<<4)
|
||||||
#define MWM_FUNCS_CLOSE (1<<5)
|
#define MWM_FUNCS_CLOSE (1<<5)
|
||||||
|
unsigned long functions;
|
||||||
|
|
||||||
#define MWM_DECOR_ALL (1<<0)
|
#define MWM_DECOR_ALL (1<<0)
|
||||||
#define MWM_DECOR_BORDER (1<<1)
|
#define MWM_DECOR_BORDER (1<<1)
|
||||||
@ -327,6 +320,8 @@ struct mwm_hints {
|
|||||||
#define MWM_DECOR_MENU (1<<4)
|
#define MWM_DECOR_MENU (1<<4)
|
||||||
#define MWM_DECOR_MINIMIZE (1<<5)
|
#define MWM_DECOR_MINIMIZE (1<<5)
|
||||||
#define MWM_DECOR_MAXIMIZE (1<<6)
|
#define MWM_DECOR_MAXIMIZE (1<<6)
|
||||||
|
unsigned long decorations;
|
||||||
|
};
|
||||||
|
|
||||||
extern Display *X_Dpy;
|
extern Display *X_Dpy;
|
||||||
extern Time Last_Event_Time;
|
extern Time Last_Event_Time;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $OpenBSD: client.c,v 1.226 2016/10/03 13:41:30 okan Exp $
|
* $OpenBSD: client.c,v 1.227 2016/10/03 14:42:34 okan Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -133,7 +133,7 @@ client_init(Window win, struct screen_ctx *sc, int active)
|
|||||||
goto out;
|
goto out;
|
||||||
if (group_autogroup(cc))
|
if (group_autogroup(cc))
|
||||||
goto out;
|
goto out;
|
||||||
if (Conf.flags & CONF_STICKY_GROUPS)
|
if (Conf.stickygroups)
|
||||||
group_assign(sc->group_active, cc);
|
group_assign(sc->group_active, cc);
|
||||||
else
|
else
|
||||||
group_assign(NULL, cc);
|
group_assign(NULL, cc);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $OpenBSD: conf.c,v 1.208 2016/09/30 18:28:06 okan Exp $
|
* $OpenBSD: conf.c,v 1.209 2016/10/03 14:42:34 okan Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -254,9 +254,10 @@ conf_init(struct conf *c)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
c->bwidth = CONF_BWIDTH;
|
c->stickygroups = 0;
|
||||||
c->mamount = CONF_MAMOUNT;
|
c->bwidth = 1;
|
||||||
c->snapdist = CONF_SNAPDIST;
|
c->mamount = 1;
|
||||||
|
c->snapdist = 0;
|
||||||
|
|
||||||
TAILQ_INIT(&c->ignoreq);
|
TAILQ_INIT(&c->ignoreq);
|
||||||
TAILQ_INIT(&c->cmdq);
|
TAILQ_INIT(&c->cmdq);
|
||||||
@ -279,7 +280,7 @@ conf_init(struct conf *c)
|
|||||||
(void)snprintf(c->known_hosts, sizeof(c->known_hosts), "%s/%s",
|
(void)snprintf(c->known_hosts, sizeof(c->known_hosts), "%s/%s",
|
||||||
homedir, ".ssh/known_hosts");
|
homedir, ".ssh/known_hosts");
|
||||||
|
|
||||||
c->font = xstrdup(CONF_FONT);
|
c->font = xstrdup("sans-serif:pixelsize=14:bold");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: parse.y,v 1.64 2015/05/17 04:39:50 kspillner Exp $ */
|
/* $OpenBSD: parse.y,v 1.65 2016/10/03 14:42:34 okan Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
|
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
|
||||||
@ -112,10 +112,7 @@ main : FONTNAME STRING {
|
|||||||
conf->font = $2;
|
conf->font = $2;
|
||||||
}
|
}
|
||||||
| STICKY yesno {
|
| STICKY yesno {
|
||||||
if ($2 == 0)
|
conf->stickygroups = $2;
|
||||||
conf->flags &= ~CONF_STICKY_GROUPS;
|
|
||||||
else
|
|
||||||
conf->flags |= CONF_STICKY_GROUPS;
|
|
||||||
}
|
}
|
||||||
| BORDERWIDTH NUMBER {
|
| BORDERWIDTH NUMBER {
|
||||||
if ($2 < 0 || $2 > UINT_MAX) {
|
if ($2 < 0 || $2 > UINT_MAX) {
|
||||||
|
Loading…
Reference in New Issue
Block a user