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

x11: Fix obsolete comments in X{11}Window code

Additionally reformat a few (oddly indented) comment blocks.

R=thomasanderson@chromium.org

Bug: None
Change-Id: I14deaa1eb750c79f0b7f2915d8f68dfa8bc484c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274239
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Nick Yamane <nickdiego@igalia.com>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783761}
parent a92dd682
...@@ -574,9 +574,9 @@ void XWindow::Activate() { ...@@ -574,9 +574,9 @@ void XWindow::Activate() {
->SetInputFocus({x11::InputFocus::Parent, xwindow_, ->SetInputFocus({x11::InputFocus::Parent, xwindow_,
static_cast<x11::Time>(timestamp)}) static_cast<x11::Time>(timestamp)})
.IgnoreError(); .IgnoreError();
// At this point, we know we will receive focus, and some // At this point, we know we will receive focus, and some webdriver tests
// webdriver tests depend on a window being IsActive() immediately // depend on a window being IsActive() immediately after an Activate(), so
// after an Activate(), so just set this state now. // just set this state now.
has_pointer_focus_ = false; has_pointer_focus_ = false;
has_window_focus_ = true; has_window_focus_ = true;
window_mapped_in_server_ = true; window_mapped_in_server_ = true;
...@@ -603,6 +603,7 @@ bool XWindow::IsActive() const { ...@@ -603,6 +603,7 @@ bool XWindow::IsActive() const {
// stacking order in addition to changing the focus state. // stacking order in addition to changing the focus state.
return (has_window_focus_ || has_pointer_focus_) && !ignore_keyboard_input_; return (has_window_focus_ || has_pointer_focus_) && !ignore_keyboard_input_;
} }
void XWindow::SetSize(const gfx::Size& size_in_pixels) { void XWindow::SetSize(const gfx::Size& size_in_pixels) {
connection_->ConfigureWindow({.window = xwindow_, connection_->ConfigureWindow({.window = xwindow_,
.width = size_in_pixels.width(), .width = size_in_pixels.width(),
...@@ -1088,12 +1089,6 @@ void XWindow::WmMoveResize(int hittest, const gfx::Point& location) const { ...@@ -1088,12 +1089,6 @@ void XWindow::WmMoveResize(int hittest, const gfx::Point& location) const {
DoWMMoveResize(connection_, x_root_window_, xwindow_, location, direction); DoWMMoveResize(connection_, x_root_window_, xwindow_, location, direction);
} }
// In Ozone, there are no *Event constructors receiving XEvent* as input,
// in this case PlatformEvent is expected. Furthermore,
// X11EventSourceLibevent is used in that case, which already translates
// Mouse/Key/Touch/Scroll events into Events so they should not be handled
// by PlatformWindow, which is supposed to use XWindow in Ozone builds. So
// handling these events is disabled for Ozone.
void XWindow::ProcessEvent(x11::Event* xev) { void XWindow::ProcessEvent(x11::Event* xev) {
// We can lose track of the window's position when the window is reparented. // We can lose track of the window's position when the window is reparented.
// When the parent window is moved, we won't get an event, so the window's // When the parent window is moved, we won't get an event, so the window's
...@@ -1346,14 +1341,13 @@ void XWindow::NotifySwapAfterResize() { ...@@ -1346,14 +1341,13 @@ void XWindow::NotifySwapAfterResize() {
} }
} }
// Removes |delayed_resize_task_| from the task queue (if it's in // Removes |delayed_resize_task_| from the task queue (if it's in the queue) and
// the queue) and adds it back at the end of the queue. // adds it back at the end of the queue.
void XWindow::DispatchResize() { void XWindow::DispatchResize() {
if (update_counter_ == x11::Sync::Counter{} || if (update_counter_ == x11::Sync::Counter{} ||
configure_counter_value_ == 0) { configure_counter_value_ == 0) {
// WM doesn't support _NET_WM_SYNC_REQUEST. // WM doesn't support _NET_WM_SYNC_REQUEST. Or we are too slow, so
// Or we are too slow, so _NET_WM_SYNC_REQUEST is disabled by the // _NET_WM_SYNC_REQUEST is disabled by the compositor.
// compositor.
delayed_resize_task_.Reset(base::BindOnce( delayed_resize_task_.Reset(base::BindOnce(
&XWindow::DelayedResize, base::Unretained(this), bounds_in_pixels_)); &XWindow::DelayedResize, base::Unretained(this), bounds_in_pixels_));
base::ThreadTaskRunnerHandle::Get()->PostTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
......
...@@ -546,11 +546,10 @@ bool X11Window::HandleAsAtkEvent(x11::Event* x11_event) { ...@@ -546,11 +546,10 @@ bool X11Window::HandleAsAtkEvent(x11::Event* x11_event) {
#endif #endif
} }
// CheckCanDispatchNextPlatformEvent is called by X11EventSourceLibevent to // CheckCanDispatchNextPlatformEvent is called by X11EventSource so that
// determine whether X11Window instance (XEventDispatcher implementation) is // X11Window (XEventDispatcher implementation) can inspect |xev| and determine
// able to process next translated event sent by it. So, it's done through // whether it should be dispatched by this window once it gets translated into a
// |handle_next_event_| internal flag, used in subsequent CanDispatchEvent // PlatformEvent.
// call.
void X11Window::CheckCanDispatchNextPlatformEvent(x11::Event* xev) { void X11Window::CheckCanDispatchNextPlatformEvent(x11::Event* xev) {
if (is_shutting_down_) if (is_shutting_down_)
return; return;
......
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