struct ws_win *win;
struct workspace *ws;
struct swm_region *r;
- int i, x, foundit = 0;
+ int i, x;
if (testwin == NULL)
return (0);
- for (i = 0, foundit = 0; i < ScreenCount(display); i++)
+ for (i = 0; i < ScreenCount(display); i++)
TAILQ_FOREACH(r, &screens[i].rl, entry)
for (x = 0; x < SWM_WS_MAX; x++) {
ws = &r->s->ws[x];
{
struct swm_region *r;
struct workspace *ws;
- int foundit, i, x;
+ int i, x;
/* validate all ws */
- for (i = 0, foundit = 0; i < ScreenCount(display); i++)
+ for (i = 0; i < ScreenCount(display); i++)
TAILQ_FOREACH(r, &screens[i].rl, entry)
for (x = 0; x < SWM_WS_MAX; x++) {
ws = &r->s->ws[x];
cycle_layout(struct swm_region *r, union arg *args)
{
struct workspace *ws = r->ws;
- struct ws_win *winfocus;
union arg a;
DNPRINTF(SWM_D_EVENT, "cycle_layout: workspace: %d\n", ws->idx);
- winfocus = ws->focus;
-
ws->cur_layout++;
if (ws->cur_layout->l_stack == NULL)
ws->cur_layout = &layouts[0];
stack(void) {
struct swm_geometry g;
struct swm_region *r;
- int i, j;
+ int i;
DNPRINTF(SWM_D_STACK, "stack\n");
for (i = 0; i < ScreenCount(display); i++) {
- j = 0;
TAILQ_FOREACH(r, &screens[i].rl, entry) {
DNPRINTF(SWM_D_STACK, "stacking workspace %d "
"(screen %d, region %d)\n", r->ws->idx, i, j++);
void
name_workspace(struct swm_region *r, union arg *args)
{
- struct workspace *ws;
FILE *lfile;
DNPRINTF(SWM_D_MISC, "name_workspace\n");
- if (r && r->ws)
- ws = r->ws;
- else
+ if (r == NULL)
return;
search_r = r;
strerror(errno));
return;
}
- ws->name[len - 1] = '\0';
}
}
strerror(errno));
return;
}
- q[len - 1] = '\0';
p = strchr(q, ':');
if (p != NULL)
*p = '\0';
strerror(errno));
return;
}
- s[len - 1] = '\0';
+
idx = strtonum(s, 1, INT_MAX, &errstr);
if (errstr) {
DNPRINTF(SWM_D_MISC, "window idx is %s: %s",
goto done;
}
resp[rbytes] = '\0';
+
+ /* XXX:
+ * Older versions of dmenu (Atleast pre 4.4.1) do not send a
+ * newline, so work around that by sanitizing the resp now.
+ */
+ resp[strcspn(resp, "\n")] = '\0';
len = strlen(resp);
switch (search_resp_action) {
{
unsigned int mask;
XWindowChanges wc;
- struct swm_region *r;
- r = root_to_region(win->wa.root);
bzero(&wc, sizeof wc);
mask = CWX | CWY;
wc.x = win->g.x;
setkeybinding(MODKEY|ShiftMask, XK_bracketright,kf_move_down, NULL);
setkeybinding(MODKEY|ShiftMask, XK_slash, kf_name_workspace,NULL);
setkeybinding(MODKEY, XK_slash, kf_search_workspace,NULL);
- setkeybinding(MODKEY, XK_s, kf_search_win, NULL);
+ setkeybinding(MODKEY, XK_f, kf_search_win, NULL);
#ifdef SWM_DEBUG
setkeybinding(MODKEY|ShiftMask, XK_d, kf_dumpwins, NULL);
#endif