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

Issue 21268: Solved 2 bugs which caused Chrome to maximize itself when... (Closed)

Created:
11 years, 10 months ago by idanan
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Solved 2 bugs which caused Chrome to maximize itself whendouble clicking, either on the new tab button, on the closetab button or on a single tab.BUG=2827 BUG=3787 The problem comes from the Windows event sequence upon adouble-click (simplified here):1 - hit-test2 - mouse-down4 - mouse-up/click5 - hit-test6 - mouse down7 - mouse up/double-clickThe 1st hit-test is always performed correctly, returningclient for tabs and non-client for the tab-strip (background).The 2nd hit test is not performed correctly to avoid crashesin Chromebot from events being processed while tabs are animating.Since we have no record of these crashes, Ben prefers we keepthis special-case, even though we are responding incorrectlyto the windows hit-test. So, when the tabs are animating wereturn a HTNOWHERE hit which the caller translates into anHTCAPTION hit. This even though a tab-control (new-tab/close-tab)may have been hit.The problem is that having returned HTCAPTION to Windows defaultmessage handling, we get a NON-CLIENT double-click event insteadof a standard one.To keep the behavior of the second hit-test AND prevent theChrome window from maximizing, this change simply declaresthe non-client double-click as handled when the tabs areanimating.Another trick we pulled in the hit-test is to return HTCAPTIONwhen a single tab is present. This allows the entire window to be dragged but causes the context menu to be wrong and the windowto maximize when double clicking on the single tab.The solution here is to correct return a client hit for a singletab and, upon handling a client single-click, delegate to thenon-client single-click default handler. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=9953

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 9

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -42 lines) Patch
M chrome/browser/views/tabs/tab.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/views/tabs/tab.cc View 1 2 3 1 chunk +6 lines, -1 line 2 comments Download
M chrome/browser/views/tabs/tab_strip.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/views/tabs/tab_strip.cc View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/views/custom_frame_window.h View 1 3 1 chunk +0 lines, -1 line 0 comments Download
M chrome/views/custom_frame_window.cc View 1 2 3 2 chunks +1 line, -16 lines 0 comments Download
M chrome/views/event.h View 2 3 1 chunk +4 lines, -1 line 0 comments Download
M chrome/views/root_view.cc View 2 3 4 chunks +26 lines, -2 lines 0 comments Download
M chrome/views/view.cc View 3 1 chunk +2 lines, -1 line 4 comments Download
M chrome/views/widget_win.h View 2 3 1 chunk +4 lines, -1 line 0 comments Download
M chrome/views/widget_win.cc View 2 3 9 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
idanan
Peter, I put you as a reviewer because I don't know any better ;) but ...
11 years, 10 months ago (2009-02-11 22:19:59 UTC) #1
Peter Kasting
I don't understand the sentence "The 2nd hit test is not performed correctly to avoid ...
11 years, 10 months ago (2009-02-11 22:27:39 UTC) #2
Peter Kasting
(Note: please reply on Rietveld since it doesn't scrape your emails) It sounds to me ...
11 years, 10 months ago (2009-02-12 17:46:03 UTC) #3
idanan
As I said earlier, I agree that fixing the hit-test to return the correct answer ...
11 years, 10 months ago (2009-02-12 19:25:31 UTC) #4
Peter Kasting
> Since Ben was leery of that change, you'll have to > negotiate with him ...
11 years, 10 months ago (2009-02-12 19:46:43 UTC) #5
idanan
> Please file a bug (and optionally submit a patch there, if you have it ...
11 years, 10 months ago (2009-02-13 03:31:59 UTC) #6
idanan
11 years, 10 months ago (2009-02-13 03:32:14 UTC) #7
Peter Kasting
The idea of manually sending a WM_NCLBUTTONDOWN had not occurred to me... I had assumed ...
11 years, 10 months ago (2009-02-13 19:44:57 UTC) #8
idanan
On 2009/02/13 19:44:57, pkasting wrote: > The idea of manually sending a WM_NCLBUTTONDOWN had not ...
11 years, 10 months ago (2009-02-17 20:18:35 UTC) #9
idanan
11 years, 10 months ago (2009-02-17 20:19:30 UTC) #10
Peter Kasting
On 2009/02/17 20:18:35, idanan wrote: > > http://codereview.chromium.org/21268/diff/36/1008 > > File chrome/browser/views/tabs/tab.cc (right): > > ...
11 years, 10 months ago (2009-02-18 06:17:34 UTC) #11
idanan
On 2009/02/18 06:17:34, pkasting wrote: > On 2009/02/17 20:18:35, idanan wrote: > > > http://codereview.chromium.org/21268/diff/36/1008 ...
11 years, 10 months ago (2009-02-18 15:40:13 UTC) #12
Peter Kasting
LGTM. http://codereview.chromium.org/21268/diff/2001/3002 File chrome/browser/views/tabs/tab.cc (right): http://codereview.chromium.org/21268/diff/2001/3002#newcode163 Line 163: SendMessage(GetWidget()->GetHWND(), WM_NCLBUTTONDOWN, Nit: Please add a comment ...
11 years, 10 months ago (2009-02-18 16:58:24 UTC) #13
idanan
Thanks for all the feedback Peter! http://codereview.chromium.org/21268/diff/2001/3002 File chrome/browser/views/tabs/tab.cc (right): http://codereview.chromium.org/21268/diff/2001/3002#newcode163 Line 163: SendMessage(GetWidget()->GetHWND(), WM_NCLBUTTONDOWN, ...
11 years, 10 months ago (2009-02-18 18:02:22 UTC) #14
Peter Kasting
http://codereview.chromium.org/21268/diff/2001/3009 File chrome/views/view.cc (right): http://codereview.chromium.org/21268/diff/2001/3009#newcode456 Line 456: if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location())) On 2009/02/18 ...
11 years, 10 months ago (2009-02-18 18:04:30 UTC) #15
idanan
11 years, 10 months ago (2009-02-18 18:12:25 UTC) #16
http://codereview.chromium.org/21268/diff/2001/3009
File chrome/views/view.cc (right):

http://codereview.chromium.org/21268/diff/2001/3009#newcode456
Line 456: if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location()))
Seems like Windows has some complicated logic there because left-middle works on
my Trackman (but not left-right or middle-right) but on the Thinkpad only
left-drag works (not left-middle or left-right).

Powered by Google App Engine
This is Rietveld 408576698