Thread 'Why does the BOINC Manager window move across boots from where I had left it?'

Message boards : BOINC Manager : Why does the BOINC Manager window move across boots from where I had left it?
Message board moderation

To post messages, you must log in.

AuthorMessage
ProfileTuna Ertemalp
Avatar

Send message
Joined: 23 Dec 13
Posts: 45
United States
Message 62031 - Posted: 3 May 2015, 8:33:03 UTC

I nicely layout my BOINC Manager (snapped to left, almost maximized) and Event Log (snapped to right, with minimum width allowed, giving the rest of the screen to the main window) windows under Win 8.1 (but this has been happening in previous versions of BOINC Manager & Windows; I am just getting around to asking about it here). But, every time my machines get rebooted (or, I exit & restart BOINC Manager for whatever reason), the BOINC Manager window forgets where it was, and starts somewhere else. Example:

After I lay them out: http://1drv.ms/1DUKjLU

After I exit & restart the manager: http://1drv.ms/1KDVpK3

Windows apps should remember their exact size & position & [maximized | minimized | restored] state during quitting, and set them to the exact same values upon restart.

Thanks
Tuna
ID: 62031 · Report as offensive
ProfileJord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15565
Netherlands
Message 62036 - Posted: 3 May 2015, 12:00:21 UTC - in response to Message 62031.  

Works as is for me with 7.5.0, through exiting/restarting BOINC and through a reboot. So perhaps something on your Windows doesn't allow BOINC to write its position to the registry.

Although 7.5.0 had work done on its GUI, it did not have work done on how it stores that GUI in the registry. That's still the same as with 7.4.42 and prior.
One caveat, it doesn't work when I put the event log on my second monitor, but that's not something I worry about too much either.
ID: 62036 · Report as offensive
ProfileTuna Ertemalp
Avatar

Send message
Joined: 23 Dec 13
Posts: 45
United States
Message 62038 - Posted: 3 May 2015, 16:13:10 UTC

So, I debugged it. Turns out there is a problem, but only shows up if you drag the left edge of your window all the way to the left, or right edge of the window all the way to the right. The location of the top and bottom edges, and the location of the upper left corner doesn't seem to matter.

Looking at the registry, let's start with BOINC not running, and with these values for position (65,65), width (1800), height (800):

[HKEY_CURRENT_USER\Software\Space Sciences Laboratory, U.C. Berkeley\BOINC Manager]
"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000708
"Height"=dword:00000320
"XPos"=dword:00000041
"YPos"=dword:00000041


If you start BM, these values get respected and don't change when you exit BM. Good.

Now, drag the top or bottom edge all the way to the top or bottom, respectively, which activates the "auto snap" in Windows, and BM snaps vertically to the top and bottom edges of my screen without a change in the horizontal. And exit BM. My registry shows 1800x1050 @ 65x0, which is correct:

"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000708
"Height"=dword:0000041a
"XPos"=dword:00000041
"YPos"=dword:00000000


Booting BM again puts the windows to that position, no problem.

Now... Grab and drag the left edge of the BM window all the way to the left. Don't try to line it up with the edge of your screen or be slow and careful; just grab it and slam-drag it to the left until your mouse pointer can't move anymore, and let go of your mouse. That does not cause any "auto snap" by Windows (8.1 in my case), but (if you look closely) puts the left edge ever so slightly off the screen. Then exit BM, and registry shows something like:

"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000750
"Height"=dword:0000041a
"XPos"=dword:fffffff9
"YPos"=dword:00000000


Ah! Notice the xPos. It is trying to say "-7" but it can also be read as 4294967289, which would be clearly off the screen. In reality, this says the window is 1872x1050 @ -7x0 (1872, because 1800+65+7). Depending on how hard you slam the left edge of the window to the left side of the screen, the number at the end of fffffff might change, by the way. I got values between 9...D.

Now, restart BM. You'll notice that the left edge is not off the screen, but instead there is a gap between the left edges of BM and the screen. Don't change anything and quit BM to get the values written to the registry:

"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000750
"Height"=dword:0000041a
"XPos"=dword:0000001e
"YPos"=dword:00000000


This is 1872x1050 @ 30x0. In other words, BM didn't like 0xFFFFFFF9, and replaced it with a standard 30, shifting the whole window to the right by 37 pixels.

Now, while BM is not running, change the registry back to the 1800x1050 @ 65x0 so that everything is within the screen, start BM, and now slam the right edge of the window to the right edge of the screen which puts the frame a few pixels off the screen. I am trying all this on a single monitor, by the way. Quit BM, look at the registry. Should be something like this (1858x1050 @ 65x0):

"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000742
"Height"=dword:0000041a
"XPos"=dword:00000041
"YPos"=dword:00000000


Now restart & quit BM, look at the registry again:

"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000742
"Height"=dword:0000041a
"XPos"=dword:0000003e
"YPos"=dword:00000000


This is 1858x1050 @ 62x0. Notice how the window shifted left by 3 pixels since BM must have tried to correct for the right edge that was 3 pixels outside of the screen.

So, that is the detailed description of the problem. I believe BM is making these little adjustments with good intentions, so that the BM window somehow doesn't end up outside the screen in a way that the user cannot grab it to move & resize. But, it should be more lenient to accommodate what I am running into by allowing a little bit to be left off the screen in all four directions. For that, BM should know what the window title bar height as well as window border height'n'width are, and allow part of them to be off the screen.

The best way to find those sizes are, strangely, not to call GetSystemMetrics(), but instead use AdjustWindowRect(); you pass in some rect, and it returns to you the window size to accommodate that rect as the client window, and the difference between these two rects tells you everything you want to know about the width and height of title bar and window frame regardless whatever theme the user might be using: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632665(v=vs.85).aspx

By the way, BM stores the position & sizes of many other windows it has into registry, like the event log, and I am guessing they suffer from the same problem during restoring of these values. If the above gets fixed, it should get fixed for all windows.

Thanks
Tuna
ID: 62038 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5129
United Kingdom
Message 62039 - Posted: 3 May 2015, 17:20:18 UTC - in response to Message 62031.  

I nicely layout my BOINC Manager (snapped to left, almost maximized) and Event Log (snapped to right, with minimum width allowed, giving the rest of the screen to the main window) windows under Win 8.1 (but this has been happening in previous versions of BOINC Manager & Windows; I am just getting around to asking about it here). But, every time my machines get rebooted (or, I exit & restart BOINC Manager for whatever reason), the BOINC Manager window forgets where it was, and starts somewhere else.

To achieve a screen layout like that, my starting point (using Windows 7, I don't have 8.1 available to test yet) would be to open both the main Manager window and the Event log, then use Window's "Show windows side by side" tool (right click on task bar and select). That gives two windows of equal width, sharing the entire viewport between them. To obtain the unequal widths, I dragged the left side of the event log as far to the right as it would go, and dragged the right side of the main window to the right until it seemed visually aligned.

With a 1920 x 1200 screen, that led to registry values of

(main)
"WindowIconized"=dword:00000000
"WindowMaximized"=dword:00000000
"Width"=dword:00000529
"Height"=dword:00000488
"XPos"=dword:00000000
"YPos"=dword:00000000

(event log)
"XPos"=dword:00000528
"YPos"=dword:00000000
"Width"=dword:00000258
"Height"=dword:00000488

The combination of (main) XPos 0, and (event log) XPos+width 1920, suggests that something is still trying to use one pixel more than I have, but BOINC seems to be happy and re-opens the two windows both where I left them.

If I move the main Manager window partially off-screen to the left (either by dragging the entire window to the left, or by extending the left border as far as it can go), BOINC does resize/reposition it on startup so that the entire window is visible - and visible on the primary monitor, if you're using dual monitors.

It also sets XPos 30 pixels in from the edge: I think this is sometimes done by Windows progammers to ensure that important elements like the Control box and File menu aren't obscured by the task bar, if the user happens to prefer the task bar docked left. That appears not to be a risk with Windows 7, which doesn't seem to permit a window to extend behind the taskbar under any circumstances, but it was certainly possible with older versions.

Having tried to program some of these features myself when I was an early adopter of multiple monitors under Windows 98, I can tell you that it's b****y difficult to account for all permutations without ever losing a window to a position where it can't be dragged back fully onscreen. And Windows 7 doesn't have a Move function (correction: it does on 'Shift right-click'. How many people have found that?).

So, on balance, I think the BOINC developers have made a reasonably good stab at adopting a policy which is safe under multiple versions of Windows. And perhaps the major fault is with Microsoft, for not aligning the hard edge when dragging a window border exactly with the edge-of-screen at XPos 0.
ID: 62039 · Report as offensive
ProfileTuna Ertemalp
Avatar

Send message
Joined: 23 Dec 13
Posts: 45
United States
Message 62040 - Posted: 3 May 2015, 23:09:03 UTC - in response to Message 62039.  
Last modified: 3 May 2015, 23:09:49 UTC

To achieve a screen layout like that, my starting point (using Windows 7, I don't have 8.1 available to test yet) would be to open both the main Manager window and the Event log, then use Window's "Show windows side by side" tool (right click on task bar and select). That gives two windows of equal width, sharing the entire viewport between them. To obtain the unequal widths, I dragged the left side of the event log as far to the right as it would go, and dragged the right side of the main window to the right until it seemed visually aligned.


Great suggestion. Never used that method before in so many years... :-)

And Windows 7 doesn't have a Move function (correction: it does on 'Shift right-click'. How many people have found that?).


There is also the ALT+Space to bring the Window System menu, then M to select Move even if you are not able to see it, and then you can use either the mouse or the cursor keys to relocate your window. Yeah, surely intuitive... :-)

So, on balance, I think the BOINC developers have made a reasonably good stab at adopting a policy which is safe under multiple versions of Windows.


Certainly. In the past I had BM windows lost outside the screen for whatever reason, and had to use my ALT+SPACE/M move. Still, I think allowing a window border width/height and, say, half a title bar height tolerance in the calculation would be nice.

And perhaps the major fault is with Microsoft, for not aligning the hard edge when dragging a window border exactly with the edge-of-screen at XPos 0.


Yup, agree. But, with all the shadows "outside" what a human would call a frame sort of blurs the idea of what exactly is the frame for the computer: The line we see, the outline of the drop shadow outside of that line that the computer needs to draw, what? Usability tests show preference for either. If you call the top left corner of the visible frame (0,0), then the corner of shadow/glow/etc. effects becomes negative coordinates. If you were to call that corner (0,0), then the "normal" frame would seem to be inset. With all the fancy drawing styles, you can't win. Hopefully Win10 will have the flat non-3D look, and (0,0) will be (0,0), period...

Tuna
ID: 62040 · Report as offensive

Message boards : BOINC Manager : Why does the BOINC Manager window move across boots from where I had left it?

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.