Window indicator;
};
TAILQ_HEAD(search_winlist, search_window);
-
-struct search_winlist search_wl;
+struct search_winlist search_wl;
/* search actions */
enum {
GC bar_gc;
};
struct swm_screen *screens;
-int num_screens;
/* args to functions */
union arg {
&real, &format, nitems_ret, nbytes_ret, data);
if (status != Success)
- return False;
+ return (False);
if (real != type)
- return False;
+ return (False);
- return True;
+ return (True);
}
void
for (j = 0; j < LENGTH(ewmh); j++)
XChangeProperty(display, screens[i].root,
sup_list, XA_ATOM, 32,
- PropModeAppend, (unsigned char *)&ewmh[j].atom,1);
+ PropModeAppend, (unsigned char *)&ewmh[j].atom, 1);
}
}
struct swm_geometry rg;
if (!win->ws->r)
- return 0;
+ return (0);
if (!win->floating)
- return 0;
+ return (0);
DNPRINTF(SWM_D_MISC, "ewmh_set_win_fullscreen: window: 0x%lx, "
"fullscreen %s\n", win->id, YESNO(fs));
}
}
- return 1;
+ return (1);
}
void
name = "Unknown";
}
- return name;
+ return (name);
}
char *
name = "Unknown";
}
- return name;
+ return (name);
}
void
bar_class_name(char *s, ssize_t sz, struct ws_win *cur_focus)
{
int do_class, do_name;
- Status status;
- XClassHint *xch = NULL;
+ XClassHint *ch;
- if ((title_name_enabled == 1 || title_class_enabled == 1) &&
- cur_focus != NULL) {
- if ((xch = XAllocClassHint()) == NULL)
- goto out;
- status = XGetClassHint(display, cur_focus->id, xch);
- if (status == BadWindow || status == BadAlloc)
- goto out;
- do_class = (title_class_enabled && xch->res_class != NULL);
- do_name = (title_name_enabled && xch->res_name != NULL);
- if (do_class)
- strlcat(s, xch->res_class, sz);
- if (do_class && do_name)
- strlcat(s, ":", sz);
- if (do_name)
- strlcat(s, xch->res_name, sz);
- strlcat(s, " ", sz);
- }
-out:
- if (xch) {
- XFree(xch->res_name);
- XFree(xch->res_class);
- XFree(xch);
- }
+ if (title_name_enabled == 0 && title_class_enabled == 0)
+ return;
+ if (cur_focus == NULL)
+ return;
+
+ ch = &cur_focus->ch;
+ do_class = (title_class_enabled && ch->res_class != NULL);
+ do_name = (title_name_enabled && ch->res_name != NULL);
+
+ if (do_class)
+ strlcat(s, ch->res_class, sz);
+ if (do_class && do_name)
+ strlcat(s, ":", sz);
+ if (do_name)
+ strlcat(s, ch->res_name, sz);
+ strlcat(s, " ", sz);
}
void
XChangeProperty(display, win->s->root,
ewmh[_NET_ACTIVE_WINDOW].atom, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)&none,1);
+ PropModeReplace, (unsigned char *)&none, 1);
}
void
XChangeProperty(display, win->s->root,
ewmh[_NET_ACTIVE_WINDOW].atom, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)&win->id,1);
+ PropModeReplace, (unsigned char *)&win->id, 1);
}
bar_check_opts();
if (target == source) {
if (source->ws->focus_prev != NULL &&
source->ws->focus_prev != target)
-
source = source->ws->focus_prev;
else
return;
struct swm_region *r;
if (win == NULL)
- return 0;
+ return (0);
if (!win->ws->r)
- return 0;
+ return (0);
r = win->ws->r;
/* reject floating toggles in max stack mode */
if (win->ws->cur_layout == &layouts[SWM_MAX_STACK])
- return 0;
+ return (0);
if (win->floating) {
if (!win->floatmaxed) {
ewmh_update_actions(win);
- return 1;
+ return (1);
}
void
wc.sibling = ev->above;
wc.stack_mode = ev->detail;
XConfigureWindow(display, ev->window, ev->value_mask, &wc);
- } else {
+ } else
config_win(win, ev);
- }
}
void
screens[i].c[SWM_S_COLOR_UNFOCUS].color);
XChangeProperty(display, root, netwmcheck, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)&win,1);
+ PropModeReplace, (unsigned char *)&win, 1);
XChangeProperty(display, win, netwmcheck, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)&win,1);
+ PropModeReplace, (unsigned char *)&win, 1);
XChangeProperty(display, win, netwmname, utf8_string, 8,
PropModeReplace, (unsigned char*)"LG3D", strlen("LG3D"));
}