cvsimport

* refs/heads/master:
  more client vs screen context differences
  If a client sets hints, honor them for kb resize requests, just like we do for mouse based resize requests.
  Move kb pointer movement out of the kbfunc_client_moveresize since it's got nothing to do with clients, thus doing flags work causes lots of waste and almost useless jumpy pointer movements; while here, split out move and resize since they share almost no code, just like mouse client move/resize; factor out amount and factor. Still wonder why this is here, but it works now.
  pledge "stdio rpath proc exec" cwm before main event loop, after init/setup - mostly for menu building.
  Partial revert of replacing screen_area() with region_find(); until a fix for a regression is found; this bug has been around for a long time it seems, but this change exposed it. Likely need to track clients in to and out of regions.
  Use position on root to figure out region.
  Start cleaning up name vs function differences; replace magic numbers.
  Clean up unused defines.
  Extend region to include both view and work areas; switch to region_find() which no longer needs to recalculate gap each time a client (or menu) is created or altered. If no RandR, fall back to display dimensions while building regions instead of during execution.
This commit is contained in:
okan
2015-11-12 21:28:03 +00:00
9 changed files with 344 additions and 276 deletions

View File

@@ -71,51 +71,46 @@ size_t strlcpy(char *, const char *, size_t);
#define KEYMASK (KeyPressMask | ExposureMask)
#define IGNOREMODMASK (LockMask | Mod2Mask | 0x2000)
/* kb movement */
#define CWM_MOVE 0x0001
#define CWM_RESIZE 0x0002
#define CWM_PTRMOVE 0x0004
#define CWM_BIGMOVE 0x0008
#define CWM_UP 0x0010
#define CWM_DOWN 0x0020
#define CWM_LEFT 0x0040
#define CWM_RIGHT 0x0080
/* direction/amount */
#define CWM_UP 0x0001
#define CWM_DOWN 0x0002
#define CWM_LEFT 0x0004
#define CWM_RIGHT 0x0008
#define CWM_BIGAMOUNT 0x0010
#define DIRECTIONMASK (CWM_UP | CWM_DOWN | CWM_LEFT | CWM_RIGHT)
/* exec */
#define CWM_EXEC_PROGRAM 0x0001
#define CWM_EXEC_WM 0x0002
#define CWM_CLIENT_CYCLE 0x0001
#define CWM_CLIENT_RCYCLE 0x0002
#define CWM_CLIENT_CYCLE_INGRP 0x0004
/* cycle */
#define CWM_CYCLE 0x0001
#define CWM_RCYCLE 0x0002
#define CWM_INGROUP 0x0004
#define CWM_CLIENT_TILE_HORIZ 0x0001
#define CWM_CLIENT_TILE_VERT 0x0002
#define CWM_MENU_EXEC 0x0001
#define CWM_MENU_EXEC_WM 0x0002
/* menu */
#define CWM_MENU_DUMMY 0x0001
#define CWM_MENU_FILE 0x0002
#define CWM_MENU_LIST 0x0004
#define ARG_CHAR 0x0001
#define ARG_INT 0x0002
#define CWM_TILE_HORIZ 0x0001
#define CWM_TILE_VERT 0x0002
#define CWM_GAP 0x0001
#define CWM_NOGAP 0x0002
#define CWM_WIN 0x0001
#define CWM_CMD 0x0002
#define CWM_KBD 0x0001
#define CWM_MOUSE 0x0002
#define CWM_CONTEXT_NONE 0x0000
#define CWM_CONTEXT_CLIENT 0x0001
#define CWM_CONTEXT_SCREEN 0x0002
#define CWM_QUIT 0x0000
#define CWM_RUNNING 0x0001
#define CWM_EXECWM 0x0002
#define CWM_EXEC_WM 0x0002
union arg {
char *c;
int i;
};
union press {
KeySym keysym;
unsigned int button;
@@ -129,7 +124,6 @@ enum cursor_font {
CF_RESIZE,
CF_NITEMS
};
enum color {
CWM_COLOR_BORDER_ACTIVE,
CWM_COLOR_BORDER_INACTIVE,
@@ -246,6 +240,8 @@ struct region_ctx {
TAILQ_ENTRY(region_ctx) entry;
int num;
struct geom area;
struct geom view; /* viewable area */
struct geom work; /* workable area, gap-applied */
};
TAILQ_HEAD(region_ctx_q, region_ctx);
@@ -277,7 +273,7 @@ struct binding {
union arg argument;
unsigned int modmask;
union press press;
int flags;
int context;
};
TAILQ_HEAD(keybinding_q, binding);
TAILQ_HEAD(mousebinding_q, binding);
@@ -478,6 +474,7 @@ void search_print_client(struct menu *, int);
void search_print_cmd(struct menu *, int);
void search_print_group(struct menu *, int);
struct region_ctx *region_find(struct screen_ctx *, int, int);
struct geom screen_apply_gap(struct screen_ctx *, struct geom);
struct screen_ctx *screen_find(Window);
struct geom screen_area(struct screen_ctx *, int, int, int);
@@ -486,26 +483,19 @@ void screen_update_geometry(struct screen_ctx *);
void screen_updatestackingorder(struct screen_ctx *);
void kbfunc_client_cycle(struct client_ctx *, union arg *);
void kbfunc_client_cyclegroup(struct client_ctx *,
union arg *);
void kbfunc_client_delete(struct client_ctx *, union arg *);
void kbfunc_client_group(struct client_ctx *, union arg *);
void kbfunc_client_grouponly(struct client_ctx *,
union arg *);
void kbfunc_client_grouptoggle(struct client_ctx *,
union arg *);
void kbfunc_client_hide(struct client_ctx *, union arg *);
void kbfunc_client_label(struct client_ctx *, union arg *);
void kbfunc_client_lower(struct client_ctx *, union arg *);
void kbfunc_client_moveresize(struct client_ctx *,
union arg *);
void kbfunc_client_move(struct client_ctx *, union arg *);
void kbfunc_client_movetogroup(struct client_ctx *,
union arg *);
void kbfunc_client_nogroup(struct client_ctx *,
union arg *);
void kbfunc_client_raise(struct client_ctx *, union arg *);
void kbfunc_client_rcycle(struct client_ctx *, union arg *);
void kbfunc_client_search(struct client_ctx *, union arg *);
void kbfunc_client_resize(struct client_ctx *, union arg *);
void kbfunc_client_tile(struct client_ctx *, union arg *);
void kbfunc_client_toggle_freeze(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_fullscreen(struct client_ctx *,
@@ -518,24 +508,30 @@ void kbfunc_client_toggle_sticky(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_vmaximize(struct client_ctx *,
union arg *);
void kbfunc_cmdexec(struct client_ctx *, union arg *);
void kbfunc_cwm_status(struct client_ctx *, union arg *);
void kbfunc_exec(struct client_ctx *, union arg *);
void kbfunc_lock(struct client_ctx *, union arg *);
void kbfunc_exec_lock(struct client_ctx *, union arg *);
void kbfunc_exec_term(struct client_ctx *, union arg *);
void kbfunc_group_alltoggle(struct client_ctx *,
union arg *);
void kbfunc_group_cycle(struct client_ctx *, union arg *);
void kbfunc_group_only(struct client_ctx *, union arg *);
void kbfunc_group_toggle(struct client_ctx *, union arg *);
void kbfunc_menu_exec(struct client_ctx *, union arg *);
void kbfunc_menu_client(struct client_ctx *, union arg *);
void kbfunc_menu_cmd(struct client_ctx *, union arg *);
void kbfunc_menu_group(struct client_ctx *, union arg *);
void kbfunc_ssh(struct client_ctx *, union arg *);
void kbfunc_term(struct client_ctx *, union arg *);
void kbfunc_tile(struct client_ctx *, union arg *);
void kbfunc_menu_ssh(struct client_ctx *, union arg *);
void kbfunc_ptrmove(struct client_ctx *, union arg *);
void mousefunc_client_move(struct client_ctx *,
union arg *);
void mousefunc_client_resize(struct client_ctx *,
union arg *);
void mousefunc_menu_client(struct client_ctx *,
union arg *);
void mousefunc_menu_cmd(struct client_ctx *, union arg *);
void mousefunc_menu_group(struct client_ctx *, union arg *);
void mousefunc_menu_unhide(struct client_ctx *,
union arg *);
struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
const char *, const char *, int,