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
1=== modified file 'decorations/DecoratedWindow.cpp'
2--- decorations/DecoratedWindow.cpp 2015-02-03 10:28:30 +0000
3+++ decorations/DecoratedWindow.cpp 2015-08-07 18:54:26 +0000
4@@ -842,6 +842,11 @@
5 , impl_(new Impl(this, cwin))
6 {}
7
8+CompWindow* Window::GetCompWindow()
9+{
10+ return impl_->win_;
11+}
12+
13 void Window::Update()
14 {
15 impl_->Update();
16
17=== modified file 'decorations/DecoratedWindow.h'
18--- decorations/DecoratedWindow.h 2014-03-03 19:07:56 +0000
19+++ decorations/DecoratedWindow.h 2015-08-07 18:54:26 +0000
20@@ -45,6 +45,7 @@
21 nux::Property<bool> scaled;
22 nux::ROProperty<double> dpi_scale;
23
24+ CompWindow* GetCompWindow();
25 void Update();
26 void Undecorate();
27 void UpdateDecorationPosition();
28
29=== modified file 'decorations/DecorationsManager.cpp'
30--- decorations/DecorationsManager.cpp 2015-02-03 08:38:19 +0000
31+++ decorations/DecorationsManager.cpp 2015-08-07 18:54:26 +0000
32@@ -172,7 +172,7 @@
33 {
34 auto const& win = GetWindowByXid(xid);
35
36- if (win && !win->impl_->win_->hasUnmapReference())
37+ if (win && !win->GetCompWindow()->hasUnmapReference())
38 {
39 win->Update();
40 return true;
41@@ -306,6 +306,10 @@
42 return false;
43
44 auto const& win = GetWindowByFrame(event->xany.window);
45+ CompWindow* comp_window = win ? win->GetCompWindow() : nullptr;
46+
47+ if (comp_window && comp_window->defaultViewport() != screen->vp())
48+ return false;
49
50 // ButtonRelease events might happen also outside the frame window, in this
51 // case we must unset the mouse owner, wherever the event happens.