| Index: ui/views/widget/desktop_aura/desktop_screen_x11.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
|
| index 6ffd94a3c896909e26a399f93b380d9123bd01e7..9ccbe0ad190ce1f14ab4762588303091002c2a10 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
|
| @@ -33,6 +33,11 @@
|
|
|
| namespace {
|
|
|
| +const char* const kAtomsToCache[] = {
|
| + "_NET_WORKAREA",
|
| + nullptr
|
| +};
|
| +
|
| // The delay to perform configuration after RRNotify. See the comment
|
| // in |Dispatch()|.
|
| const int64_t kConfigureDelayMs = 500;
|
| @@ -86,7 +91,8 @@ DesktopScreenX11::DesktopScreenX11()
|
| : xdisplay_(gfx::GetXDisplay()),
|
| x_root_window_(DefaultRootWindow(xdisplay_)),
|
| has_xrandr_(false),
|
| - xrandr_event_base_(0) {
|
| + xrandr_event_base_(0),
|
| + atom_cache_(xdisplay_, kAtomsToCache) {
|
| // We only support 1.3+. There were library changes before this and we should
|
| // use the new interface instead of the 1.2 one.
|
| int randr_version_major = 0;
|
| @@ -229,14 +235,19 @@ void DesktopScreenX11::RemoveObserver(gfx::DisplayObserver* observer) {
|
|
|
| bool DesktopScreenX11::CanDispatchEvent(const ui::PlatformEvent& event) {
|
| return event->type - xrandr_event_base_ == RRScreenChangeNotify ||
|
| - event->type - xrandr_event_base_ == RRNotify;
|
| + event->type - xrandr_event_base_ == RRNotify ||
|
| + (event->type == PropertyNotify &&
|
| + event->xproperty.window == x_root_window_ &&
|
| + event->xproperty.atom == atom_cache_.GetAtom("_NET_WORKAREA"));
|
| }
|
|
|
| uint32_t DesktopScreenX11::DispatchEvent(const ui::PlatformEvent& event) {
|
| if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
|
| // Pass the event through to xlib.
|
| XRRUpdateConfiguration(event);
|
| - } else if (event->type - xrandr_event_base_ == RRNotify) {
|
| + } else if (event->type - xrandr_event_base_ == RRNotify ||
|
| + (event->type == PropertyNotify &&
|
| + event->xproperty.atom == atom_cache_.GetAtom("_NET_WORKAREA"))) {
|
| // There's some sort of observer dispatch going on here, but I don't think
|
| // it's the screen's?
|
| if (configure_timer_.get() && configure_timer_->IsRunning()) {
|
| @@ -272,7 +283,8 @@ DesktopScreenX11::DesktopScreenX11(
|
| x_root_window_(DefaultRootWindow(xdisplay_)),
|
| has_xrandr_(false),
|
| xrandr_event_base_(0),
|
| - displays_(test_displays) {
|
| + displays_(test_displays),
|
| + atom_cache_(xdisplay_, kAtomsToCache) {
|
| }
|
|
|
| std::vector<gfx::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() {
|
|
|