Skip to content
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

Worked perfectly first after adding (before restart) - after seems 50% chance to work or not. #35

Open
AtmaDarkwolf opened this issue Oct 31, 2020 · 7 comments

Comments

@AtmaDarkwolf
Copy link

After reboot, WinReDock loads as expected, but after screen display sleeps, seems random if it bothers working or not (Sometimes it does, other times windows shifts all open windows to left monitor.)

I cannot understand why it would work some of the time but not other times. (Also now and then, when I wake monitors, some, but not all, of the windows I had on right monitor would move back to left, but others were in expected spots)

@manutalcual
Copy link
Owner

manutalcual commented Nov 2, 2020

Hi,

Thanks for noticing this! It's true it has pitfalls.

In your particular case I have to say that I didn't thought in testing it when the screen sleeps. I'll give it some hours of work when I have time. At least now I have access to a Windows machine!

(TL;DR) There are cases where I can't move windows.

I've had the same issue with some windows not changing position. I've seen some situations in which Winredock will not move windows: windows change without your knowledge while running (1), Winredock hasn't rights to move that window (2), the window belongs to an AppFrame and isn't detected by Winredock or doesn't have permission to move (3).

1.- some applications will not only redraw their window, but change it completely when there is a screen resolution change (just in case it needs to adjust widgets/controls size or positions). Winredock keeps track of windows by their window handler (HWND), but sometimes, an app may create a whole new window when resolution changes, that new window has a new HWND, and when going back the the original screen resolution it will have another HWND so it is almost impossible to keep windows information (with the time I have to investigate this, this doesn't pay my bills nor put food for my kids on the table)

2.- in some cases, windows just can't be moved by an app with "standard" rights (i.e. TaskManager),

3.- there are more and more apps that work under some artifact I didn't investigated yet, that keeps windows under an "ApplicationFrame" umbrella that I can't control. I didn't have time to investigate this but for now I can't do anything with those windows.

Again, thanks!

@AtmaDarkwolf
Copy link
Author

if it helps with research on this, its partly cuz 1 monitor is DP and one is HDMI, and (without WinReDock) all open windows will move to the same relative position on the left monitor(DP, main), partly due to the gpu 'turning off' the port to both monitors (I can hear the pc 'disconnect' then reconnect sound when I wake monitors back up)

Does so even when I have it set to 'go to lock screen' (IE need to relog back in)

The (so far anyways) programs I find most affected by it is steam (small mode, friends list, and chat windows) some, or all do not move back to main screen (always at least 1 of the 3 steam based windows is stuck on left monitor) and rarely discord will move back over, but it remembers position of windows explorer windows, and most of the time keeps firefox windows where they were (have 2 windows with multiple tabs open, one on each monitor)

Regardless of issues, thank you for this app, it has (even if only partly) solved an issue windows has had since before windows 7 (Which was easily fixed with reg-edits until win10)

@bfeist
Copy link

bfeist commented Feb 13, 2021

Thanks for the great piece of software.
Like these other posts, I'm experiencing the same thing. Hit or miss whether winredock will do its thing.

This app is a life saver. I hope you're able to solve this issue. Thanks again.

@manutalcual
Copy link
Owner

Hi,

Thanks for your kind words man!!

TL;DR Some windows can be rescaled, some can't because they handle that themselves. Winredoc doesn't knows who rescales and who don't, so we don't rescale as doing nothing keeps everything viewable and working (even on the wrong screen) and rescaling an already scaled window makes it unmanageable and unviewable (on every screen.)

I've been investigating this DPI problem (and tool windows, read below) and found that it doesn't have a solution (I can found) because of how the DPI is managed.
May be that's why Windows itself isn't implementing this.
The problem is because applications handle DPI changes is several ways: ignoring it (then Windows will rescale the application content like if they were images), the application taking care of the DPI change event and changing its size (but not rescaling the app drawings) and the app taking the DPI change event and rescaling some or all of its drawings.
Rescaling the drawings means not only to resize and reposition "controls" (buttons, images, lists, etc.), but also the image that forms the "control" itself.
Due to this fact, and to the fact that no one else can know if the app rescaled everything needed, Winredoc can't scale the windows because they may become "unviewable" (images that form the "controls" become highly distorted.) (e.g. font too smal to read, minimize, maximize and/or other button icons being huge, but very very HUGE in screen, to the point it takes a 1/4 of screen.)

I've tried everything.

In one moment I thought I have it, but I discovered Visual Studio was rescaling everything twice: one because of Windows DPI change event and another one because Winredoc was either, rescaling the window or sending the rescale event again.

As for (those small mode, friends list, and chat) tool windows... it is the same pain, there are windows that are "visible" (in terms of internal programming) and those that don't. Winredock can't move tool windows that are not "registered" as true windows (there are several way to register windows in a system.)

I guess we have to wait until every app modernizes and handles the rescaling themselves and there is only ONE way to do it.
AND I'm pretty sure Microsoft will then make Windows reposition the windows much better than me.

@bfeist
Copy link

bfeist commented Feb 14, 2021

For what it's worth, I've turned to trying other things and found that DisplayFusion Pro is able to rearrange all windows into a arrangement that the user saves, and it works every time. In this app I have to use a bound key combination to reset the view. Maybe you could figure out how they're doing it and implement that? I would much rather have it happen automatically as winredock does it without all of the unneeded extra features (and price) of DisplayFusion.

@manutalcual
Copy link
Owner

Hmm.

I don't quite understand what DF does. It saves one "windows position configuration" and restores it when key combination is pressed?
If so, they don't have to handle DPI at all. They change positions after the DPI change. Winredock moves windows at the moment of the screen resolution change, most times (but not all) just before the app receiving the DPI change.
It is very hard to get this well as there are several ways to get the window position/size depending on several factors (physical screen, extended desktop, virtual desktop, DPI changes, etc.)
I'm just thinking I'm going to put a small delay before changing window positions to see if they get the DPI change before I move them and see if it works better.

I'll continue to investigate a bit, but sincerely, I don't use Ms Windows myself, I use Linux.
And DisplayFusion gets money for their investigation, something I do not.

@bfeist
Copy link

bfeist commented Feb 15, 2021

Yes, it saves all window locations into a "profile" and then restores that when you command it to. Here's a screenshot of one of my window profiles in case you find it useful. (I'm using dual 4k monitors at 1:1 scaling)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants