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

Issue 2743793003: Fix theme change paint issue on linux. (Closed)

Created:
3 years, 9 months ago by ananta
Modified:
3 years, 9 months ago
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix theme change paint issue on linux. We had added a recursion guard in the Widget::OnNativeThemeUpdated() function in this patch https://codereview.chromium.org/2703933002. This was to work around a crash we were seeing on Windows where views would be added/removed while the rootview was propagating the theme changed notification to child views effectively making the iterators invalid. The recursion killer check in Widget::FrameTypeChanged() causes a painting bug on Linux. The callstack thanks to thomasanderson is here. #2 0x7fdda6f06c83 views::Widget::FrameTypeChanged() #3 0x55801d8ad66c BrowserView::UserChangedTheme() #4 0x55801d8b0aef BrowserView::OnNativeThemeChanged() #5 0x7fdda6edbdf6 views::View::PropagateNativeThemeChanged() #6 0x7fdda6edbdc1 views::View::PropagateNativeThemeChanged() #7 0x7fdda6edbdc1 views::View::PropagateNativeThemeChanged() #8 0x7fdda6f09275 views::Widget::OnNativeThemeUpdated() #9 0x7fdda6aa7493 ui::NativeTheme::NotifyObservers() #10 0x7fdda4195366 libgtkui::GtkUi::ResetStyle() #11 0x7fdda419532d libgtkui::OnThemeChanged() The BrowserView::UserChangedTheme() function also has a recursion killer which is not set to true here, which indicates that this stack is legitimate. Fixes as below: 1. BrowserFrame now overrides the Widget::OnNativeThemeUpdated() function. After calling the base class we call the newly added function NativeThemeUpdated() in the BrowserView which ensures that we don't nuke the views while the iteration is going on in View::PropagateNativeThemeChanged() 2. In the HWNDMessageHandler::SetFullscreen method we update the fullscreen window map after we call PerformDwmTransition(). This internally at times causes a window pos changed to treat the now non fullscreen window as fullscreen leading to a DCHECK. Fixed by moving this code above. I verified that this does not regress the previous theme fix http://crbug.com/681525 on Windows. BUG=700135 Review-Url: https://codereview.chromium.org/2743793003 Cr-Commit-Position: refs/heads/master@{#456580} Committed: https://chromium.googlesource.com/chromium/src/+/3d0d1cdfad3fd70d8d579dd03004b4e09d01f2f1

Patch Set 1 #

Patch Set 2 : Remove the auto reset for the processing_theme_changed_ member. #

Patch Set 3 : Process FrameTypeChanged in DesktopWindowTreeHostWin in a task #

Patch Set 4 : Handle theme changes in BrowserFrame::OnNativeThemeUpdated() #

Patch Set 5 : Revert changes to DesktopWindowTreeHostWin #

Total comments: 4

Patch Set 6 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -27 lines) Patch
M chrome/browser/ui/views/frame/browser_frame.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_frame.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 2 chunks +16 lines, -11 lines 0 comments Download
M ui/views/widget/widget.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 chunks +1 line, -8 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 35 (23 generated)
ananta
3 years, 9 months ago (2017-03-10 01:42:55 UTC) #3
Tom (Use chromium acct)
lgtm Thanks ananta@, this fixes the issue on Linux for me!
3 years, 9 months ago (2017-03-10 02:08:03 UTC) #7
ananta
On 2017/03/10 02:08:03, Tom Anderson wrote: > lgtm > > Thanks ananta@, this fixes the ...
3 years, 9 months ago (2017-03-10 04:36:54 UTC) #8
ananta
sky, This is ready for review now
3 years, 9 months ago (2017-03-11 00:10:09 UTC) #10
sky
The HWNDMessageHandler calls make me nervous and I would like to avoid them. Additionally posting ...
3 years, 9 months ago (2017-03-11 00:18:58 UTC) #13
ananta
On 2017/03/11 00:18:58, sky wrote: > The HWNDMessageHandler calls make me nervous and I would ...
3 years, 9 months ago (2017-03-11 00:46:29 UTC) #17
Tom (Use chromium acct)
latest PS still lgtm
3 years, 9 months ago (2017-03-11 01:38:36 UTC) #20
sky
https://codereview.chromium.org/2743793003/diff/120001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2743793003/diff/120001/chrome/browser/ui/views/frame/browser_view.cc#newcode1659 chrome/browser/ui/views/frame/browser_view.cc:1659: void BrowserView::NativeThemeUpdated(const ui::NativeTheme* theme) { Please comment why NativeThemeUpdated ...
3 years, 9 months ago (2017-03-13 15:41:42 UTC) #23
ananta
https://codereview.chromium.org/2743793003/diff/120001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2743793003/diff/120001/chrome/browser/ui/views/frame/browser_view.cc#newcode1659 chrome/browser/ui/views/frame/browser_view.cc:1659: void BrowserView::NativeThemeUpdated(const ui::NativeTheme* theme) { On 2017/03/13 15:41:42, sky ...
3 years, 9 months ago (2017-03-13 19:48:03 UTC) #24
sky
Ok, LGTM
3 years, 9 months ago (2017-03-13 23:54:23 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743793003/140001
3 years, 9 months ago (2017-03-14 01:23:36 UTC) #32
commit-bot: I haz the power
3 years, 9 months ago (2017-03-14 02:22:59 UTC) #35
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/3d0d1cdfad3fd70d8d579dd03004...

Powered by Google App Engine
This is Rietveld 408576698