int workspace;
};
+struct padding {
+ int h;
+ int v;
+};
+
#define KBPTR_CENTER 0
#define KBPTR_NORTH (1 << 1)
#define KBPTR_EAST (1 << 2)
static void kbptr_move_on(struct client *client, const union arg *arg);
static void kbptr_click(const union arg *arg);
-static struct kbptr kbptr = { 0, 0, 0, 0 };
-
static void workspace_add_client(struct workspace *workspace,
struct client *client);
static void workspace_remove_client(struct workspace *workspace,
static struct monitor *selmon = NULL;
static Window root;
static struct workspace workspaces[12] = { 0 };
+static struct kbptr kbptr = { 0, 0, 0, 0 };
+static struct padding client_padding = { 8, 8 };
/* configuration, allows nested code to access above variables */
#include "config.h"
{
int n, w, x;
int extraw;
+ int hpad;
struct client *client;
* first implemented this on a laptop and things broke when I
* plugged in a second screen at work.
*/
- w = monitor->win_geom.w / n;
+ hpad = (n + 1) * client_padding.h;
+ w = (monitor->win_geom.w - hpad) / n;
x = monitor->win_geom.x;
/* make the first window a bit larger if the width can't be divided evenly */
- extraw = monitor->win_geom.w - (w * n);
+ extraw = monitor->win_geom.w - hpad - (w * n);
/* assign positions and sizes to all clients on this screen */
for(client = nexttiled(monitor->workspace->clients); client; client = nexttiled(client->next)) {
int border;
+ int width;
+ int height;
border = 2 * client->border.w;
client->incw = 0;
client->inch = 0;
- client_resize_hints(client, x, monitor->win_geom.y, w + extraw - border,
- monitor->win_geom.h - border, False);
+ width = w + extraw - border;
+ height = monitor->win_geom.h - border - 2 * client_padding.v;
+
+ client_resize_hints(client, x + client_padding.h, monitor->win_geom.y + client_padding.v,
+ width, height, False);
/*
* Since all clients are horizontally aligned and the
* same size, only the x coordinate changes.
*/
- x += client_get_width(client);
+
+ x += client_get_width(client) + client_padding.h;
extraw = 0;
}
{
int n, h, y;
int extrah;
+ int vpad;
struct client *client;
return;
}
- h = monitor->win_geom.h / n;
+ vpad = (n + 1) * client_padding.v;
+ h = (monitor->win_geom.h - vpad) / n;
y = monitor->win_geom.y;
- extrah = monitor->win_geom.h - (h * n);
+ extrah = monitor->win_geom.h - vpad - (h * n);
for(client = nexttiled(monitor->workspace->clients); client; client = nexttiled(client->next)) {
int border;
+ int width;
+ int height;
border = 2 * client->border.w;
client->incw = 0;
client->inch = 0;
- client_resize_hints(client, monitor->win_geom.x, y, monitor->win_geom.w - border,
- h + extrah - border, False);
- y += client_get_height(client);
+ width = monitor->win_geom.w - border - 2 * client_padding.h;
+ height = h + extrah - border;
+
+ client_resize_hints(client, monitor->win_geom.x + client_padding.v, y + client_padding.h,
+ width, height, False);
+
+ y += client_get_height(client) + client_padding.v;
extrah = 0;
}