Commit 1b268389 authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

Reland "fuchsia: Avoid unnecessary references to WindowEventFilter"

This reverts commit 8380640d.

> > fuchsia: Avoid unnecessary references to WindowEventFilter
> >
> > The link error I'm trying to avoid is this:
> >
> > [122->5/127 ~1] SOLINK ./libviews.so
> > FAILED: libviews.so libviews.so.TOC lib.unstripped/libviews.so
> > python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --strip=../../third_party/eu-strip/bin/eu-strip --sofile="./lib.unstripped/libviews.so" --tocfile="./libviews.so.TOC" --output="./libviews.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,-z,max-page-size=4096 -Wl,--icf=all -Wl,--color-diagnostics --target=aarch64-fuchsia -Wl,-z,stack-size=0x800000 -Wl,--no-as-needed -lfdio -Wl,--as-needed -Werror -Wl,--gdb-index -nostdlib++ --sysroot=../../third_party/fuchsia-sdk/sdk/arch/arm64/sysroot -L../../third_party/fuchsia-sdk/sdk/arch/arm64/lib -o "./lib.unstripped/libviews.so" -Wl,-soname="libviews.so" @"./libviews.so.rsp"
> > ld.lld: error: undefined symbol: views::WindowEventFilter::WindowEventFilter(views::DesktopWindowTreeHost*)
> > >>> referenced by memory:3118 (../../buildtools/third_party/libc++/trunk/include/memory:3118)
> > >>>               obj/ui/views/views/desktop_window_tree_host_platform.o:(views::DesktopWindowTreeHostPlatform::OnNativeWidgetCreated(views::Widget::InitParams const&))
> >
> > ld.lld: error: undefined symbol: views::WindowEventFilter::SetWmMoveResizeHandler(ui::WmMoveResizeHandler*)
> > >>> referenced by desktop_window_tree_host_platform.cc:106 (../../ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc:106)
> > >>>               obj/ui/views/views/desktop_window_tree_host_platform.o:(views::DesktopWindowTreeHostPlatform::OnNativeWidgetCreated(views::Widget::InitParams const&))
> > clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
> >
> > I'm not sure what the correct approach is; DesktopWindowTreeHostPlatform
> > depends on WindowEventFilter which uses LinuxUI.
> >
> > Since there's no available non-client area on Fuchsia currently, not
> > doing this seems correct for the time being. Or does Fuchsia really need
> > its own DesktopWindowTreeHostFuchsia implementation?
> >
> > Bug: 808287
> > Change-Id: I2af683415ea00147607eb4236540d8d3e8643603
> > Reviewed-on: https://chromium-review.googlesource.com/c/1298554
> > Commit-Queue: Scott Graham <scottmg@chromium.org>
> > Reviewed-by: Scott Violet <sky@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#602860}
>
> TBR=sky@chromium.org,scottmg@chromium.org,thomasanderson@chromium.org
>
> Change-Id: I00a7631118f58db9413c391416079c4f94a974ae
> Bug: 808287
> Reviewed-on: https://chromium-review.googlesource.com/c/1300101
> Reviewed-by: Scott Graham <scottmg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#602887}

TBR=sky@chromium.org,scottmg@chromium.org,thomasanderson@chromium.org

Change-Id: I3302a0dec267ebec369d53ec8906c1c31cd12ba0
Bug: 808287
Reviewed-on: https://chromium-review.googlesource.com/c/1300110
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602975}
parent ebfdce73
......@@ -1245,7 +1245,7 @@ source_set("views_interactive_ui_tests") {
"//ui/wm/public",
]
if (!is_chromeos && ((is_linux && !use_x11) || is_fuchsia)) {
if (!is_chromeos && (is_linux && !use_x11)) {
sources += [ "widget/desktop_aura/desktop_window_tree_host_platform_interactive_uitest.cc" ]
}
......
......@@ -96,6 +96,7 @@ void DesktopWindowTreeHostPlatform::OnNativeWidgetCreated(
const Widget::InitParams& params) {
native_widget_delegate_->OnNativeWidgetCreated(true);
#if defined(OS_LINUX)
// Setup a non_client_window_event_filter, which handles resize/move, double
// click and other events.
DCHECK(!non_client_window_event_filter_);
......@@ -108,6 +109,7 @@ void DesktopWindowTreeHostPlatform::OnNativeWidgetCreated(
non_client_window_event_filter_ = std::move(window_event_filter);
window()->AddPreTargetHandler(non_client_window_event_filter_.get());
#endif
}
void DesktopWindowTreeHostPlatform::OnWidgetInitDone() {}
......@@ -539,11 +541,13 @@ void DesktopWindowTreeHostPlatform::Relayout() {
}
void DesktopWindowTreeHostPlatform::RemoveNonClientEventFilter() {
#if defined(OS_LINUX)
if (!non_client_window_event_filter_)
return;
window()->RemovePreTargetHandler(non_client_window_event_filter_.get());
non_client_window_event_filter_.reset();
#endif
}
Widget* DesktopWindowTreeHostPlatform::GetWidget() {
......
......@@ -6,6 +6,7 @@
#define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_PLATFORM_H_
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "ui/aura/window_tree_host_platform.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
......@@ -120,8 +121,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostPlatform
bool is_active_ = false;
#if defined(OS_LINUX)
// A handler for events intended for non client area.
std::unique_ptr<WindowEventFilter> non_client_window_event_filter_;
#endif
base::WeakPtrFactory<DesktopWindowTreeHostPlatform> weak_factory_{this};
......
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