You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to use SDL_WINDOWEVENT_HIDDEN and SDL_WINDOWEVENT_EXPOSED/SDL_WINDOWEVENT_SHOWN to pause rendering when the background isn't in view, and so save same cycles/battery?
I think it might work during the poll loop watching for the quit event, at a glance.
The text was updated successfully, but these errors were encountered:
Hi,
Maybe you can take a similar approach to what Anipaper does: instead of dealing with SDL2 for this, use X11:
From time to time (in a separate thread or not), get the position of all non-minimized windows and calculate the area (with overlap, the Line Sweep algorithm does this) of all of them: if the occupied area reaches a certain threshold (say, 70% of the entire screen), the program pauses, otherwise resumes execution.
The main idea is that if the wallpaper is only partially visible (either through multiple windows covering the screen or through a full-screen window), the wallpaper does not need to be animated.
You can check the polling thread here and the calculation of the area used here.
Sorry to bother you on a relatively old issue, but I like paperview a lot, so I feel obligated to say something when I have something to contribute.
Anyway, paperview's performance is already amazing as it is, so I don't know if it's worth adding more complexity to the code.
Would it be possible to use
SDL_WINDOWEVENT_HIDDEN
andSDL_WINDOWEVENT_EXPOSED
/SDL_WINDOWEVENT_SHOWN
to pause rendering when the background isn't in view, and so save same cycles/battery?I think it might work during the poll loop watching for the quit event, at a glance.
The text was updated successfully, but these errors were encountered: