mIRC Home    About    Download    Register    News    Help

Print Thread
Timers don't trigger if scrolling custom dialog #269532 25/10/21 12:26 AM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Code
dialog testq {
  size -1 -1 200 200
  edit "", 1, 5 5 190 120, read multi vsbar
}
on *:dialog:testq:init:*:var %a 20 | while (%a) { did -a testq 1 line $+ %a $+ $crlf | dec %a } | .timertest 20 1 echo -s $!time

Open the dialog with /dialog -m testq testq and a timer showing the time in status will start.
If you scroll the edit control, the timer stops triggering, which is not expected.
It doesn't happen if you scroll mIRC's window or dialog, only custom dialog.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Timers don't trigger if scrolling custom dialog [Re: Wims] #269534 25/10/21 12:06 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Sorry for that terrible report.

After testing a bit more, this happens with a list control having a lot of element and a vertical scrollbar, not with an editbox. It also only happens when using mouse wheel (or possibly it's way more visible with mouse wheel)

Execute /scrollbug and scroll the list control with the mouse wheel:

Code
alias scrollbug window -pdfo @scrollbug -1 -1 200 200 | dialog -mo testq testq | scrollbug1
alias scrollbug1 var %a 100 | while (%a) { drawrect -fr @scrollbug $r(1,16777215) 0 0 0 200 200 | dec %a } | .timerscrollbug -h 1 0 scrollbug1
on *:close:@scrollbug:.timerscrollbug off | if ($dialog(testq)) dialog -x testq
dialog testq {
  size -1 -1 200 200
  list 1, 5 5 100 160, vsbar
}
on *:dialog:testq:init:*:var %a 20 | while (%a) { did -a testq 1 line $+ %a | dec %a }
on *:dialog:testq:close:*:.timerscrollbug off | window -c @scrollbug
When you use the mouse wheel to scroll the list control in the dialog, the @scrollbug window will stop displaying a random color for a while, with a very long list and depending on the code executed by the timers and other factors, you can end up with no triggering at all.
I'm on windows 7, mouse is logitech M235 and is set up to scroll 3 lines for mouse wheel.

Last edited by Wims; 25/10/21 01:36 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Timers don't trigger if scrolling custom dialog [Re: Wims] #269535 25/10/21 04:41 PM
Joined: Dec 2002
Posts: 5,020
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,020
Thanks for your bug report. If you are referring to the timer slowing down when other windows messages are being received, this is expected behaviour. The /timer command is based on windows timer messages, which are low priority messages. If you are scrolling in a window, mIRC will receive multiple windows messages, prior to receiving any pending timer messages. Only when all other messages have been processed will timer messages be received and processed.

Re: Timers don't trigger if scrolling custom dialog [Re: Khaled] #269536 25/10/21 06:09 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Thanks for the answer, I understand timers don't have high priority but the difference in behavior when you scroll without the mouse wheel is still strange.
It's like there a large amount of windows messages with mouse wheel compared to normal scrolling.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Timers don't trigger if scrolling custom dialog [Re: Wims] #269540 26/10/21 11:17 AM
Joined: Dec 2002
Posts: 5,020
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,020
When I test this here, if my mouse wheel scrolls one click, the listbox scrolls by three lines, which is the system setting. The timer pauses visibly until the listbox scrolling completes and then continues. mIRC does not handle the mouse wheel messages in this case or the scrolling of the listbox - this is handled by the mouse driver which sends scroll messages to the control directly.