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

Re: [PATCH 22 of 22] Fixed inability to focus windows via mouse



> I have not verified that the bug is periodic, so I
> can't be sure that this will fix it. If necessary I can wait for another
> 24 days (or maybe 48) if no downtime happens here, to verify the
> periodicity of the bug and another 24 (or 48) more to check if the fix
> works.

This changelog is outdated. Later on Pedro had no more doubts about
the periodicity and the period (it is 48 days).

See for example this changelog

http://repo.or.cz/w/wmaker-crm.git?a=commit;h=c91bb1ba1360006c568db37438779e525868cf17

> +static int
> +compareTimes(Time t1, Time t2)
> +{
> +    Time diff;
> +    if (t1 == t2)
> +      return 0;
> +    diff = t1 - t2;
> +    return (diff < 60000) ? 1 : -1;
> +}

I think it is better to drop this function entirely and use the
second version proposed by Pedro, where we avoid making a function call
and the below is changed to

> -    if (scr->flags.ignore_focus_events || LastFocusChange > timestamp)
> +    if (scr->flags.ignore_focus_events || compareTimes(LastFocusChange, timestamp) > 0)
                                             (LastFocusChange - timestamp) < 60000

Or even better (to avoid having magic numbers floating around)

#define MAX_TIME_DIFF 60000 /* 60 seconds */

and use (LastFocusChange - timestamp) < MAX_TIME_DIFF

instead (or maybe some other name for the #define, I am bad with names)



-- 
To unsubscribe, send mail to wmaker-dev-unsubscribe@lists.windowmaker.info.