Commit 9f396dd7 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Prevent sending client area for custom-frame widgets

When custom frame is used for a widget, the "client area" shouldn't
be sent based on the client-area, otherwise the located event on the
frame will be handled incorrectly.

With this CL, DesktopWindowTreeHostMus checks remove_standard_frame
of Widget::InitParams and adopts that behavior, thus dialogs of
using custom frame and bubbles will not send client area anymore.

This property is already used in BrowserFrameMash, so
set_auto_update_client_area method is now gone.

Bug: 935338
Test: manually
Change-Id: I285954a53fea3f9f32d2fc24847cd869e5d5f939
Reviewed-on: https://chromium-review.googlesource.com/c/1488179
Auto-Submit: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636248}
parent e7b9461f
......@@ -88,9 +88,6 @@ views::Widget::InitParams BrowserFrameMash::GetWidgetParams() {
std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host =
std::make_unique<views::DesktopWindowTreeHostMus>(
std::move(window_tree_host_init_params), browser_frame_, this);
// BrowserNonClientFrameViewAsh::OnBoundsChanged() takes care of updating
// the insets.
desktop_window_tree_host->set_auto_update_client_area(false);
SetDesktopWindowTreeHost(std::move(desktop_window_tree_host));
return params;
}
......
......@@ -66,6 +66,7 @@ Widget* CreateBubbleWidget(BubbleDialogDelegateView* bubble) {
? Widget::InitParams::TRANSLUCENT_WINDOW
: Widget::InitParams::OPAQUE_WINDOW;
bubble_params.accept_events = bubble->accept_events();
bubble_params.remove_standard_frame = true;
// Use a window default shadow if the bubble doesn't provides its own.
if (bubble->GetShadow() == BubbleBorder::NO_ASSETS)
bubble_params.shadow_type = Widget::InitParams::SHADOW_TYPE_DEFAULT;
......
......@@ -345,6 +345,11 @@ void DesktopWindowTreeHostMus::Init(const Widget::InitParams& params) {
SetBoundsInDIP(params.bounds);
}
// If the standard frame is not used, the frame area (rendered by the client)
// should be handled by the client, so it shouldn't update the client area
// by itself. See https://crbug.com/935338.
auto_update_client_area_ = !params.remove_standard_frame;
cursor_manager_owner_ = std::make_unique<CursorManagerOwner>(window());
InitHost();
......
......@@ -40,11 +40,6 @@ class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus
// Called when the window was deleted on the server.
void ServerDestroyedWindow() { CloseNow(); }
// Controls whether the client area is automatically updated as necessary.
void set_auto_update_client_area(bool value) {
auto_update_client_area_ = value;
}
private:
class WindowTreeHostWindowObserver;
......
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