diff options
| author | Andrea Azzarone andrea.azzarone@canonical.com <> | 2015-08-25 08:15:42 +0000 |
|---|---|---|
| committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-08-25 08:15:42 +0000 |
| commit | d221a8aac60548c203c586e74944d8cdb99bbb2c (patch) | |
| tree | 9903854c2e132961f9aaeafcd2160c30d7125b24 | |
| parent | e531bc09d353cc08ab0ee48cf0156299532b29e1 (diff) | |
| parent | 2cb2003999a11a642573831eab465bd0cd3ef597 (diff) | |
Do not handle events coming from viewports not actually containing the window. Fixes: #1449654
Approved by: PS Jenkins bot, Marco Trevisan (TreviƱo) (bzr r3997)
| -rw-r--r-- | decorations/DecoratedWindow.cpp | 5 | ||||
| -rw-r--r-- | decorations/DecoratedWindow.h | 1 | ||||
| -rw-r--r-- | decorations/DecorationsManager.cpp | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/decorations/DecoratedWindow.cpp b/decorations/DecoratedWindow.cpp index ea43f900a..b58a56c5a 100644 --- a/decorations/DecoratedWindow.cpp +++ b/decorations/DecoratedWindow.cpp @@ -842,6 +842,11 @@ Window::Window(CompWindow* cwin) , impl_(new Impl(this, cwin)) {} +CompWindow* Window::GetCompWindow() +{ + return impl_->win_; +} + void Window::Update() { impl_->Update(); diff --git a/decorations/DecoratedWindow.h b/decorations/DecoratedWindow.h index be49be600..893a6e0f3 100644 --- a/decorations/DecoratedWindow.h +++ b/decorations/DecoratedWindow.h @@ -45,6 +45,7 @@ public: nux::Property<bool> scaled; nux::ROProperty<double> dpi_scale; + CompWindow* GetCompWindow(); void Update(); void Undecorate(); void UpdateDecorationPosition(); diff --git a/decorations/DecorationsManager.cpp b/decorations/DecorationsManager.cpp index 1b90d885f..e859850c9 100644 --- a/decorations/DecorationsManager.cpp +++ b/decorations/DecorationsManager.cpp @@ -172,7 +172,7 @@ bool Manager::Impl::UpdateWindow(::Window xid) { auto const& win = GetWindowByXid(xid); - if (win && !win->impl_->win_->hasUnmapReference()) + if (win && !win->GetCompWindow()->hasUnmapReference()) { win->Update(); return true; @@ -306,6 +306,10 @@ bool Manager::Impl::HandleFrameEvent(XEvent* event) return false; auto const& win = GetWindowByFrame(event->xany.window); + CompWindow* comp_window = win ? win->GetCompWindow() : nullptr; + + if (comp_window && comp_window->defaultViewport() != screen->vp()) + return false; // ButtonRelease events might happen also outside the frame window, in this // case we must unset the mouse owner, wherever the event happens. |
