rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.75k stars 1.05k forks source link

A maximally expanded Window is treated as a full screen, even if it does not cover the desktop. #303

Open ThetaSan opened 3 years ago

ThetaSan commented 3 years ago

Describe the bug Even if I shift the maximally expanded window so that it does not cover the desktop, the wallpaper will not resume playing.

To Reproduce Steps to reproduce the behavior:

  1. Enable "Stop when full screen".
  2. Play Wallpaper.
  3. Expand some Window to the maximum and focus on it.
  4. Move its Window freely.

Expected behavior The wallpaper will resume playing.

Screenshots/Video https://user-images.githubusercontent.com/72636809/107643239-3a6e7880-6cb9-11eb-9a5f-7c0a6bb3a74e.mp4

Desktop (please complete the following information):

Additional context https://github.com/rocksdanister/lively/blob/5d637be864f9ba4562d5cd2fb845cff2acb0c9ff/src/livelywpf/livelywpf/Core/Playback/Playback.cs#L250 This may be solved by detecting the Top and Left Position when in window mode.

example:

const int MAGIC = 10; // Allowable range
// top/left : focused window top/left
// IsWindowMode : check window mode
if( IsWindowMode(fHandle) && Math.Abs(top) <= MAGIC && Math.Abs(left) <= MAGIC ){
 if( NativeMethods.IsZoomed(fHandle) || IsZoomedCustom(fHandle) ) {
 // Pause Process
 }
}

Log file 20210211_223816.txt

rocksdanister commented 3 years ago

Thanks for the detailed report! Yeah I am aware of this, my doubt is how often is this scenario required - usually when a window is maximised/greater than screensize you don't move that window right?

So to keep the algorithm short and performant I skipped it during development, if you can provide some examples of use case then that would help me understand.

ThetaSan commented 3 years ago

In my case, while using the Web Browser, when I try to click on an item on the desktop (e.g. memo.txt), I temporarily shift the Window.

It's temporary, but it stops the playback, which bothers me a little.

[Edit] If you are going to implement it, I would suggest disabling it by default in Config to reduce CPU usage.

rocksdanister commented 3 years ago

Hmm okay, I will try to push it next update - since this is a important part of the program will require some testing to make sure every type of games rendering modes and apps are detected properly.

ThetaSan commented 3 years ago

Oh, Thank you! 😄

hichemfantar commented 3 years ago

If maximized windows will no longer be detected as fullscreen then it would be great to add another option for Maximized Windows.

rocksdanister commented 3 years ago

IsZoomed() function is maximized checking: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iszoomed When you drag a window its no longer maximized.

What this issue is actually about is IsZoomedCustom() function I wrote which checks if window size is >=95% its current display size.. this is to deal with certain games and programs that go fullscreen without maximize flag set.

I do plan to deal with the black screen when web wallpaper is paused https://github.com/rocksdanister/lively/issues/20 at some point.. this might not be a huge issue then.

daephx commented 3 years ago

Came here looking for any open issues regarding this. With a multi-monitor setup and an older GPU I like to have all wallpapers pause when loading a game of course. however, with the setting Display Pause Rule: "All screens". the application counts maximized (not fullscreen) windows and causes my peripheral monitors to pause black whenever I bring something like chrome into focus. As of now I am dealing with it by setting custom application rules ["chrome.exe", "code.exe"] set to "Do Nothing". I hope you can figure something out. Thanks.

Perhaps maximized windows could have a separate pause rule for the active monitor? While fullscreen apps such as games could retain the "All screens" rule; so that there isn't unnecessary rending behind maximized windows.

SZKAMAN commented 1 year ago

Came here looking for this exact issue. My situation is that I like to run an app called Peekthrough, which lets you set any window to semitransparent so you can see the wallpaper or another window behind the active window. Its very hand to shift gaze between foreground and background rather than toggling back and forth or squeezing windows side by side. BUT, when the window is maximized or even close to covering the full wallpaper, the wallpaper image freezes. I read that there were concerns about interference with full screen apps like games. I play a little with rainmeter, and i know they have a "game mode" not to encourage code-poaching, but there might be a similar solution here. Thank you for your time @rocksdanister , and all your effort in this project. I've been looking for a way to animate wallpaper for years, and lively answered my prayers!