Commit d19d2ffc authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

x11: Remove XWindow::Delegate::GetTimestampForXWindow

After crrev.com/c/1712955, //ui/base/x code can depend on X11EventSource
directly (without causing GN circular deps), making GetTimestampForXWindow
ui::XWindow::Delegate's function unneeded. So this CL removes it.

Bug: 981606
Test: None (no behavior change)
Change-Id: Ied47c2cd7bf0cccd45c0212d84de341145d89779
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715308
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680577}
parent 72db38ef
...@@ -40,6 +40,7 @@ jumbo_component("x") { ...@@ -40,6 +40,7 @@ jumbo_component("x") {
"//ui/events", "//ui/events",
"//ui/events/devices/x11", "//ui/events/devices/x11",
"//ui/events/keycodes:x11", "//ui/events/keycodes:x11",
"//ui/events/platform/x11",
"//ui/events/x:x", "//ui/events/x:x",
"//ui/gfx", "//ui/gfx",
"//ui/gfx/x", "//ui/gfx/x",
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "ui/events/devices/x11/touch_factory_x11.h" #include "ui/events/devices/x11/touch_factory_x11.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/events/x/events_x_utils.h" #include "ui/events/x/events_x_utils.h"
#include "ui/events/x/x11_window_event_manager.h" #include "ui/events/x/x11_window_event_manager.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
...@@ -358,7 +359,8 @@ void XWindow::Map(bool inactive) { ...@@ -358,7 +359,8 @@ void XWindow::Map(bool inactive) {
ignore_keyboard_input_ = inactive; ignore_keyboard_input_ = inactive;
unsigned long wm_user_time_ms = unsigned long wm_user_time_ms =
ignore_keyboard_input_ ? 0 : delegate_->GetTimestampForXWindow(); ignore_keyboard_input_ ? 0
: X11EventSource::GetInstance()->GetTimestamp();
if (inactive || wm_user_time_ms != 0) { if (inactive || wm_user_time_ms != 0) {
XChangeProperty(xdisplay_, xwindow_, gfx::GetAtom("_NET_WM_USER_TIME"), XChangeProperty(xdisplay_, xwindow_, gfx::GetAtom("_NET_WM_USER_TIME"),
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
...@@ -457,7 +459,7 @@ void XWindow::Activate() { ...@@ -457,7 +459,7 @@ void XWindow::Activate() {
ui::GuessWindowManager() != ui::WM_WMII && ui::GuessWindowManager() != ui::WM_WMII &&
ui::WmSupportsHint(gfx::GetAtom("_NET_ACTIVE_WINDOW")); ui::WmSupportsHint(gfx::GetAtom("_NET_ACTIVE_WINDOW"));
::Time timestamp = delegate_->GetTimestampForXWindow(); ::Time timestamp = X11EventSource::GetInstance()->GetTimestamp();
// override_redirect windows ignore _NET_ACTIVE_WINDOW. // override_redirect windows ignore _NET_ACTIVE_WINDOW.
// https://crbug.com/940924 // https://crbug.com/940924
......
...@@ -357,11 +357,6 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow::Delegate { ...@@ -357,11 +357,6 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow::Delegate {
virtual void OnXWindowCloseRequested() = 0; virtual void OnXWindowCloseRequested() = 0;
virtual void OnXWindowIsActiveChanged(bool active) = 0; virtual void OnXWindowIsActiveChanged(bool active) = 0;
// TODO(crbug.com/981606): Cannot depend directly on X11EventSource due to
// circular dependency between ui/base/x and ui/events/platform/x11. Remove
// this function once it is solved.
virtual ::Time GetTimestampForXWindow() = 0;
// Optional Hooks // Optional Hooks
virtual void OnXWindowMapped(); virtual void OnXWindowMapped();
virtual void OnXWindowUnmapped(); virtual void OnXWindowUnmapped();
......
...@@ -372,8 +372,4 @@ void X11WindowOzone::OnXWindowIsActiveChanged(bool active) { ...@@ -372,8 +372,4 @@ void X11WindowOzone::OnXWindowIsActiveChanged(bool active) {
delegate_->OnActivationChanged(active); delegate_->OnActivationChanged(active);
} }
::Time X11WindowOzone::GetTimestampForXWindow() {
return ui::X11EventSource::GetInstance()->GetTimestamp();
}
} // namespace ui } // namespace ui
...@@ -81,7 +81,6 @@ class X11WindowOzone : public PlatformWindow, ...@@ -81,7 +81,6 @@ class X11WindowOzone : public PlatformWindow,
void OnXWindowCloseRequested() override; void OnXWindowCloseRequested() override;
void OnXWindowLostCapture() override; void OnXWindowLostCapture() override;
void OnXWindowIsActiveChanged(bool active) override; void OnXWindowIsActiveChanged(bool active) override;
::Time GetTimestampForXWindow() override;
// PlatformEventDispatcher: // PlatformEventDispatcher:
bool CanDispatchEvent(const PlatformEvent& event) override; bool CanDispatchEvent(const PlatformEvent& event) override;
......
...@@ -1231,10 +1231,6 @@ void DesktopWindowTreeHostX11::OnXWindowIsActiveChanged(bool active) { ...@@ -1231,10 +1231,6 @@ void DesktopWindowTreeHostX11::OnXWindowIsActiveChanged(bool active) {
native_widget_delegate_->AsWidget()->GetRootView()->SchedulePaint(); native_widget_delegate_->AsWidget()->GetRootView()->SchedulePaint();
} }
::Time DesktopWindowTreeHostX11::GetTimestampForXWindow() {
return ui::X11EventSource::GetInstance()->GetTimestamp();
}
gfx::Size DesktopWindowTreeHostX11::GetMinimumSizeForXWindow() { gfx::Size DesktopWindowTreeHostX11::GetMinimumSizeForXWindow() {
return ToPixelRect(gfx::Rect(native_widget_delegate_->GetMinimumSize())) return ToPixelRect(gfx::Rect(native_widget_delegate_->GetMinimumSize()))
.size(); .size();
......
...@@ -214,7 +214,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 ...@@ -214,7 +214,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
void OnXWindowLostPointerGrab() override; void OnXWindowLostPointerGrab() override;
void OnXWindowLostCapture() override; void OnXWindowLostCapture() override;
void OnXWindowIsActiveChanged(bool active) override; void OnXWindowIsActiveChanged(bool active) override;
::Time GetTimestampForXWindow() override;
gfx::Size GetMinimumSizeForXWindow() override; gfx::Size GetMinimumSizeForXWindow() override;
gfx::Size GetMaximumSizeForXWindow() override; gfx::Size GetMaximumSizeForXWindow() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment