Remove usage of X11AtomCache

See https://codereview.chromium.org/2914103002/
This commit is contained in:
Tony Ganch 2017-09-12 15:47:19 +00:00 committed by Cheng Zhao
parent da04cbd4d8
commit 513d4fd225
2 changed files with 2 additions and 5 deletions

View file

@ -7,6 +7,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "ui/events/platform/platform_event_source.h" #include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_atom_cache.h"
namespace atom { namespace atom {
@ -22,7 +23,6 @@ const char* kAtomsToCache[] = {
WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window) WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window)
: window_(window), : window_(window),
widget_(window->GetAcceleratedWidget()), widget_(window->GetAcceleratedWidget()),
atom_cache_(gfx::GetXDisplay(), kAtomsToCache),
was_minimized_(false), was_minimized_(false),
was_maximized_(false) { was_maximized_(false) {
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this); ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
@ -70,7 +70,7 @@ void WindowStateWatcher::DidProcessEvent(const ui::PlatformEvent& event) {
bool WindowStateWatcher::IsWindowStateEvent(const ui::PlatformEvent& event) { bool WindowStateWatcher::IsWindowStateEvent(const ui::PlatformEvent& event) {
::Atom changed_atom = event->xproperty.atom; ::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->type == PropertyNotify &&
event->xproperty.window == widget_); event->xproperty.window == widget_);
} }

View file

@ -8,7 +8,6 @@
#include "ui/events/platform/platform_event_observer.h" #include "ui/events/platform/platform_event_observer.h"
#include "atom/browser/native_window_views.h" #include "atom/browser/native_window_views.h"
#include "ui/gfx/x/x11_atom_cache.h"
namespace atom { namespace atom {
@ -28,8 +27,6 @@ class WindowStateWatcher : public ui::PlatformEventObserver {
NativeWindowViews* window_; NativeWindowViews* window_;
gfx::AcceleratedWidget widget_; gfx::AcceleratedWidget widget_;
ui::X11AtomCache atom_cache_;
bool was_minimized_; bool was_minimized_;
bool was_maximized_; bool was_maximized_;