Only send _NET_ACTIVE_WINDOW hint if the chromium window is not already active.
commitc249d328f7eb74479b017bb04439a585fe6bf44a
authoroverridex <overridex@gmail.com>
Fri, 3 Jul 2015 04:12:56 +0000 (2 21:12 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 3 Jul 2015 04:13:36 +0000 (3 04:13 +0000)
tree89f2470144d2af783d28a4183e1a59fd0b6acb5d
parent2fed195fad8698e6614da8353ec73461bd0c4cf6
Only send _NET_ACTIVE_WINDOW hint if the chromium window is not already active.

This is intended to replace the proposed changes of https://codereview.chromium.org/917473002/ and
https://codereview.chromium.org/882223011/. This coupled with the changes in
https://codereview.chromium.org/1154013002 should resolve bug 318937. Rather than always sending a
_NET_ACTIVE_WINDOW hint, keep track of the active window by tracking the _NET_ACTIVE_WINDOW property
of the X11 root window, and send a _NET_ACTIVE_WINDOW only if the window is not already active.
This prevents spurious raises in some window managers when click to raise is disabled.

R=agoode@chromium.org, sadrul@chromium.org
BUG=318937
TEST=In an affected WM like XFCE or E19, disable click-to-raise and overlap a window over Chromium.
Click in the rendering area of Chromium and observe that it is not raised. Click on a link in another
application with Chromium as the default browser and note that the Chromium window is raised correctly.

Review URL: https://codereview.chromium.org/1212643008

Cr-Commit-Position: refs/heads/master@{#337282}
AUTHORS
ui/views/widget/desktop_aura/x11_desktop_handler.cc
ui/views/widget/desktop_aura/x11_desktop_handler.h