-
Notifications
You must be signed in to change notification settings - Fork 614
fixes initial placement, move and size issues #498
Conversation
void cef_host_window::NotifyWindowMovedOrResized() | ||
{ | ||
if (GetBrowser() && GetBrowser()->GetHost()) { | ||
GetBrowser()->GetHost()->NotifyMoveOrResizeStarted(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling this was something that needed to be added whenever the app is moved or resized
@redmunds do you mind taking a look when you have time? Thanks! |
Found a weird case:
Results: Then, if I Restore Brackets window size it switches back to secondary monitor! |
hmmmm...That is weird indeed. Not only that but it restores back to the secondary monitor which then maximizes back on the secondary monitor. |
Verified that this case is now fixed. I also notice that Brackets window is moved from secondary monitor if it's disconnected while Brackets is running! Sweet. |
I noticed another case:
Results: Expected Not sure if this is worth fixing. |
// to the default window placement | ||
left = CW_USEDEFAULT; | ||
top = CW_USEDEFAULT; | ||
width = CW_USEDEFAULT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can original width and height be maintained? i.e. only set left and top to default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this has to work for both the maximized size / placement and the restored size / placement otherwise you run into that odd case so, IMO, it's better to just let the OS decide initial placement and then let the user move it wherever they want.
This eliminates incorrectly computing the placement or placing the window on a secondary monitor (in the case they have more than 2 monitors and disconnect one or rearrange monitors.)
…he restore rect is off-screen
@redmunds regarding the issue you ran into with maximizing, disconnecting the monitor, restarting and clicking the restore button. In this case the Window is using CW_USEDEFAULT which lets Windows decide where to put the restored window. In some cases it's just using the minimum sizes which is 320x200. I could only reproduce this while running in the debugger so I rejiggered the logic so that we just don't set the restored window placement if it's off-screen which forces windows to just use CW_USEDEFAULT (which was passed in during initial window creation). |
@JeffryBooher This looks good on WIndows. Have you verified that this doesn't break Mac build? I upgraded my Mac to Yosemite and can't build Brackets at the moment. |
@redmunds this is only changing Windows project files -- it doesn't affect any cross platform code so I think we're safe on Mac. |
Merging. |
fixes initial placement, move and size issues
fixes initial placement, move and size issues
FIxes the following issues: