Chromium Code Reviews
DescriptionFix 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 #
Messages
Total messages: 35 (23 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||