static RrAppearance *a_focus_indicator;
static RrColor *color_white;
+static gboolean visible;
static Window create_window(Window parent, gulong mask,
XSetWindowAttributes *attrib)
return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0,
RrDepth(ob_rr_inst), InputOutput,
RrVisual(ob_rr_inst), mask, attrib);
-
+
}
void focus_cycle_indicator_startup(gboolean reconfig)
{
XSetWindowAttributes attr;
+ visible = FALSE;
+
if (reconfig) return;
focus_indicator.top.obwin.type = Window_Internal;
stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.left));
stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right));
stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom));
+ g_hash_table_insert(window_map, &focus_indicator.top.win,
+ &focus_indicator.top);
+ g_hash_table_insert(window_map, &focus_indicator.left.win,
+ &focus_indicator.left);
+ g_hash_table_insert(window_map, &focus_indicator.right.win,
+ &focus_indicator.right);
+ g_hash_table_insert(window_map, &focus_indicator.bottom.win,
+ &focus_indicator.bottom);
color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff);
RrAppearanceFree(a_focus_indicator);
+ g_hash_table_remove(window_map, &focus_indicator.top.win);
+ g_hash_table_remove(window_map, &focus_indicator.left.win);
+ g_hash_table_remove(window_map, &focus_indicator.right.win);
+ g_hash_table_remove(window_map, &focus_indicator.bottom.win);
+
+ stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.top));
+ stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.left));
+ stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.right));
+ stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.bottom));
+
XDestroyWindow(ob_display, focus_indicator.top.win);
XDestroyWindow(ob_display, focus_indicator.left.win);
XDestroyWindow(ob_display, focus_indicator.right.win);
void focus_cycle_draw_indicator(ObClient *c)
{
- if (!c) {
+ if (!c && visible) {
+ gulong ignore_start;
+
+ /* kill enter events cause by this unmapping */
+ ignore_start = event_start_ignore_all_enters();
+
XUnmapWindow(ob_display, focus_indicator.top.win);
XUnmapWindow(ob_display, focus_indicator.left.win);
XUnmapWindow(ob_display, focus_indicator.right.win);
XUnmapWindow(ob_display, focus_indicator.bottom.win);
- /* kill enter events cause by this unmapping */
- event_ignore_all_queued_enters();
- } else {
+ event_end_ignore_all_enters(ignore_start);
+
+ visible = FALSE;
+ }
+ else if (c) {
/*
if (c)
frame_adjust_focus(c->frame, FALSE);
RrPaint(a_focus_indicator, focus_indicator.top.win,
w, h);
- x = c->area.x;
+ x = c->frame->area.x;
y = c->frame->area.y;
w = wl;
h = c->frame->area.height;
XMapWindow(ob_display, focus_indicator.left.win);
XMapWindow(ob_display, focus_indicator.right.win);
XMapWindow(ob_display, focus_indicator.bottom.win);
+
+ visible = TRUE;
}
}