-
Notifications
You must be signed in to change notification settings - Fork 8
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
Horrible Flickering #944
Comments
Same for me. Unfortunately, #922 didn't fix #918 for me either. I hadn't had time yet to collect logs and downgraded for now. The two times I ran post #922, things seemed similar to as described in #918. I.e., the flicker got progressively worse over time until Whim eventually freezes (possibly due to #941?). I also noted some issues with the auto-updater ever since it was added that sound similar to the ones documented here. But I usually have it disabled so I hadn't paid much attention. |
I really thought I fixed that - maybe I don't see it as much because I've got
Do you mean that the window you're using, or the focus indicator window? If it is the window you're using, what sort of flickering do you mean?
Sorry yeah that sucks. I've only got Whim running on my dev machine so I haven't actually had the updater running recently. I agree with @urob, you're probably better off just disabling it until I get around to fixing it #728.
I do want to fix this - it's annoying.
This bug is infuriating - there's a call to a Windows API which is just not behaving as it should. Might be a little bit of a rabbit hole. It'll be hard to check if it's fixed because I haven't yet identified a reliable way to reproduce it. I'm also aware that the logs have become too noisy and unhelpful - I'll trim those down soon too. |
Re: logs, what's the most helpful verbosity level? I have them set to DEBUG, which contributes to the noise I imagine. Re: flickering, I'll try running on the latest version again sometime this weekend to get some logs and see if I can spot any pattern. |
I just merged a change which means that My guess for the cause of this flickering is that Whim's core now queues up events on to be triggered to the main thread. This queueing can get backed up (probably the case of #941). As a result, the I intend to fix #941 first and then see if there's an elegant way of getting the focus indicator to only take the last event. I also intend to move up the change of making the focus indicator a real border (#669) because the way it's implemented as another window has sufficiently annoyed me. |
I have some logs: whim20240709.log running on This is right after a restart of Windows. There are only two open windows:
Other than starting Whim, there is no keyboard or mouse interaction for the first 30 or so seconds. The only interaction is in the last 5 or so second to stop Whim. The flickering was notable almost immediately and grew progressively stronger over the 30 seconds. I haven't tried in this session so as to not pollute the logs, but in earlier trials Whim was unresponsive at similar points. |
Adding a screen cast showing the flickering and freezing of Whim. Both the Statusbar and hotkeys didn't seem to do anything while Whim remained frozen. Recording.2024-07-09.162143.mp4Interestingly, both the freezing and flickering stopped as soon as I closed Firefox. I have confirmed this in multiple repeats and every time the flickering starts once I open and focus Firefox and stops once I close Firefox again. I haven't explored long enough yet to see if there are other programs that trigger it (but OP mentions that Timeline in Video
|
I had a go at analyzing the logs posted earlier. Ignoring Chain 1:
Chain 2This chain comes in two variations, differing in whether the first event selects the primary monitor (
The FlickeringBoth chains are often followed and/or interrupted by two types of
Ignoring all such exceptions, the logs consist of alternating events of Here's an excerpt of the cleaned-up log right after Whim completed the initialization. Note how most (To keep the logs clean, I omit the actual
Contrast this with an excerpt after about 30s. Here
Here's the full, clean-up log: debug.log (link to original log: whim20240709.log) The FreezingJust guessing here but it seems that the two event chains somehow seem to be circular, keeping triggering new of the same event chains that eventually overload the system. I tried disabling the |
I've been hunting down why Firefox behaves atypically compared to other windows. There are a few issues I've found (and corroborated with Firefox's source code):
The prior approach was for Whim to retry laying out the window after a timeout. This was not a good solution. My current plan is to add a way to ignore window events for different applications. That would work away some of the atypical events which can occur during operation:
I agree. There was an earlier case where enqueueing lots of callbacks onto the main thread caused a crash. This will be similar. |
Previously, Whim would enqueue a `DoLayout` whenever a window moved. This was done to account for windows doing atypical things, like trying to restore their own position. This worked prior to Whim becoming multi-threaded. Now that it is, this is no longer a viable approach. The `WindowMovedTransform` is triggered many times by Whim. Accordingly, the enqueueing of `DoLayout` similarly is done many times, sometimes overloading the main thread (related issues: #941, #944). This PR allows custom logic for handling events for specific types of windows. `IWindowProcessor` s specify whether to ignore the current Windows event. A `FirefoxWindowProcessor` has been implemented to account for atypical behavior by Firefox during startup.
#957 resolved the flickering for me and I'm finally able to run Whim in multithreaded mode without major issues. 🎉 Tiny observation: While the |
From my investigation, it seemed that this occurred when Firefox was already started before Whim started. I've pushed a fix in #958 so that the custom startup processing logic is ignored if the Firefox window is already open when Whim starts. |
There are still some flickering that I've noticed when Firefox (and I'm assuming other windows) start up for the first time. I've got some changes planned to reduce the amount of events emitted to the focus indicator which should ameliorate the flickering. |
Thanks! That fixed it for me, too. |
Is there an existing issue for this?
Behavior
Buggy since an update or two ago (I think .20).
I keep having to quit out of whim because it's so bad.
Unrelated or older issues:
the update widget thingie always tries to get me to update even when I click 'skip this update' or whatever it says, and also even after I'm already on the newest version.
Sometimes when switching to a workspace, it doesn't show the window content until I drag the window a bit to reset its position (this has always been the case since starting to use Whim). Some programs have this issue more than others - seems to happen quite often with TickTick for example.
Config
Environment
Steps To Reproduce
The flickering seems to occur most often when I have discord open.
The non flickering issues just happen throughout normal usage with programs which were redirected to certain workspaces. Maybe worth nothing that some of the programs, like TickTick, I have a shell script open on startup. Could have something to do with it.
Anything else?
No response
The text was updated successfully, but these errors were encountered: