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

Issue 2768006: Test + Fix for GTK window resizing when using toolkit views. (Closed)

Created:
10 years, 6 months ago by Scott Byer
Modified:
9 years, 7 months ago
CC:
chromium-reviews, ben+cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Add in a browser test for dialog resizing, which was catching an issue with the way we were using GTK in toolkit views. Possibly related to 27365 or 38785. http://code.google.com/p/chromium-os/issues/detail?id=4126 BUG=chromium-os:4126 TEST=HtmlDialogBrowserTest.SizeWindow Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56919

Patch Set 1 #

Patch Set 2 : Fix lint issues #

Patch Set 3 : Fix where the test source file is included in the gyp file. #

Patch Set 4 : Disable the test on Windows until it can be debugged. #

Total comments: 4

Patch Set 5 : Found a better fix, rework the test to avoid timing issues. #

Total comments: 3

Patch Set 6 : Aha! Figured it out, I think. #

Total comments: 9

Patch Set 7 : Allocation request as property, clean up unit test. #

Total comments: 3

Patch Set 8 : Sidestep widget->allocation, use properties. #

Total comments: 4

Patch Set 9 : Comment clean up. #

Patch Set 10 : Unit test issues, documentation tweaks. #

Total comments: 8

Patch Set 11 : Slight refactoring. #

Total comments: 2

Patch Set 12 : Return a gfx::Size instead. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+287 lines, -28 lines) Patch
A chrome/browser/views/html_dialog_view_browsertest.cc View 5 6 1 chunk +204 lines, -0 lines 0 comments Download
M chrome/browser/views/tab_contents/tab_contents_view_gtk.cc View 10 11 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/browser/views/tabs/dragged_tab_view.cc View 10 1 chunk +1 line, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M views/controls/native/native_view_host_gtk.cc View 6 7 8 9 3 chunks +9 lines, -5 lines 0 comments Download
M views/controls/tabbed_pane/tabbed_pane_unittest.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M views/widget/gtk_views_fixed.h View 7 8 9 2 chunks +11 lines, -5 lines 0 comments Download
M views/widget/gtk_views_fixed.cc View 7 8 9 3 chunks +31 lines, -6 lines 0 comments Download
M views/widget/widget_gtk.h View 11 1 chunk +5 lines, -0 lines 0 comments Download
M views/widget/widget_gtk.cc View 1 2 3 4 8 9 10 11 3 chunks +14 lines, -4 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Mattias Nissler (ping if slow)
Can you please double-check the bug number?
10 years, 5 months ago (2010-07-01 04:34:07 UTC) #1
Scott Byer
On 2010/07/01 04:34:07, mnissler wrote: > Can you please double-check the bug number? Whoops, it's ...
10 years, 5 months ago (2010-07-01 16:17:32 UTC) #2
Paweł Hajdan Jr.
Drive-by with some test comments. Please let me take another look before committing. http://codereview.chromium.org/2768006/diff/12001/13001 File ...
10 years, 5 months ago (2010-07-01 16:21:32 UTC) #3
Mattias Nissler (ping if slow)
http://codereview.chromium.org/2768006/diff/12001/13003 File views/widget/widget_gtk.cc (right): http://codereview.chromium.org/2768006/diff/12001/13003#newcode651 views/widget/widget_gtk.cc:651: gtk_widget_set_size_request(widget_, bounds.width(), bounds.height()); I disucssed this exact call with ...
10 years, 5 months ago (2010-07-02 07:29:34 UTC) #4
Scott Byer
(With travel in the middle, took me a bit to get back and dig deep ...
10 years, 4 months ago (2010-08-06 21:51:33 UTC) #5
Paweł Hajdan Jr.
Drive-by with a test comment. Do not commit without my "LGTM". http://codereview.chromium.org/2768006/diff/22001/23002 File chrome/browser/views/html_dialog_view_browsertest.cc (right): ...
10 years, 4 months ago (2010-08-06 21:56:28 UTC) #6
Scott Byer
http://codereview.chromium.org/2768006/diff/22001/23002 File chrome/browser/views/html_dialog_view_browsertest.cc (right): http://codereview.chromium.org/2768006/diff/22001/23002#newcode69 chrome/browser/views/html_dialog_view_browsertest.cc:69: void RunAllPendingAndDelayed() { On 2010/08/06 21:56:28, Paweł Hajdan Jr. ...
10 years, 4 months ago (2010-08-06 22:13:15 UTC) #7
sky
http://codereview.chromium.org/2768006/diff/22001/23001 File chrome/browser/views/html_dialog_view.cc (right): http://codereview.chromium.org/2768006/diff/22001/23001#newcode158 chrome/browser/views/html_dialog_view.cc:158: GetWidget()->SetBounds(pos); Changing the bounds of the widget should force ...
10 years, 4 months ago (2010-08-06 23:02:15 UTC) #8
sky
Is TabContentsViewGtk::SizeContents getting invoked, which resets the requested size? -Scott On Fri, Aug 6, 2010 ...
10 years, 4 months ago (2010-08-06 23:07:34 UTC) #9
sky
In fact you might try putting a breakpoint in gtk_widget_set_size_request to see if it's getting ...
10 years, 4 months ago (2010-08-06 23:08:31 UTC) #10
Scott Byer
I know gtk_widget_set_size_request is getting invoked in NativeViewHostGtk::ShowWidget - see http://codereview.chromium.org/2131021 I'll check on TabContentsViewGtk::SizeContents ...
10 years, 4 months ago (2010-08-06 23:25:01 UTC) #11
sky
On Fri, Aug 6, 2010 at 4:25 PM, <scottbyer@chromium.org> wrote: > > I know gtk_widget_set_size_request ...
10 years, 4 months ago (2010-08-06 23:39:42 UTC) #12
Scott Byer
Diving back into this. TabContentsViewGtk::SizeContents is not being called. gtk_widget_set_size_request is being called for the ...
10 years, 4 months ago (2010-08-10 20:24:14 UTC) #13
sky
I believe the problem that lead Dmitry to now use gtk_views_fixed was some flickering that ...
10 years, 4 months ago (2010-08-11 17:01:08 UTC) #14
Scott Byer
Would it make sense to use the preferred_size_, which is already part of NativeViewHost, but ...
10 years, 4 months ago (2010-08-11 17:08:09 UTC) #15
sky
Better to use gtk_views_fixed and push the size to it. That way gtk_views_fixed doesn't need ...
10 years, 4 months ago (2010-08-11 17:19:39 UTC) #16
Dmitry Polukhin
I had to revert my CL with gtk_views_fixed because of flickering of tab contents. I ...
10 years, 4 months ago (2010-08-11 19:35:46 UTC) #17
sky
What's the best way to see the flickering? Just switch tabs? -Scott On Wed, Aug ...
10 years, 4 months ago (2010-08-11 19:58:27 UTC) #18
Dmitry Polukhin
Yes, and also try to resize Chrome window. Also one of interactive UI test failed ...
10 years, 4 months ago (2010-08-12 19:02:03 UTC) #19
Scott Byer
Ok, I had the extra properties stuff all implemented, had it all working, and was ...
10 years, 4 months ago (2010-08-18 00:13:09 UTC) #20
Paweł Hajdan Jr.
The waiting logic looks much better to me. Thanks for the hard work! http://codereview.chromium.org/2768006/diff/40001/41001 File ...
10 years, 4 months ago (2010-08-18 00:18:30 UTC) #21
sky
http://codereview.chromium.org/2768006/diff/40001/41003 File views/controls/native/native_view_host_gtk.cc (right): http://codereview.chromium.org/2768006/diff/40001/41003#newcode236 views/controls/native/native_view_host_gtk.cc:236: gtk_widget_set_allocation(host_->native_view(), &allocation); I'm worried about using this for two ...
10 years, 4 months ago (2010-08-18 15:45:57 UTC) #22
Scott Byer
No problem, allocation-as-property was what I had earlier, easy to bring back and clean up ...
10 years, 4 months ago (2010-08-18 16:50:01 UTC) #23
sky
http://codereview.chromium.org/2768006/diff/46001/36005 File views/widget/gtk_views_fixed.cc (right): http://codereview.chromium.org/2768006/diff/46001/36005#newcode30 views/widget/gtk_views_fixed.cc:30: int request_width, request_height; Shouldn't this be on the inner ...
10 years, 4 months ago (2010-08-18 17:11:43 UTC) #24
Paweł Hajdan Jr.
Test code LGTM.
10 years, 4 months ago (2010-08-18 18:12:07 UTC) #25
Scott Byer
Is this more like what you're looking for? This sidesteps widget->allocation completely, and avoids the ...
10 years, 4 months ago (2010-08-18 18:15:49 UTC) #26
sky
Yay, this looks good. My only request is to improve the comments, then LGTM http://codereview.chromium.org/2768006/diff/53001/41007 ...
10 years, 4 months ago (2010-08-18 18:22:28 UTC) #27
Scott Byer
http://codereview.chromium.org/2768006/diff/53001/41007 File views/controls/native/native_view_host_gtk.cc (right): http://codereview.chromium.org/2768006/diff/53001/41007#newcode232 views/controls/native/native_view_host_gtk.cc:232: // Set the allocation and queue up the resize. ...
10 years, 4 months ago (2010-08-18 18:58:30 UTC) #28
sky
On Wed, Aug 18, 2010 at 11:58 AM, <scottbyer@chromium.org> wrote: > > http://codereview.chromium.org/2768006/diff/53001/41007 > File ...
10 years, 4 months ago (2010-08-18 20:40:53 UTC) #29
Scott Byer
Added in the queue resize notes to the comments; found a couple of compile + ...
10 years, 4 months ago (2010-08-18 23:22:51 UTC) #30
sky
http://codereview.chromium.org/2768006/diff/62009/70002 File chrome/browser/views/tab_contents/tab_contents_view_gtk.cc (right): http://codereview.chromium.org/2768006/diff/62009/70002#newcode230 chrome/browser/views/tab_contents/tab_contents_view_gtk.cc:230: } On 2010/08/18 23:22:51, Scott Byer wrote: > I ...
10 years, 4 months ago (2010-08-18 23:51:49 UTC) #31
Scott Byer
http://codereview.chromium.org/2768006/diff/62009/70002 File chrome/browser/views/tab_contents/tab_contents_view_gtk.cc (right): http://codereview.chromium.org/2768006/diff/62009/70002#newcode230 chrome/browser/views/tab_contents/tab_contents_view_gtk.cc:230: } On 2010/08/18 23:51:49, sky wrote: > On 2010/08/18 ...
10 years, 4 months ago (2010-08-19 20:47:38 UTC) #32
sky
Do the following change, and LGTM http://codereview.chromium.org/2768006/diff/68002/41020 File views/widget/widget_gtk.h (right): http://codereview.chromium.org/2768006/diff/68002/41020#newcode155 views/widget/widget_gtk.h:155: void GetRequestedSize(gfx::Rect* out) ...
10 years, 4 months ago (2010-08-19 21:10:33 UTC) #33
Scott Byer
http://codereview.chromium.org/2768006/diff/68002/41020 File views/widget/widget_gtk.h (right): http://codereview.chromium.org/2768006/diff/68002/41020#newcode155 views/widget/widget_gtk.h:155: void GetRequestedSize(gfx::Rect* out) const; On 2010/08/19 21:10:33, sky wrote: ...
10 years, 4 months ago (2010-08-19 21:58:18 UTC) #34
sky
LGTM
10 years, 4 months ago (2010-08-19 22:00:14 UTC) #35
sky
And thanks for seeing the right fix through! -Scott
10 years, 4 months ago (2010-08-19 22:00:29 UTC) #36
oshima
10 years, 4 months ago (2010-08-24 19:17:32 UTC) #37
scottbyer, looks like this borke WidgetGtk::Init and causing crosbug.com/5987.
can you look into it?

Powered by Google App Engine
This is Rietveld 408576698