From 513d4fd22503793ec6670b30390e042712717a1e Mon Sep 17 00:00:00 2001 From: Tony Ganch Date: Tue, 12 Sep 2017 15:47:19 +0000 Subject: [PATCH] Remove usage of X11AtomCache See https://codereview.chromium.org/2914103002/ --- atom/browser/ui/x/window_state_watcher.cc | 4 ++-- atom/browser/ui/x/window_state_watcher.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/atom/browser/ui/x/window_state_watcher.cc b/atom/browser/ui/x/window_state_watcher.cc index e1b2716b868f..414cd85e82b6 100644 --- a/atom/browser/ui/x/window_state_watcher.cc +++ b/atom/browser/ui/x/window_state_watcher.cc @@ -7,6 +7,7 @@ #include #include "ui/events/platform/platform_event_source.h" +#include "ui/gfx/x/x11_atom_cache.h" namespace atom { @@ -22,7 +23,6 @@ const char* kAtomsToCache[] = { WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window) : window_(window), widget_(window->GetAcceleratedWidget()), - atom_cache_(gfx::GetXDisplay(), kAtomsToCache), was_minimized_(false), was_maximized_(false) { ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this); @@ -70,7 +70,7 @@ void WindowStateWatcher::DidProcessEvent(const ui::PlatformEvent& event) { bool WindowStateWatcher::IsWindowStateEvent(const ui::PlatformEvent& event) { ::Atom changed_atom = event->xproperty.atom; - return (changed_atom == atom_cache_.GetAtom("_NET_WM_STATE") && + return (changed_atom == gfx::GetAtom("_NET_WM_STATE") && event->type == PropertyNotify && event->xproperty.window == widget_); } diff --git a/atom/browser/ui/x/window_state_watcher.h b/atom/browser/ui/x/window_state_watcher.h index 2888c9fc6fec..376e028e1a77 100644 --- a/atom/browser/ui/x/window_state_watcher.h +++ b/atom/browser/ui/x/window_state_watcher.h @@ -8,7 +8,6 @@ #include "ui/events/platform/platform_event_observer.h" #include "atom/browser/native_window_views.h" -#include "ui/gfx/x/x11_atom_cache.h" namespace atom { @@ -28,8 +27,6 @@ class WindowStateWatcher : public ui::PlatformEventObserver { NativeWindowViews* window_; gfx::AcceleratedWidget widget_; - ui::X11AtomCache atom_cache_; - bool was_minimized_; bool was_maximized_;