Commit f7ca9499 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Chromium LUCI CQ

[lacros] Send request to wayland-server only if WindowState changes

Send wayland request only if WindowState changes otherwise it
1. triggers IPC between server & client for a state management
2. calls the wl_display_flush.

It is observed that during an initial launch of lacros-browser
`maximize` request is sent twice from DesktopWindowTreeHostPlatform
adding IPC overhead.

This change will also handle minimize, fullscreen and restore
operations.

Bug: 1138978
Change-Id: Ia532c14ec0fa51f2a9e1e4093a0ded17e2610415
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626945Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#843435}
parent 6ecbf733
...@@ -372,9 +372,11 @@ void WaylandToplevelWindow::TriggerStateChanges() { ...@@ -372,9 +372,11 @@ void WaylandToplevelWindow::TriggerStateChanges() {
} }
void WaylandToplevelWindow::SetWindowState(PlatformWindowState state) { void WaylandToplevelWindow::SetWindowState(PlatformWindowState state) {
previous_state_ = state_; if (state_ != state) {
state_ = state; previous_state_ = state_;
TriggerStateChanges(); state_ = state;
TriggerStateChanges();
}
} }
WmMoveResizeHandler* WaylandToplevelWindow::AsWmMoveResizeHandler() { WmMoveResizeHandler* WaylandToplevelWindow::AsWmMoveResizeHandler() {
......
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