- /* have to redraw the targetted icon and last targetted icon,
- they can pick up the hilite changes in the backgroud */
- if (!p->mapped || newtarget == target || p->last_target == target) {
- const ObClientIcon *icon;
- const gint row = i / icons_per_row; /* starting from 0 */
- const gint col = i % icons_per_row; /* starting from 0 */
- gint innerx, innery;
-
- /* find the dimensions of the icon inside it */
- innerx = icons_center_x + l + (col * ICON_SIZE);
- innerx += ICON_HILITE_WIDTH + ICON_HILITE_MARGIN;
- innery = t + (row * ICON_SIZE);
- innery += ICON_HILITE_WIDTH + ICON_HILITE_MARGIN;
-
- /* move the icon */
- XMoveResizeWindow(obt_display, target->win,
- innerx, innery, innerw, innerh);
+ /* have to redraw the targetted icon and last targetted icon
+ * to update the hilite */
+ if (!p->mapped || newtarget == target || p->last_target == target ||
+ last_scroll != p->scroll)
+ {
+ /* row and column start from 0 */
+ const gint row = i / icons_per_row - p->scroll;
+ const gint col = i % icons_per_row;
+ gint iconx, icony;
+ gint list_mode_textx, list_mode_texty;
+ RrAppearance *text;
+
+ /* find the coordinates for the icon */
+ iconx = icons_center_x + l + (col * HILITE_SIZE);
+ icony = t + (showing_arrows ? ob_rr_theme->up_arrow_mask->height
+ + OUTSIDE_BORDER
+ : 0)
+ + (row * MAX(texth, HILITE_SIZE))
+ + MAX(texth - HILITE_SIZE, 0) / 2;
+
+ /* find the dimensions of the text box */
+ list_mode_textx = iconx + HILITE_SIZE + TEXT_BORDER;
+ list_mode_texty = icony;
+
+ /* 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)
+ XMoveResizeWindow(obt_display, target->textwin,
+ list_mode_textx, list_mode_texty,
+ textw, texth);
+
+ /* show/hide the right windows */
+ if (row >= 0 && row < icon_rows) {
+ XMapWindow(obt_display, target->iconwin);
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ XMapWindow(obt_display, target->textwin);
+ else
+ XUnmapWindow(obt_display, target->textwin);
+ } else {
+ XUnmapWindow(obt_display, target->textwin);
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ XUnmapWindow(obt_display, target->iconwin);
+ else
+ XMapWindow(obt_display, target->iconwin);
+ }