-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait cursor often survives long-running operation #1154
Comments
I think this is 99% certain to be an external bug, presumably in VMWare Fusion. For further details see my comments in #1155. |
The problem has been reproduced on a bare-metal Windows install so it is not due to VMware Fusion. In order for the |
See the following for the problem: Dolphin_cursor.mp4 |
Well my comments about the circumstances under which this can occur still stand, i.e. it can only really be the case that a cursor will persist if:
The cursor is never reset (i.e. the windows API is not called again), but that doesn't matter. Windows will just change it back unless the WM_SETCURSOR query is setting something different. So essentially this is not a likely explanation, but brings us on to (2), a much more likely cause. A possible scenario by which the global Current.Cursor state could end up left as the wait cursor is as follows:
This can be simulated by evaluating:
If I do this, however, what I see still doesn't look like your video as the Cursor doesn't change back over any of the Dolphin windows, except the scintilla controls where it flickers between the ibeam and wait, and the splitters. To restore sanity:
Maybe the framework does something like this, but it seems unlikely given that this probably hasn't been changed in more than 20 years. It is possible of course, but seems very unlikely that such a bug could exist for such a long time without being reported before. I can't reproduce it by following your steps either. Without a repro, there is not much more I can suggest other than inserting some diagnostic tracing into the onGetCursor handling so see what cursor is being set as the mouse moves. You can try inspecting the messages using Spy++ from the VS2019 tools menu too. If dumping to the Transcript is too slow, try using running under the VS debugger and dumping to a In your video are you running with a debug VM? The UI seems very slow. Also what exactly do you mean by a bare metal Windows install (what version of Windows, what hardware)? |
As background, this old Raymond Chen blog post is useful in understanding how the cursor setting process works in Windows and why the class cursor will override any previously set cursor if default processing happens: What is the process by which the cursor gets set? It is fairly easy to relate this to the code in the MVP framework. |
The video is me running non-debug Dolphin (but in VMware Fusion on a 2012 machine with a screen recorder and some other software running), so it might not be very snappy. By "bare metal" I mean without virtualization (so no VMware Fusion to suspect of distorting things). I observed the problem on a student's machine and I've asked for hardware/software details. In my case I'm running Windows 10 21H2 (but the problem is long-standing). To further add to the mystery, I've added logging to everything that changes the cursor and at the end of a #'showWhile:' change after it calls the library to restore the original cursor I follow it with a 1-second delay and then query the OS library for the current cursor. It claims to be showing the arrow when it is actually the busy cursor that is visible. As far as I can tell (with lots of debugging and logging), all the showWhile: calls are properly nested and Cursor.Current is properly I wonder if the failure to display the package tree is related. It feels a bit like we lost a redraw after an invalidate in each case (though the two are not linked one-to-one). Do you ever experience the failure to redraw a tree (then redraws line-at-a-time as the mouse moves over the item)? |
That's interesting I assume you are saying that when you evaluate Coming back to what you see, assuming that the handling of the I did have an idea of something you could try. Looking at
I think the code has always been like that in every released version of Dolphin, but it did set me wondering about the lifetime of and ownership of the returned cursor handle. The GetCursor documentation says nothing on this, and obviously the code above is depending on it remaining valid, but also assuming ownership is not returned. The system cursors are owned by the system and remain valid throughout the application's life, so it's difficult to see how this would be causing problems but you could try simplifying it to this for elimination purposes:
Can you explain what you mean by fail here? There isn't really a notion of a correct or persistent cursor as such. It's continually updated as the mouse moves, and although
Yes, I am able to repro that easily, at least inside the IdeaSpace. It doesn't happen to me otherwise, or not that I have noticed so far. I don't think this is related though, but is rather a separate issue altogether. I don't know its vintage, but it could have started happening due to a change in Windows, or a framework change. We'd have to try going back to older Dolphin versions (starting with 7.x) to see if it repro's there, and then try and narrow down the change if it doesn't. It is probably caused by the sliding card tray (aka SlideyInneyOuteyThing), in combination with the rather complicated way the IdeaSpace nests ShellViews inside itself. I've always been surprised that worked as ShellView's are designed to be top-level windows, not child windows. It seems to occur in this and other tree views (and only tree views as far as I can tell) that are in pinned sliding card trays inside an IdeaSpace. It looks like some kind of z-order bug, as if you look closely the tree does get drawn, and then immediately overpainted with the background colour of one of the parent views (could be from the idea space itself, since it has a |
Blair, I very much appreciate your responses on this. Tonight I spent some time trying to follow-up on your suggested areas of investigation. I'm particularly intrigued by the idea of the handles getting mixed up. It does seem unlikely, but there are few remaining plausible explanations, so any idea is worth investigating. Interestingly, I was unable to reproduce the problem tonight, but I'll try to answer your questions:
Yes, the handles I've had consistently are as follows:
My observation is that the GUI shows cursor #7 when it claims to be showing #3. I hadn't thought to inspect the result of a
Sorry for the ambiguity and thanks again for your patience and questions. This refers to code I've added at the end of #'showWhile:' to make a second attempt to get the arrow cursor. I've also added background tasks to check if I'll check to see if the And finally (for now!), thanks for the discussion of the package tree drawing problem. I agree that it seems unrelated, but I'm grasping here! I'll follow-up when I'm able to reproduce the problem and add more debugging. |
The ones I get are different, so obviously these are not fixed, even if they are always in the same range.
This suggests that these may be allocated dynamically into some internal array as the cursors are required, but then you'd expect maybe that there ought to be a 16r10000, 16r10001, etc, and if I try
It's kind of a combination of the two. There is an |
I've noticed this frequently and finally took the time to dig into it further. I can reproduce it in my application and now can (often) reproduce it in the Dolphin IDE. I open an IdeaSpace, add two system browsers on Object>>??, then close the second one. At least half the time the busy cursor shows up and never goes away until I move the mouse over something that has a non-default cursor (such as a text field with an I-beam cursor).
The text was updated successfully, but these errors were encountered: