Wimp bug, not sure if it’s still in RO5
nemo (145) 2556 posts |
I’ve just had a frustrating time tracking down a bug in the Wimp. I had a window that potentially changed size when clicked in. When clicked, I closed the window, resized it, then reopened it. I can’t remember now why I thought that was a good idea but you would think it was harmless. The close and resize were ok, it was the reopen that triggered the bug. The symptom was that it appeared that the mouse click was registering twice – once to cause the above and then immediately again as a second click. This second phantom click seemed to be triggered by the OpenWindow. I finally worked out what it was. The window’s click type is 6 – ClickDrag. So clicking Select returns 4, and dragging returns 64, but I wasn’t dragging. My code was resizing the window to be one textline shorter, and the pointer was at the bottom of the window, so the result of the resize is that the pointer would now be over the horizontal scrollbar. This seems to fool the Wimp into thinking the pointer has moved (from inside to outside the window), and hence must have been a drag, so it immediately returns with a click type of 64. Edit: Yes, the bug is present in RO5. |
Matthew Phillips (473) 721 posts |
I think you can get the same effect when a click causes the application to report an error, because the mouse moves to inside the error box. You get it after the user has responded to the error and the box has disappeared. We have code in our library to suppress response to this spurious event. That probably means we’ll never spot when the problem is finally fixed. |
André Timmermans (100) 655 posts |
There are all sorts of funny things in the Wimp with regard to mouse handling. Some I remember of hands are: |
Rick Murray (539) 13850 posts |
I wonder how the Filer used to handle that? It steals the focus now, since there are potential keypresses… but did it always claim focus?
Yeah, the Wimp is missing quite a number of event messages. There’s no notification, for example…
There are Service Calls and such, but we’re talking about USER mode Wimp applications so they’d need messages rather than being expected to try to hook into the OS (surely that’s the Wimp’s job?). <thinking type = “out loud”> Territory makes a Service Call (&81080) when changing the offset due to entering/leaving summer time, or manual changes to timezone or DST setting. Simplest way to detect a USB drive (rather than trying to work out USB descriptors) is to simply look out for FS starting/dying. It’ll catch RAMFS too, but that may not be a bad thing. It doesn't appear to be possible to get into the *Close process to determine what file handles are actually closed. It looks like it just cycles through the open handles closing them.
Strange – surely pretty much every “OK” or “Cancel” button will cause the window to close in a way that isn’t the close icon? |
Stuart Painting (5389) 714 posts |
Reminds me of a mouse-related oddity I spotted some time ago. I had one icon partially obscuring another icon: clicking on the first icon removed it, fully revealing the other icon underneath (yes it was a remove-the-tiles game). Clicking again without moving the mouse would now generate two events: one for the mouse click on the now-revealed icon, the other was for a mouse click on the icon that used to be there. Move the mouse between clicks and there would only be one event (for the now-revealed icon). |
Steve Pampling (1551) 8172 posts |
There’s no notification, for example… and yet very recently added to the documentation on line List of nonsensical functionality When I read that I thought of the USB device change that people have complained isn’t detected while whereas Sprow is highlighting that the OS does detect device changes but doesn’t let you know. |
Sprow (202) 1158 posts |
Say what now? I didn’t write that paragraph. Also, I edited a different part of the page recently (to remove the old touchscreen reference). And for extra puzzlement RISCOS_AddDevice refers to HAL devices which are not even slightly related to plugging in USB devices. I’m going for a lie down… |
Rick Murray (539) 13850 posts |
Yeah… You might want to go back and reread my message. :-) I’m talking about Wimp Message notifications to user mode and multitasked applications so they can be notified of various system wide events that would otherwise require lots of little (application specific) modules to be loaded to hook into the appropriate events or service calls. The reason that I picked those specific things is because they seem as natural to me as notifying when the screen mode changes. I would have added “internet is connected/disconnected” but I’m not sure that this is propagated from the ether driver; though come days of WiFi it may be essential to know the connection status…? |
Andrew Conroy (370) 740 posts |
There is a “Cable has been unplugged” type notification you can get if you keep polling the Ether_whatever module and looking at a certain bit. However what you look at and which bit is covered by an NDA if you want to read the official docs! I would hope that by the time we get to wifi support that a proper wimp message will be assigned and it will do it for you, no need to sign NDAs and write your own code! |
Steve Pampling (1551) 8172 posts |
Hackcherly I’d just like to get some uninterrupted sleep – finishing a week long stint on call at 8am tomorrow and the list of sillies1 in the past week is assisted by a cat that thinks I exist for fuss at 5am. Let’s just forget I commented shall we? 1 “It’s a network problem ICT are aware of” actually it was a lack of power into their kit due to a pulled lead. |
Rick Murray (539) 13850 posts |
Nah, it’s fine. Gave me some time to think of the sorts of events that an application might be interested in that the Wimp ought to be providing. And, besides, my nose would be a foot long if I tried to claim that I never grabbed the wrong end of the stick. ;-)
Is it only certain EtherX drivers that provide this information, or all of them? Because it rather takes the p*** if one needs to sign an NDA to get information on the behaviour of an open source module. |
Rick Murray (539) 13850 posts |