added offest for first centered window width

This commit is contained in:
Alexander Bocken 2021-05-09 00:16:04 +02:00
parent 39f2c5354f
commit 86ce7af866
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 3 additions and 3 deletions

View File

@ -8,6 +8,7 @@ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
static const int vertpad = 10; /* vertical padding of bar */ static const int vertpad = 10; /* vertical padding of bar */
static const int sidepad = 20; /* horizontal padding of bar */ static const int sidepad = 20; /* horizontal padding of bar */
static const float firstwindowoffset = 0.1; /* render first window 10% larger than mfact would for firstwindowcentered layout */
static const char *fonts[] = { "monospace:size=13", static const char *fonts[] = { "monospace:size=13",
"IPAGothic:size=13", "IPAGothic:size=13",
"symbola:size=13"}; "symbola:size=13"};

5
dwm.c
View File

@ -17,7 +17,6 @@
* client. * client.
* *
* Keys and tagging rules are organized as arrays and defined in config.h. * Keys and tagging rules are organized as arrays and defined in config.h.
*
* To understand everything else, start reading main(). * To understand everything else, start reading main().
*/ */
#include <errno.h> #include <errno.h>
@ -2507,10 +2506,10 @@ centeredfirstwindow(Monitor *m)
/* initialize nmaster area */ /* initialize nmaster area */
if (m->ww > m->wh) { if (m->ww > m->wh) {
mw = m->nmaster ? m->ww * m->mfact : 0; mw = m->nmaster ? m->ww * (m->mfact + firstwindowoffset) : 0;
mh = m->nmaster ? m->wh : 0; mh = m->nmaster ? m->wh : 0;
} else { } else {
mh = m->nmaster ? m->wh * m->mfact : 0; mh = m->nmaster ? m->wh * (m->mfact + firstwindowoffset) : 0;
mw = m->nmaster ? m->ww : 0; mw = m->nmaster ? m->ww : 0;
} }
mx = mxo = (m->ww - mw) / 2; mx = mxo = (m->ww - mw) / 2;