Merge lp:~unity-team/unity/trusty-1316265 into lp:unity/7.2

Proposed by Stephen M. Webb
Status: Rejected
Rejected by: Stephen M. Webb
Proposed branch: lp:~unity-team/unity/trusty-1316265
Merge into: lp:unity/7.2
Diff against target: 313 lines (+82/-41)
5 files modified
debian/changelog (+9/-0)
panel/PanelMenuView.cpp (+55/-36)
panel/PanelMenuView.h (+1/-1)
plugins/unityshell/src/unityshell.cpp (+14/-2)
unity-shared/PluginAdapter.cpp (+3/-2)
To merge this branch: bzr merge lp:~unity-team/unity/trusty-1316265
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+244070@code.launchpad.net

Commit message

UnityScreen: when filtering out windows in spread, make sure we unscale them

Description of the change

UnityScreen: when filtering out windows in spread, make sure we unscale them (lp: #1316265).
PanelMenuView: ensure that proper window tiles and buttons are shown at the right place lp: #1384910, #1384958, #1385285).

This change is cherry-picked from trunk for SRUing into Ubuntu 14.04 LTS.

To post a comment you must log in.
lp:~unity-team/unity/trusty-1316265 updated
3807. By Stephen M. Webb

PanelMenuView: ensure that proper window tiles and buttons are shown at
the right place (lp: #1384910) (lp: #1384958) (lp: #1385285)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-26 13:49:00 +0000
3+++ debian/changelog 2014-12-09 19:48:01 +0000
4@@ -1,3 +1,12 @@
5+unity (7.2.3+14.04.20140826-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * UnityScreen: when filtering out windows in spread, make sure we unscale
8+ them (lp: #1316265).
9+ * PanelMenuView: ensure that proper window tiles and buttons are shown at
10+ the right place (lp: #1384910) (lp: #1384958) (lp: #1385285)
11+
12+ -- Marco Trevisan (TreviƱo) <mail@3v1n0.net> Mon, 08 Dec 2014 18:19:38 -0500
13+
14 unity (7.2.3+14.04.20140826-0ubuntu1) trusty; urgency=medium
15
16 [ Andrea Azzarone ]
17
18=== modified file 'panel/PanelMenuView.cpp'
19--- panel/PanelMenuView.cpp 2014-04-02 21:42:44 +0000
20+++ panel/PanelMenuView.cpp 2014-12-09 19:48:01 +0000
21@@ -249,6 +249,9 @@
22 if (!mouse_inside)
23 return nullptr;
24
25+ if (WindowManager::Default().IsExpoActive())
26+ return nullptr;
27+
28 Area* found_area = nullptr;
29
30 if (!integrated_menus_ && !we_control_active_ && !spread_showing_)
31@@ -360,14 +363,12 @@
32
33 bool PanelMenuView::ShouldDrawButtons() const
34 {
35+ if (spread_showing_)
36+ return true;
37+
38 if (integrated_menus_)
39 {
40- if (spread_showing_)
41- return true;
42-
43- WindowManager& wm = WindowManager::Default();
44-
45- if (!wm.IsExpoActive() && !wm.IsScaleActive())
46+ if (!WindowManager::Default().IsExpoActive())
47 return (GetMaximizedWindow() != 0);
48
49 return false;
50@@ -375,9 +376,7 @@
51
52 if (we_control_active_ && is_maximized_ && !launcher_keynav_ && !switcher_showing_)
53 {
54- WindowManager& wm = WindowManager::Default();
55-
56- if (!wm.IsExpoActive())
57+ if (!WindowManager::Default().IsExpoActive())
58 {
59 if (is_inside_ || show_now_activated_ || new_application_)
60 return true;
61@@ -387,9 +386,6 @@
62 }
63 }
64
65- if (spread_showing_)
66- return true;
67-
68 return false;
69 }
70
71@@ -795,7 +791,7 @@
72 auto state = WidgetState::NORMAL;
73 float dpi_scale = Settings::Instance().em(monitor_)->DPIScale();
74
75- if (integrated_menus_ && !is_desktop_focused_ && !WindowManager::Default().IsScaleActive())
76+ if (integrated_menus_ && !is_desktop_focused_ && !WindowManager::Default().IsExpoActive())
77 {
78 title_geo_.x = geo.x + window_buttons_->GetBaseWidth() + (style->TitleIndent() * dpi_scale);
79
80@@ -828,10 +824,9 @@
81 {
82 if (integrated_menus_ || (!switcher_showing_ && !launcher_keynav_))
83 {
84- WindowManager& wm = WindowManager::Default();
85 std::string new_title;
86
87- if (wm.IsExpoActive())
88+ if (WindowManager::Default().IsExpoActive())
89 {
90 new_title = desktop_name_;
91 }
92@@ -1103,7 +1098,10 @@
93 }
94
95 if (is_maximized_)
96- maximized_set_.insert(active_xid_);
97+ {
98+ maximized_wins_.erase(std::remove(maximized_wins_.begin(), maximized_wins_.end(), active_xid_), maximized_wins_.end());
99+ maximized_wins_.push_front(active_xid_);
100+ }
101
102 // register callback for new view
103 view_name_changed_signal_.Connect(new_view, "name-changed",
104@@ -1159,7 +1157,7 @@
105
106 void PanelMenuView::OnWindowMinimized(Window xid)
107 {
108- maximized_set_.erase(xid);
109+ maximized_wins_.erase(std::remove(maximized_wins_.begin(), maximized_wins_.end(), xid), maximized_wins_.end());
110
111 if (xid == active_xid_)
112 {
113@@ -1175,18 +1173,24 @@
114
115 void PanelMenuView::OnWindowUnminimized(Window xid)
116 {
117- if (WindowManager::Default().IsWindowMaximized(xid))
118- maximized_set_.insert(xid);
119-
120 if (xid == active_xid_)
121 {
122+ if (WindowManager::Default().IsWindowMaximized(xid))
123+ maximized_wins_.push_front(xid);
124+
125 if (Refresh())
126 QueueDraw();
127 }
128- else if (integrated_menus_ && IsWindowUnderOurControl(xid))
129+ else
130 {
131- if (Refresh())
132- QueueDraw();
133+ if (WindowManager::Default().IsWindowMaximized(xid))
134+ maximized_wins_.push_back(xid);
135+
136+ if (integrated_menus_ && IsWindowUnderOurControl(xid))
137+ {
138+ if (Refresh())
139+ QueueDraw();
140+ }
141 }
142 }
143
144@@ -1194,7 +1198,7 @@
145 {
146 // FIXME: compiz doesn't give us a valid xid (is always 0 on unmap)
147 // we need to do this again on BamfView closed signal.
148- maximized_set_.erase(xid);
149+ maximized_wins_.erase(std::remove(maximized_wins_.begin(), maximized_wins_.end(), xid), maximized_wins_.end());
150
151 if (xid == active_xid_)
152 {
153@@ -1212,22 +1216,26 @@
154 {
155 if (WindowManager::Default().IsWindowMaximized(xid))
156 {
157- maximized_set_.insert(xid);
158-
159 if (xid == active_xid_)
160 {
161+ maximized_wins_.push_front(xid);
162+
163 if (Refresh())
164 QueueDraw();
165 }
166+ else
167+ {
168+ maximized_wins_.push_back(xid);
169+ }
170 }
171 }
172
173 void PanelMenuView::OnWindowMaximized(Window xid)
174 {
175- maximized_set_.insert(xid);
176-
177 if (xid == active_xid_)
178 {
179+ maximized_wins_.push_front(xid);
180+
181 // We need to update the is_inside_ state in the case of maximization by grab
182 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
183 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
184@@ -1236,16 +1244,21 @@
185 if (Refresh())
186 FullRedraw();
187 }
188- else if (integrated_menus_ && IsWindowUnderOurControl(xid))
189+ else
190 {
191- if (Refresh())
192- QueueDraw();
193+ maximized_wins_.push_back(xid);
194+
195+ if (integrated_menus_ && IsWindowUnderOurControl(xid))
196+ {
197+ if (Refresh())
198+ QueueDraw();
199+ }
200 }
201 }
202
203 void PanelMenuView::OnWindowRestored(Window xid)
204 {
205- maximized_set_.erase(xid);
206+ maximized_wins_.erase(std::remove(maximized_wins_.begin(), maximized_wins_.end(), xid), maximized_wins_.end());
207
208 if (active_xid_ == xid)
209 {
210@@ -1344,7 +1357,7 @@
211 Window window_xid = 0;
212
213 // Find the front-most of the maximized windows we are controlling
214- for (auto xid : maximized_set_)
215+ for (auto xid : maximized_wins_)
216 {
217 // We can safely assume only the front-most is visible
218 if (IsValidWindow(xid))
219@@ -1769,8 +1782,8 @@
220 {
221 PanelIndicatorsView::SetMonitor(monitor);
222
223+ maximized_wins_.clear();
224 monitor_geo_ = UScreen::GetDefault()->GetMonitorGeometry(monitor_);
225- maximized_set_.clear();
226 GList* windows = bamf_matcher_get_window_stack_for_monitor(matcher_, monitor_);
227
228 for (GList* l = windows; l; l = l->next)
229@@ -1780,12 +1793,18 @@
230
231 auto window = static_cast<BamfWindow*>(l->data);
232 auto view = static_cast<BamfView*>(l->data);
233+ auto xid = bamf_window_get_xid(window);
234
235 if (bamf_view_is_active(view))
236- active_xid_ = bamf_window_get_xid(window);
237+ active_xid_ = xid;
238
239 if (bamf_window_maximized(window) == BAMF_WINDOW_MAXIMIZED)
240- maximized_set_.insert(bamf_window_get_xid(window));
241+ {
242+ if (xid == active_xid_)
243+ maximized_wins_.push_front(xid);
244+ else
245+ maximized_wins_.push_back(xid);
246+ }
247 }
248
249 Window maximized = GetMaximizedWindow();
250
251=== modified file 'panel/PanelMenuView.h'
252--- panel/PanelMenuView.h 2014-04-02 21:42:44 +0000
253+++ panel/PanelMenuView.h 2014-12-09 19:48:01 +0000
254@@ -170,7 +170,7 @@
255 bool is_desktop_focused_;
256
257 PanelIndicatorEntryView* last_active_view_;
258- std::set<Window> maximized_set_;
259+ std::deque<Window> maximized_wins_;
260 glib::Object<BamfApplication> new_application_;
261 std::list<glib::Object<BamfApplication>> new_apps_;
262 std::string panel_title_;
263
264=== modified file 'plugins/unityshell/src/unityshell.cpp'
265--- plugins/unityshell/src/unityshell.cpp 2014-08-06 14:19:10 +0000
266+++ plugins/unityshell/src/unityshell.cpp 2014-12-09 19:48:01 +0000
267@@ -534,7 +534,19 @@
268 else
269 {
270 CompMatch windows_match;
271- for (auto xid : spread_filter_->FilteredWindows())
272+ auto const& filtered_windows = spread_filter_->FilteredWindows();
273+
274+ for (auto const& swin : sScreen->getWindows())
275+ {
276+ if (filtered_windows.find(swin->window->id()) != filtered_windows.end())
277+ continue;
278+
279+ auto* uwin = UnityWindow::get(swin->window);
280+ uwin->OnTerminateSpread();
281+ fake_decorated_windows_.erase(uwin);
282+ }
283+
284+ for (auto xid : filtered_windows)
285 windows_match |= "xid="+std::to_string(xid);
286
287 auto match = sScreen->getCustomMatch();
288@@ -4428,7 +4440,7 @@
289 }
290 else
291 {
292- window->setShowDesktopMode (false);
293+ window->setShowDesktopMode(false);
294 }
295 }
296 }
297
298=== modified file 'unity-shared/PluginAdapter.cpp'
299--- unity-shared/PluginAdapter.cpp 2014-08-06 14:11:17 +0000
300+++ unity-shared/PluginAdapter.cpp 2014-12-09 19:48:01 +0000
301@@ -554,9 +554,10 @@
302
303 bool PluginAdapter::IsWindowObscured(Window window_id) const
304 {
305- CompWindow* window = m_Screen->findWindow(window_id);
306+ if (_spread_state)
307+ return false;
308
309- if (window)
310+ if (CompWindow* window = m_Screen->findWindow(window_id))
311 {
312 if (window->inShowDesktopMode())
313 return true;

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: