home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
apps
/
text_ed
/
scribe12
/
scrlfix
/
scrolfix.doc
< prev
Wrap
Text File
|
1992-03-24
|
3KB
|
74 lines
SCROLFIX
Desk Accessory (including source code) is
Public Domain, 03/92, by Ian Lepore
Starting with TOS 1.04 (aka 1.4), a system bug causes some windowed
programs to scroll twice when you click once on a window scroller.
Charles Johnson soon released a fix for the problem called BUTTNFIX,
and it worked quite well on most systems. But, a few folks (especially
TT owners) have reported that BUTTNFIX doesn't cure the double-scroll
problem unless you actually open the DA after you've started an
application that uses scrolling windows.
SCROLFIX cures that problem in a purely brute-force manner. When it
receives an AC_CLOSE message (indicating an application has just
started or ended), it waits 3 seconds, then recycles itself through
its main event loop. It's not elegant, but it seems to do the trick,
and it doesn't put any extra performance overhead on your system. (In
fact, SCROLFIX uses a couple hundred bytes less memory than BUTTNFIX.)
All you have to do is copy SCROLFIX.ACC to your boot drive, and then
forget about it after that. It uses about 800 bytes of memory. It
should be perfectly compatible with MultiDesk and the like, but of
course it won't fix the scroll bug while it's not actively loaded.
Notes for programmers:
If you're writing a program that has scrolling windows, and you want to
eliminate the double-scroll problem without relying on SCROLFIX or
BUTTNFIX being present on the user's system, you're in luck. It seems
that the fix is quite simple: your program just has to wait for a
double-click at least once after it starts. If your main event loop
already includes double-clicks as one of its events to wait for, then
you're all set. If not, just put a piece of code such as the following
in your initialization block, perhaps right after your appl_init():
XMULTI xm;
xm.mflags = MU_BUTTON | MU_TIMER;
xm.mbclicks = 2;
xm.mbmask = 1;
xm.mbstate = 1;
xm.mtlocount = 1;
xm.mthicount = 0;
evnx_multi(&xm);
This just waits for either a double-click or a 1 millisecond timer
event. The double-click is unlikely to happen during program startup,
so the timer event ensures that you get control back right away. So
far, this seems to be a pretty foolproof method. As long as your
program has waited for a d-click at least once, it won't get bitten
by the double-scroll bug.
Release of rights:
This DA and the source code is in the public domain, do with it what
you please. When you redistribute this, I'd prefer that you keep the
DA, source code, and this doc together.
Ian Lepore
moderator, BIX atari.st and c.language conferences
03/92
--------------------------------------------------------
< OK TO PORT >
This information comes from the atari.st conference
on BIX (r), the BYTE Information Exchange.
For additional information about BIX, call 800-227-2983
or 603-924-7681.
---------------------------------------------------------