void store_float_geom(struct ws_win *, struct swm_region *);
void unmanage_window(struct ws_win *);
void update_window(struct ws_win *);
void store_float_geom(struct ws_win *, struct swm_region *);
void unmanage_window(struct ws_win *);
void update_window(struct ws_win *);
num_screens = xcb_setup_roots_length(xcb_get_setup(conn));
for (i = 0; i < num_screens; i++) {
/* Support check window will be created by workaround(). */
num_screens = xcb_setup_roots_length(xcb_get_setup(conn));
for (i = 0; i < num_screens; i++) {
/* Support check window will be created by workaround(). */
/* Report supported atoms */
xcb_delete_property(conn, screens[i].root, sup_list);
for (j = 0; j < LENGTH(ewmh); j++)
/* Report supported atoms */
xcb_delete_property(conn, screens[i].root, sup_list);
for (j = 0; j < LENGTH(ewmh); j++)
+ DNPRINTF(SWM_D_PROP, "ewmh_update_win_state: window: 0x%x, state: %d, "
+ "action: %d\n", win->id, state, action);
+
if (state == ewmh[_NET_WM_STATE_FULLSCREEN].atom)
mask = EWMH_F_FULLSCREEN;
if (state == ewmh[_NET_WM_STATE_ABOVE].atom)
if (state == ewmh[_NET_WM_STATE_FULLSCREEN].atom)
mask = EWMH_F_FULLSCREEN;
if (state == ewmh[_NET_WM_STATE_ABOVE].atom)
- XftTextExtentsUtf8(display, bar_fs, (FcChar8 *)s, len, &info);
-
+ XftTextExtentsUtf8(display, bar_font, (FcChar8 *)s, len, &info);
+
xcb_change_gc(conn, r->s->bar_gc, XCB_GC_FOREGROUND, gcv);
xcb_image_text_8(conn, len, r->bar->buffer, r->s->bar_gc, x,
xcb_change_gc(conn, r->s->bar_gc, XCB_GC_FOREGROUND, gcv);
xcb_image_text_8(conn, len, r->bar->buffer, r->s->bar_gc, x,
/* blt */
xcb_copy_area(conn, r->bar->buffer, r->bar->id, r->s->bar_gc, 0, 0,
/* blt */
xcb_copy_area(conn, r->bar->buffer, r->bar->id, r->s->bar_gc, 0, 0,
}
if ((r->bar = calloc(1, sizeof(struct swm_bar))) == NULL)
err(1, "bar_setup: calloc: failed to allocate memory.");
}
if ((r->bar = calloc(1, sizeof(struct swm_bar))) == NULL)
err(1, "bar_setup: calloc: failed to allocate memory.");
-
- DNPRINTF(SWM_D_INIT, "bar_setup: try font %s\n", bar_font);
- bar_fs = XftFontOpenName(display, DefaultScreen(display),
- bar_font);
- if (!bar_fs) {
- warnx("unable to load font %s", bar_font);
+
+ DNPRINTF(SWM_D_INIT, "bar_setup: try font %s\n", font);
+ bar_font = XftFontOpenName(display, DefaultScreen(display),
+ font);
+ if (!bar_font) {
+ warnx("unable to load font %s", font);
xcb_unmap_window(conn, win->id);
xcb_change_window_attributes(conn, win->id,
xcb_unmap_window(conn, win->id);
xcb_change_window_attributes(conn, win->id,
snprintf(s, sizeof s, "%d", i);
len = strlen(s);
snprintf(s, sizeof s, "%d", i);
len = strlen(s);
- XftTextExtentsUtf8(display, bar_fs, (FcChar8 *)s, len, &info);
-
+ XftTextExtentsUtf8(display, bar_font, (FcChar8 *)s, len, &info);
+
w = xcb_generate_id(conn);
wa[0] = r->s->c[SWM_S_COLOR_FOCUS].color;
wa[1] = r->s->c[SWM_S_COLOR_UNFOCUS].color;
xcb_create_window(conn, XCB_COPY_FROM_PARENT, w, win->id, 0, 0,
w = xcb_generate_id(conn);
wa[0] = r->s->c[SWM_S_COLOR_FOCUS].color;
wa[1] = r->s->c[SWM_S_COLOR_UNFOCUS].color;
xcb_create_window(conn, XCB_COPY_FROM_PARENT, w, win->id, 0, 0,
1, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT,
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL, wa);
1, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT,
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL, wa);
gcv[1] = r->s->c[SWM_S_COLOR_FOCUS].color;
gcv[2] = 0;
xcb_create_gc(conn, sw->gc, w, XCB_GC_FOREGROUND |
gcv[1] = r->s->c[SWM_S_COLOR_FOCUS].color;
gcv[2] = 0;
xcb_create_gc(conn, sw->gc, w, XCB_GC_FOREGROUND |
- xcb_image_text_8(conn, len, w, sw->gc, 2, bar_fs_height, s);
+ xcb_image_text_8(conn, len, w, sw->gc, 2, bar_font->height, s);
if (!(display = XOpenDisplay(0)))
errx(1, "can not open display");
if (!(display = XOpenDisplay(0)))
errx(1, "can not open display");
if (xcb_connection_has_error(conn))
errx(1, "can not get XCB connection");
if (xcb_connection_has_error(conn))
errx(1, "can not get XCB connection");
xcb_prefetch_extension_data(conn, &xcb_randr_id);
xfd = xcb_get_file_descriptor(conn);
xcb_prefetch_extension_data(conn, &xcb_randr_id);
xfd = xcb_get_file_descriptor(conn);
if (screens[i].bar_gc != 0)
xcb_free_gc(conn, screens[i].bar_gc);
#if 0
if (screens[i].bar_gc != 0)
xcb_free_gc(conn, screens[i].bar_gc);
#if 0