Re: [dev] [dwm] Hide window content when moving/resizing windows
Στις 10/2/21 4:46 μ.μ., ο/η Страхиња Радић έγραψε:
> On 21/02/10 01:10, Κράκ Άουτ wrote:
>> So, looking at your code, can I limit updates to 1/sec instead of
>> 60/sec? Changing this line,
>> `if ((ev.xmotion.time - lasttime) <= (1000 / 60))`
>> to
>> `if ((ev.xmotion.time - lasttime) <= (1000 / 1))`
>> would be enough?
>>
>> Can I also achieve 0/sec somehow? I suggested 1/sec because division by
>> zero is not possible.
>
> I'm not familiar with the context of the quoted code, but it looks like
> if checks for the time difference between the current time and last recorded
> time. The check succeeds if the difference is 1000/60 ~ 17 in the first case and
> 1000 in the second case. As the divisor gets closer to zero, the threshold
> against which the difference is tested becomes greater. As you said, division by
> zero is not possible. The division is there in the first place purely for the
> sake of code clarity, the difference is an integer constant and can be specified
> as just a single number, without the division.
>
> From the purely logical standpoint, "achieving 0/sec" would be
> equivalent to not executing the code in the if-block at all, and would be best
> accomplished by commenting the block out.
>
Hello Страхиња,
You are obviously right regarding 1000/60. But if I understood well,
Hiltjo's commit induced a limit; if it's removed, then dwm will try to
update the fastest possible, faster than 60/sec, taking up more
resources. So if the if-block is removed you get the opposite of 0/sec.
Received on Wed Feb 10 2021 - 19:09:20 CET
This archive was generated by hypermail 2.3.0
: Wed Feb 10 2021 - 19:12:11 CET