Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Issue 160246: Reposition and/or resize window if it becomes off-screen.... (Closed)

Created:
11 years, 5 months ago by Yuzo
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews_googlegroups.com, Ben Goodger (Google), brian
Base URL:
svn://chrome-svn.corp.google.com/chrome/trunk/src/
Visibility:
Public.

Description

Reposition and/or resize window if it becomes off-screen due to monitor configuration change since the last run. BUG=17822 TEST=Use multiple monitors. Start Chrome, move the window to a non-primary monitor, and exit Chrome. Disconnect or disable the monitor and start Chrome again. Chrome should appear at the origin of a remaining monitor. Also try chaning the resolution of the non-primary monitor. As far as the window fits within the monitor, it should be shown as-is. If not, it is moved to the origin and resized, if necessary. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=21946

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 16

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 4

Patch Set 9 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+244 lines, -88 lines) Patch
M chrome/browser/gtk/browser_window_gtk.cc View 2 3 4 3 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/views/chrome_views_delegate.cc View 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/window_sizer.h View 2 3 4 5 6 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/window_sizer.cc View 1 2 3 4 5 6 7 8 5 chunks +47 lines, -5 lines 0 comments Download
M chrome/browser/window_sizer_unittest.cc View 1 2 3 4 5 6 7 39 chunks +167 lines, -82 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Yuzo
Hi, Peter, Can you review this? (I'll be out of office on July 30 & ...
11 years, 5 months ago (2009-07-28 02:37:39 UTC) #1
Peter Kasting
This isn't sufficient to handle the problems Brian was showing me. If he moved a ...
11 years, 5 months ago (2009-07-28 02:40:35 UTC) #2
Yuzo
Thank you for the review. Can you take another look? I've changed the code such ...
11 years, 5 months ago (2009-07-28 09:09:35 UTC) #3
Peter Kasting
You may wonder why below I say to save all monitor rects. Consider the example ...
11 years, 4 months ago (2009-07-28 18:19:34 UTC) #4
Yuzo
Peter, Thank you for the review. As for saving monitor geometry, I think saving the ...
11 years, 4 months ago (2009-07-29 01:56:02 UTC) #5
Yuzo
I forgot to write that this fix is working as expected in my dual monitor ...
11 years, 4 months ago (2009-07-29 02:18:17 UTC) #6
Peter Kasting
On Tue, Jul 28, 2009 at 6:56 PM, <yuzo@chromium.org> wrote: > As for saving monitor ...
11 years, 4 months ago (2009-07-29 03:48:55 UTC) #7
Yuzo
Hi, Peter, Thank you for your comments. I noticed that we should guarantee that the ...
11 years, 4 months ago (2009-07-29 05:32:47 UTC) #8
Peter Kasting
LGTM http://codereview.chromium.org/160246/diff/55/57 File chrome/browser/window_sizer.cc (right): http://codereview.chromium.org/160246/diff/55/57#newcode262 Line 262: // Find the size of the work ...
11 years, 4 months ago (2009-07-29 05:52:52 UTC) #9
Yuzo
11 years, 4 months ago (2009-07-29 06:25:25 UTC) #10
Thank you very much for reviewing this.

I'll submit it after confirming try bots are still happy with it.

Yuzo

http://codereview.chromium.org/160246/diff/55/57
File chrome/browser/window_sizer.cc (right):

http://codereview.chromium.org/160246/diff/55/57#newcode262
Line 262: // Find the size of the work area of the monitor that intersects the
bounds
On 2009/07/29 05:52:52, Peter Kasting wrote:
> Nit: This is subtle, but I think this block and all your added code should
move
> below the "Ensure the minimum height and width" block.  Enlarging the size of
> tiny windows should probably happen before we shift their origins to be more
> visible, rather than after.

Good point. Done.

http://codereview.chromium.org/160246/diff/55/57#newcode268
Line 268: if (bounds->y() < work_area.y()) {
On 2009/07/29 05:52:52, Peter Kasting wrote:
> Nit: no {}.

Oops. Done.

Powered by Google App Engine
This is Rietveld 408576698