[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Double Window Borders



On Sun, Jul 22, 2012 at 11:06:19PM +0200, Bastien Dejean wrote:
> Thorsten Wißmann:
> 
> > There are some formal things I don't like about the current patch, the
> > code itself works as expected.
> 
> I fixed the issues you mentioned and I also fixed a bug in
> window_focus:
> 
> The window_unfocus function was called two times:
> - First on the previous window (that's fine) .
> - Then on the window to be focus (not good!).
> Hence the border blinking.

That produced other problems:

  - When cycling through the windows using the cycle command the focus
    cycles but no window border is marked as focused. It is caused by
    that, because your version only resets the border color on the
    second call of window_focus, and frame_current_cycle_selection()
    only calls it once:

>  void window_focus(Window window) {
> [...]
> -    // change window-colors
> -    XSetWindowBorder(g_display, window, g_window_border_active_color);
>      // set keyboardfocus
>      XSetInputFocus(g_display, window, RevertToPointerRoot, CurrentTime);
> +
>      if (window != lastfocus) {
> [...]
> +    } else {
> +        // change window-colors
> +        HSDebug("window_focus ACTIVE\n");
> +        window_update_border(window, g_window_border_active_color);
>      }

  - When toggling the double_window_border setting, then only the border
    of the focused window is updated; same thing when changing
    window_border_inner_color

> I commented out most of client_setup_border as it was setting the
> INACTIVE / NORMAL border color that is already taken care of by
> window_focus and window_unfocus, moreover with double_window_border
> enabled, it was a terrible CPU hog.

No you can't, because it is called by client_update_wm_hints() which
reads the urgent flag from the window itself! And it may happen, that a
window itself changes its urgent state to false, and in that case we
have to update the border.

So I suggest to only fix the formal things in the original patch and to
move the "Call window_focus less often" to another patch.

Thorsten

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/