/* create the text window used for the icon-mode popup */
popup.icon_mode_text = create_window(popup.bg, 0, 0, NULL);
- XMapWindow(obt_display, popup.icon_mode_text);
popup.targets = NULL;
popup.n_targets = 0;
t->textwin = create_window(p->bg, 0, 0, NULL);
XMapWindow(obt_display, t->iconwin);
- XMapWindow(obt_display, t->textwin);
p->targets = g_list_prepend(p->targets, t);
++n;
if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
/* how many icons will fit in that row? make the width fit that */
w -= l + r;
- icons_per_row = (w + ICON_SIZE - 1) / ICON_SIZE;
- w = icons_per_row * ICON_SIZE + l + r;
+ icons_per_row = (w + HILITE_SIZE - 1) / HILITE_SIZE;
+ w = icons_per_row * HILITE_SIZE + l + r;
/* how many rows do we need? */
icon_rows = (p->n_targets-1) / icons_per_row + 1;
/* center the icons if there is less than one row */
if (icon_rows == 1)
- icons_center_x = (w - p->n_targets * ICON_SIZE) / 2;
+ icons_center_x = (w - p->n_targets * HILITE_SIZE) / 2;
else
icons_center_x = 0;
/* position the background but don't draw it */
XMoveResizeWindow(obt_display, p->bg, x, y, w, h);
- if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
/* position the text */
XMoveResizeWindow(obt_display, p->icon_mode_text,
icon_mode_textx, icon_mode_texty, textw, texth);
+ XMapWindow(obt_display, popup.icon_mode_text);
+ }
+ else
+ XUnmapWindow(obt_display, popup.icon_mode_text);
}
/* find the focused target */
/* find the dimensions of the text box */
list_mode_textx = iconx + HILITE_SIZE + TEXT_BORDER;
list_mode_texty = icony + HILITE_OFFSET;
-// textw = w
-// /* left edge */ - innerx - HILITE_SIZE - TEXT_BORDER
-// /* right edge */ - OUTSIDE_BORDER - TEXT_BORDER;
/* position the icon */
XMoveResizeWindow(obt_display, target->iconwin,
iconx, icony, HILITE_SIZE, HILITE_SIZE);
/* position the text */
- if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
XMoveResizeWindow(obt_display, target->textwin,
list_mode_textx, list_mode_texty,
textw, texth);
+ XMapWindow(obt_display, target->textwin);
+ }
+ else
+ XUnmapWindow(obt_display, target->textwin);
/* get the icon from the client */
icon = client_icon(target->client, ICON_SIZE, ICON_SIZE);