X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus_cycle_indicator.c;h=495a72305be16d2d86d1fe738e4015b2e13b46eb;hb=a0a9b0334b32e205da994b0395af1b544888a5dd;hp=2242b3d3d9e276bda481c65e2b473ed2604972d6;hpb=29637976e6aecf45bae84ba9ce3ecb26635012f7;p=chaz%2Fopenbox diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 2242b3d3..495a7230 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -59,38 +59,38 @@ void focus_cycle_indicator_startup(gboolean reconfig) if (reconfig) return; - focus_indicator.top.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.left.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.right.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.bottom.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; + focus_indicator.top.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.left.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.right.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.bottom.type = OB_WINDOW_CLASS_INTERNAL; attr.override_redirect = True; attr.background_pixel = BlackPixel(obt_display, ob_screen); focus_indicator.top.window = - create_window(RootWindow(obt_display, ob_screen), + create_window(obt_root(ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.left.window = - create_window(RootWindow(obt_display, ob_screen), + create_window(obt_root(ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.right.window = - create_window(RootWindow(obt_display, ob_screen), + create_window(obt_root(ob_screen), CWOverrideRedirect | CWBackPixel, &attr); focus_indicator.bottom.window = - create_window(RootWindow(obt_display, ob_screen), + create_window(obt_root(ob_screen), CWOverrideRedirect | CWBackPixel, &attr); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.top)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.left)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom)); window_add(&focus_indicator.top.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); + INTERNAL_AS_WINDOW(&focus_indicator.top)); window_add(&focus_indicator.left.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); + INTERNAL_AS_WINDOW(&focus_indicator.left)); window_add(&focus_indicator.right.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); + INTERNAL_AS_WINDOW(&focus_indicator.right)); window_add(&focus_indicator.bottom.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + INTERNAL_AS_WINDOW(&focus_indicator.bottom)); color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff); @@ -122,10 +122,10 @@ void focus_cycle_indicator_shutdown(gboolean reconfig) window_remove(focus_indicator.right.window); window_remove(focus_indicator.bottom.window); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + 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(obt_display, focus_indicator.top.window); XDestroyWindow(obt_display, focus_indicator.left.window); @@ -158,6 +158,7 @@ void focus_cycle_draw_indicator(ObClient *c) */ gint x, y, w, h; gint wt, wl, wr, wb; + gulong ignore_start; wt = wl = wr = wb = FOCUS_INDICATOR_WIDTH; @@ -166,6 +167,9 @@ void focus_cycle_draw_indicator(ObClient *c) w = c->frame->area.width; h = wt; + /* kill enter events cause by this moving */ + ignore_start = event_start_ignore_all_enters(); + XMoveResizeWindow(obt_display, focus_indicator.top.window, x, y, w, h); a_focus_indicator->texture[0].data.lineart.x1 = 0; @@ -270,6 +274,8 @@ void focus_cycle_draw_indicator(ObClient *c) XMapWindow(obt_display, focus_indicator.right.window); XMapWindow(obt_display, focus_indicator.bottom.window); + event_end_ignore_all_enters(ignore_start); + visible = TRUE; } }