Merge lp:~azzar1/unity/fix-lp-1449654 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3997
Proposed branch: lp:~azzar1/unity/fix-lp-1449654
Merge into: lp:unity
Prerequisite: lp:~azzar1/unity/cmake-3
Diff against target: 51 lines (+11/-1)
3 files modified
decorations/DecoratedWindow.cpp (+5/-0)
decorations/DecoratedWindow.h (+1/-0)
decorations/DecorationsManager.cpp (+5/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-lp-1449654
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+267382@code.launchpad.net

Commit message

Do not handle events coming from viewports not actually containing the window.

Description of the change

Do not handle events coming from viewports not actually containing the window.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good, thanks

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'decorations/DecoratedWindow.cpp'
--- decorations/DecoratedWindow.cpp 2015-02-03 10:28:30 +0000
+++ decorations/DecoratedWindow.cpp 2015-08-07 18:54:26 +0000
@@ -842,6 +842,11 @@
842 , impl_(new Impl(this, cwin))842 , impl_(new Impl(this, cwin))
843{}843{}
844844
845CompWindow* Window::GetCompWindow()
846{
847 return impl_->win_;
848}
849
845void Window::Update()850void Window::Update()
846{851{
847 impl_->Update();852 impl_->Update();
848853
=== modified file 'decorations/DecoratedWindow.h'
--- decorations/DecoratedWindow.h 2014-03-03 19:07:56 +0000
+++ decorations/DecoratedWindow.h 2015-08-07 18:54:26 +0000
@@ -45,6 +45,7 @@
45 nux::Property<bool> scaled;45 nux::Property<bool> scaled;
46 nux::ROProperty<double> dpi_scale;46 nux::ROProperty<double> dpi_scale;
4747
48 CompWindow* GetCompWindow();
48 void Update();49 void Update();
49 void Undecorate();50 void Undecorate();
50 void UpdateDecorationPosition();51 void UpdateDecorationPosition();
5152
=== modified file 'decorations/DecorationsManager.cpp'
--- decorations/DecorationsManager.cpp 2015-02-03 08:38:19 +0000
+++ decorations/DecorationsManager.cpp 2015-08-07 18:54:26 +0000
@@ -172,7 +172,7 @@
172{172{
173 auto const& win = GetWindowByXid(xid);173 auto const& win = GetWindowByXid(xid);
174174
175 if (win && !win->impl_->win_->hasUnmapReference())175 if (win && !win->GetCompWindow()->hasUnmapReference())
176 {176 {
177 win->Update();177 win->Update();
178 return true;178 return true;
@@ -306,6 +306,10 @@
306 return false;306 return false;
307307
308 auto const& win = GetWindowByFrame(event->xany.window);308 auto const& win = GetWindowByFrame(event->xany.window);
309 CompWindow* comp_window = win ? win->GetCompWindow() : nullptr;
310
311 if (comp_window && comp_window->defaultViewport() != screen->vp())
312 return false;
309313
310 // ButtonRelease events might happen also outside the frame window, in this314 // ButtonRelease events might happen also outside the frame window, in this
311 // case we must unset the mouse owner, wherever the event happens.315 // case we must unset the mouse owner, wherever the event happens.