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

Issue 8386064: Fixes painting regression. The problem was I optimized to only send to (Closed)

Created:
9 years, 1 month ago by sky
Modified:
9 years, 1 month ago
CC:
chromium-reviews, Ian Vollick, piman+watch_chromium.org, dhollowa, tfarina, jonathan.backer
Visibility:
Public.

Description

Fixes painting regression. The problem was I optimized to only send to NonClientView when inactive rendering disabled changes, but implementations are relying on this to be sent when active state may have changed too. This isn't the right fix, but gives us the old behavior. We really need to persist active state in widget, then notify the NonClientView when it changes, or the inactive rendering disabled state changes. BUG=102695 TEST=easiest to verify on windows in classic mode (non-aero). Create two chrome windows, click between them and make sure the window losing activation state looks inactive. R=ben@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108465

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -7 lines) Patch
M ui/gfx/compositor/layer_animator.h View 1 chunk +1 line, -1 line 0 comments Download
M views/widget/widget.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M views/window/non_client_view.cc View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
sky
9 years, 1 month ago (2011-11-02 22:24:28 UTC) #1
Ben Goodger (Google)
9 years, 1 month ago (2011-11-02 23:39:29 UTC) #2
LGTM

On Wed, Nov 2, 2011 at 3:24 PM, <sky@chromium.org> wrote:

> Reviewers: Ben Goodger (Google),
>
> Description:
> Fixes painting regression. The problem was I optimized to only send to
> NonClientView when inactive rendering disabled changes, but
> implementations are relying on this to be sent when active state may
> have changed too. This isn't the right fix, but gives us the old
> behavior. We really need to persist active state in widget, then
> notify the NonClientView when it changes, or the inactive rendering
> disabled state changes.
>
> BUG=102695
> TEST=easiest to verify on windows in classic mode (non-aero). Create
> two chrome windows, click between them and make sure the window losing
> activation state looks inactive.
> R=ben@chromium.org
>
>
> Please review this at
http://codereview.chromium.**org/8386064/<http://codereview.chromium.org/8386...
>
> SVN Base:
svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src>
>
> Affected files:
>  M ui/gfx/compositor/layer_**animator.h
>  M views/widget/widget.cc
>  M views/window/non_client_view.**cc
>
>
> Index: ui/gfx/compositor/layer_**animator.h
> diff --git a/ui/gfx/compositor/layer_**animator.h
> b/ui/gfx/compositor/layer_**animator.h
> index 4fca4e575a849bdd2a7a72c8ff4970**0de5301ee1..**
> c7286b5b1fd1c87a0d59fe69836ce6**1f54837b84 100644
> --- a/ui/gfx/compositor/layer_**animator.h
> +++ b/ui/gfx/compositor/layer_**animator.h
> @@ -122,7 +122,7 @@ class COMPOSITOR_EXPORT LayerAnimator : public
> AnimationContainerElement {
>   // these changes are reverted when the object is destroyed. NOTE: when
> the
>   // settings object is created, it applies the default transition duration
>   // (200ms).
> -  class ScopedSettings {
> +  class COMPOSITOR_EXPORT ScopedSettings {
>    public:
>     explicit ScopedSettings(LayerAnimator* animator);
>     virtual ~ScopedSettings();
> Index: views/widget/widget.cc
> diff --git a/views/widget/widget.cc b/views/widget/widget.cc
> index 5b305c41736450597877828f416eae**51a82b78e9..**
> 029b92025cc87ea3ba31e3d4d58e2c**365c1388ec 100644
> --- a/views/widget/widget.cc
> +++ b/views/widget/widget.cc
> @@ -1110,10 +1110,10 @@ bool Widget::**ShouldReleaseCaptureOnMouseRel**eased()
> const {
>  }
>
>  void Widget::**SetInactiveRenderingDisabled(**bool value) {
> -  if (value == disable_inactive_rendering_)
> -    return;
> -
>   disable_inactive_rendering_ = value;
> +  // We need to always notify the NonClientView so that it can trigger a
> paint.
> +  // TODO: what's really needed is a way to know when either the active
> state
> +  // changes or |disable_inactive_rendering_| changes.
>   if (non_client_view_)
>     non_client_view_->**SetInactiveRenderingDisabled(**value);
>   native_widget_->**SetInactiveRenderingDisabled(**value);
> Index: views/window/non_client_view.**cc
> diff --git a/views/window/non_client_**view.cc b/views/window/non_client_*
> *view.cc
> index b6fc9233d25dbb11e71feeb6033ebb**b87f769b5c..**
> 92c7bc7a8834650b231be6df406079**81b1802dca 100644
> --- a/views/window/non_client_**view.cc
> +++ b/views/window/non_client_**view.cc
> @@ -187,9 +187,8 @@ views::View*
NonClientView::**GetEventHandlerForPoint(const
> gfx::Point& point) {
>  // NonClientFrameView, public:
>
>  void NonClientFrameView::**SetInactiveRenderingDisabled(**bool disable) {
> -  if (paint_as_active_ == disable)
> -    return;
> -
> +  // See comment in Widget::**SetInactiveRenderingDisabled as to why we
> don't
> +  // conditionally invoke ShouldPaintAsActiveChanged.
>   paint_as_active_ = disable;
>   ShouldPaintAsActiveChanged();
>  }
>
>
>

Powered by Google App Engine
This is Rietveld 408576698