Merge lp:~unity-team/unity/x-sru4 into lp:unity/7.4
- x-sru4
- Merge into xenial
Proposed by
Marco Trevisan (Treviño)
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4113 |
Proposed branch: | lp:~unity-team/unity/x-sru4 |
Merge into: | lp:unity/7.4 |
Diff against target: |
1517 lines (+607/-196) 26 files modified
dash/FilterExpanderLabel.cpp (+8/-0) dash/FilterExpanderLabel.h (+1/-0) debian/changelog (+43/-0) decorations/DecoratedWindow.cpp (+29/-1) decorations/DecoratedWindow.h (+1/-0) decorations/DecorationsForceQuitDialog.cpp (+7/-7) decorations/DecorationsPriv.h (+3/-0) decorations/DecorationsWindowButton.cpp (+34/-15) decorations/DecorationsWindowButton.h (+2/-1) launcher/SwitcherController.cpp (+3/-2) launcher/SwitcherView.cpp (+9/-2) lockscreen/UserAuthenticatorPam.cpp (+3/-2) panel/PanelMenuView.cpp (+1/-1) panel/PanelView.cpp (+3/-0) plugins/unityshell/src/unityshell.cpp (+28/-14) plugins/unityshell/src/unityshell.h (+2/-2) shutdown/SessionView.cpp (+0/-8) unity-shared/CMakeLists.txt (+1/-0) unity-shared/DashStyle.cpp (+42/-82) unity-shared/DashStyle.h (+10/-14) unity-shared/DecorationStyle.cpp (+6/-1) unity-shared/OverlayRenderer.cpp (+113/-42) unity-shared/PluginAdapter.cpp (+1/-1) unity-shared/SpreadWidgets.cpp (+195/-0) unity-shared/SpreadWidgets.h (+48/-0) unity-shared/WindowButtons.cpp (+14/-1) |
To merge this branch: | bzr merge lp:~unity-team/unity/x-sru4 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+303691@code.launchpad.net |
Commit message
Releasing SRU4 for Ubuntu 16.04
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'dash/FilterExpanderLabel.cpp' |
2 | --- dash/FilterExpanderLabel.cpp 2015-05-08 04:24:43 +0000 |
3 | +++ dash/FilterExpanderLabel.cpp 2016-09-06 23:15:10 +0000 |
4 | @@ -273,6 +273,14 @@ |
5 | graphics_engine.PopClippingRectangle(); |
6 | } |
7 | |
8 | +nux::Area* FilterExpanderLabel::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) |
9 | +{ |
10 | + if (event_type == nux::EVENT_MOUSE_WHEEL) |
11 | + return nullptr; |
12 | + else |
13 | + return nux::View::FindAreaUnderMouse(mouse_position, event_type); |
14 | +} |
15 | + |
16 | // |
17 | // Key navigation |
18 | // |
19 | |
20 | === modified file 'dash/FilterExpanderLabel.h' |
21 | --- dash/FilterExpanderLabel.h 2015-05-05 02:03:52 +0000 |
22 | +++ dash/FilterExpanderLabel.h 2016-09-06 23:15:10 +0000 |
23 | @@ -69,6 +69,7 @@ |
24 | nux::Property<bool> expanded; |
25 | |
26 | protected: |
27 | + nux::Area* FindAreaUnderMouse(const nux::Point&, nux::NuxEventType) override; |
28 | virtual bool AcceptKeyNavFocus(); |
29 | virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); |
30 | virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw); |
31 | |
32 | === modified file 'debian/changelog' |
33 | --- debian/changelog 2016-08-01 13:10:28 +0000 |
34 | +++ debian/changelog 2016-09-06 23:15:10 +0000 |
35 | @@ -1,3 +1,46 @@ |
36 | +unity (7.4.0+16.04.20160801.2-0ubuntu2) UNRELEASED; urgency=medium |
37 | + |
38 | + [ Marco Trevisan (Treviño) ] |
39 | + * SwitcherView: always disable animations when in lowgfx mode (LP: |
40 | + #1602784) |
41 | + |
42 | + [ Andrea Azzarone ] |
43 | + * When locked discard damages from windows below lockscreen. (LP: |
44 | + #1605180) |
45 | + * DecoratedWindow: display unmaximize button if the window is |
46 | + vertically or horizontally maximized (LP: #1608480) |
47 | + * Make sure the switcher detail view is properly scaled. Also scale |
48 | + the xy_offset to make sure the switcher and launcher do not overlap. |
49 | + (LP: #1605256) |
50 | + * Close session dialog on first ESC. (LP: #1521116) |
51 | + * Filter out scrolling envents for FilterExpanderLabel. (LP: #1604632) |
52 | + * Disable menu discovery animation if MenusDiscoveryDuration is 0. |
53 | + (LP: #942962) |
54 | + * Redraw fake decorations on window resize. (LP: #940470) |
55 | + * Use compiz::Window::serverNext instead of compiz::Window::next in |
56 | + IsWindowObscured as the latter can be outdated just after |
57 | + scale/spread terminates. (LP: #1614116) |
58 | + |
59 | + [ Marco Trevisan (Treviño) ] |
60 | + * DecoratedWindow: avoid deferencing an invalid shadow texture ptr, |
61 | + and split functions (LP: #1608464) |
62 | + * DecoratedWindow: display unmaximize button if the window is |
63 | + vertically or horizontally maximized (LP: #1608480) |
64 | + * DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20 |
65 | + * UserAuthenticatorPam: ensure pam_handle_ is null initialized and |
66 | + don't proceed if not set (LP: #1611668) |
67 | + * DecorationStyle: set css name for Gtk 3.20 |
68 | + * OverlayRenderer: properly decorate launcher/panel when the launcher |
69 | + is at the bottom (LP: #1611694) |
70 | + * OverlayRenderer: don't use rotated textures, just rotate them at |
71 | + rendering time |
72 | + * SpreadWidgets: add container for spread filter and new spread |
73 | + decorations (LP: #1283314) |
74 | + * WindowButton: properly partially unmaximize a window when |
75 | + middle/left clicking in the restore button (LP: #1616136) |
76 | + |
77 | + -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 23 Aug 2016 17:00:35 +0200 |
78 | + |
79 | unity (7.4.0+16.04.20160801.2-0ubuntu1) xenial; urgency=medium |
80 | |
81 | [ Andrea Azzarone ] |
82 | |
83 | === modified file 'decorations/DecoratedWindow.cpp' |
84 | --- decorations/DecoratedWindow.cpp 2016-08-01 13:03:39 +0000 |
85 | +++ decorations/DecoratedWindow.cpp 2016-09-06 23:15:10 +0000 |
86 | @@ -148,6 +148,23 @@ |
87 | bg_textures_.clear(); |
88 | } |
89 | |
90 | +void Window::Impl::UpdateWindowState(unsigned old_state) |
91 | +{ |
92 | + Update(); |
93 | + |
94 | + if (state_change_button_) |
95 | + { |
96 | + if (win_->state() & (CompWindowStateMaximizedVertMask|CompWindowStateMaximizedHorzMask)) |
97 | + { |
98 | + state_change_button_->type = WindowButtonType::UNMAXIMIZE; |
99 | + } |
100 | + else |
101 | + { |
102 | + state_change_button_->type = WindowButtonType::MAXIMIZE; |
103 | + } |
104 | + } |
105 | +} |
106 | + |
107 | void Window::Impl::UnsetExtents() |
108 | { |
109 | if (win_->hasUnmapReference()) |
110 | @@ -410,7 +427,13 @@ |
111 | top_layout_->Append(std::make_shared<WindowButton>(win_, WindowButtonType::MINIMIZE)); |
112 | |
113 | if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask)) |
114 | - top_layout_->Append(std::make_shared<WindowButton>(win_, WindowButtonType::MAXIMIZE)); |
115 | + { |
116 | + auto type = (win_->state() & (CompWindowStateMaximizedVertMask|CompWindowStateMaximizedHorzMask)) ? |
117 | + WindowButtonType::UNMAXIMIZE : WindowButtonType::MAXIMIZE; |
118 | + auto state_change_button = std::make_shared<WindowButton>(win_, type); |
119 | + top_layout_->Append(state_change_button); |
120 | + state_change_button_ = state_change_button; |
121 | + } |
122 | |
123 | auto title = std::make_shared<Title>(); |
124 | title->text = last_title_.empty() ? WindowManager::Default().GetWindowName(win_->id()) : last_title_; |
125 | @@ -1003,6 +1026,11 @@ |
126 | impl_->Update(); |
127 | } |
128 | |
129 | +void Window::UpdateWindowState(unsigned old_state) |
130 | +{ |
131 | + impl_->UpdateWindowState(old_state); |
132 | +} |
133 | + |
134 | void Window::UpdateFrameRegion(CompRegion& r) |
135 | { |
136 | if (impl_->frame_region_.isEmpty()) |
137 | |
138 | === modified file 'decorations/DecoratedWindow.h' |
139 | --- decorations/DecoratedWindow.h 2016-08-01 08:50:22 +0000 |
140 | +++ decorations/DecoratedWindow.h 2016-09-06 23:15:10 +0000 |
141 | @@ -53,6 +53,7 @@ |
142 | void UpdateDecorationPositionDelayed(); |
143 | void UpdateFrameRegion(CompRegion&); |
144 | void UpdateOutputExtents(compiz::window::extents::Extents&); |
145 | + void UpdateWindowState(unsigned old_state); |
146 | void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); |
147 | void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); |
148 | |
149 | |
150 | === modified file 'decorations/DecorationsForceQuitDialog.cpp' |
151 | --- decorations/DecorationsForceQuitDialog.cpp 2016-03-22 15:29:31 +0000 |
152 | +++ decorations/DecorationsForceQuitDialog.cpp 2016-09-06 23:15:10 +0000 |
153 | @@ -279,7 +279,7 @@ |
154 | int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom}); |
155 | |
156 | gtk_css_provider_load_from_data(style, (R"( |
157 | - SheetStyleDialog { |
158 | + SheetStyleDialog, sheet-style-dialog { |
159 | background-color: #f7f6f5; |
160 | color: #4a4a4a; |
161 | border-radius: )"+std::to_string(decoration_radius)+R"(px; |
162 | @@ -291,7 +291,7 @@ |
163 | std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(; |
164 | } |
165 | |
166 | - SheetStyleDialog:backdrop { |
167 | + SheetStyleDialog:backdrop, sheet-style-dialog:backdrop { |
168 | background-color: shade(#f7f6f5, 1.2); |
169 | color: shade(#4a4a4a, 1.5); |
170 | border-radius: )"+std::to_string(decoration_radius)+R"(px; |
171 | @@ -327,10 +327,7 @@ |
172 | |
173 | auto* title = gtk_label_new(_("This window is not responding")); |
174 | glib::Object<GtkCssProvider> title_style(gtk_css_provider_new()); |
175 | - gtk_css_provider_load_from_data(title_style, (R"( |
176 | - GtkLabel { |
177 | - font-size: 17px; |
178 | - })"), -1, nullptr); |
179 | + gtk_css_provider_load_from_data(title_style, (R"(* { font-size: 17px; })"), -1, nullptr); |
180 | style_ctx = gtk_widget_get_style_context(title); |
181 | gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
182 | gtk_style_context_add_class(style_ctx, "unity-force-quit"); |
183 | @@ -377,6 +374,10 @@ |
184 | gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height); |
185 | return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr); |
186 | }; |
187 | + |
188 | +#if GTK_CHECK_VERSION(3, 20, 0) |
189 | + gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "sheet-style-dialog"); |
190 | +#endif |
191 | } |
192 | |
193 | // Close button |
194 | @@ -384,7 +385,6 @@ |
195 | { |
196 | auto* self = GTK_WIDGET(g_object_new(close_button_get_type(), nullptr)); |
197 | gtk_button_set_relief(GTK_BUTTON(self), GTK_RELIEF_NONE); |
198 | - gtk_button_set_focus_on_click(GTK_BUTTON(self), FALSE); |
199 | gtk_widget_set_can_focus(self, FALSE); |
200 | gtk_widget_set_halign(self, GTK_ALIGN_START); |
201 | |
202 | |
203 | === modified file 'decorations/DecorationsPriv.h' |
204 | --- decorations/DecorationsPriv.h 2016-08-01 13:03:39 +0000 |
205 | +++ decorations/DecorationsPriv.h 2016-09-06 23:15:10 +0000 |
206 | @@ -49,6 +49,7 @@ |
207 | class MenuLayout; |
208 | class SlidingLayout; |
209 | class ForceQuitDialog; |
210 | +class WindowButton; |
211 | |
212 | namespace cu = compiz_utils; |
213 | |
214 | @@ -103,6 +104,7 @@ |
215 | void SetupExtents(); |
216 | void ComputeBorderExtent(CompWindowExtents &border); |
217 | void UpdateElements(cu::WindowFilter wf = cu::WindowFilter::NONE); |
218 | + void UpdateWindowState(unsigned old_state); |
219 | void UpdateClientDecorationsState(); |
220 | void UpdateMonitor(); |
221 | void UpdateFrame(); |
222 | @@ -166,6 +168,7 @@ |
223 | std::shared_ptr<ForceQuitDialog> force_quit_; |
224 | InputMixer::Ptr input_mixer_; |
225 | Layout::Ptr top_layout_; |
226 | + uweak_ptr<WindowButton> state_change_button_; |
227 | uweak_ptr<MenuLayout> menus_; |
228 | uweak_ptr<Title> title_; |
229 | uweak_ptr<SlidingLayout> sliding_layout_; |
230 | |
231 | === modified file 'decorations/DecorationsWindowButton.cpp' |
232 | --- decorations/DecorationsWindowButton.cpp 2014-02-27 07:11:16 +0000 |
233 | +++ decorations/DecorationsWindowButton.cpp 2016-09-06 23:15:10 +0000 |
234 | @@ -29,8 +29,8 @@ |
235 | namespace decoration |
236 | { |
237 | |
238 | -WindowButton::WindowButton(CompWindow* win, WindowButtonType type) |
239 | - : type_(type) |
240 | +WindowButton::WindowButton(CompWindow* win, WindowButtonType wbt) |
241 | + : type(wbt) |
242 | , pressed_(false) |
243 | , was_pressed_(false) |
244 | , win_(win) |
245 | @@ -39,12 +39,13 @@ |
246 | mouse_owner.changed.connect(cb); |
247 | focused.changed.connect(cb); |
248 | scale.changed.connect(cb); |
249 | + type.changed.connect(cb); |
250 | UpdateTexture(); |
251 | } |
252 | |
253 | void WindowButton::UpdateTexture() |
254 | { |
255 | - SetTexture(DataPool::Get()->ButtonTexture(scale(), type_, GetCurrentState())); |
256 | + SetTexture(DataPool::Get()->ButtonTexture(scale(), type(), GetCurrentState())); |
257 | } |
258 | |
259 | WidgetState WindowButton::GetCurrentState() const |
260 | @@ -98,7 +99,7 @@ |
261 | pressed_ = false; |
262 | UpdateTexture(); |
263 | |
264 | - switch (type_) |
265 | + switch (type()) |
266 | { |
267 | case WindowButtonType::CLOSE: |
268 | if (win_->actions() & CompWindowActionCloseMask) |
269 | @@ -112,32 +113,50 @@ |
270 | switch (button) |
271 | { |
272 | case Button1: |
273 | - if ((win_->state() & CompWindowStateMaximizedVertMask) || |
274 | - (win_->state() & CompWindowStateMaximizedHorzMask)) |
275 | - win_->maximize(0); |
276 | - else if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask)) |
277 | + if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask)) |
278 | win_->maximize(MAXIMIZE_STATE); |
279 | break; |
280 | case Button2: |
281 | if (win_->actions() & CompWindowActionMaximizeVertMask) |
282 | { |
283 | if (!(win_->state() & CompWindowStateMaximizedVertMask)) |
284 | - win_->maximize(CompWindowStateMaximizedVertMask); |
285 | - else |
286 | - win_->maximize(0); |
287 | + win_->maximize(win_->state() | CompWindowStateMaximizedVertMask); |
288 | } |
289 | break; |
290 | case Button3: |
291 | if (win_->actions() & CompWindowActionMaximizeHorzMask) |
292 | { |
293 | if (!(win_->state() & CompWindowStateMaximizedHorzMask)) |
294 | - win_->maximize(CompWindowStateMaximizedHorzMask); |
295 | - else |
296 | - win_->maximize(0); |
297 | + win_->maximize(win_->state() | CompWindowStateMaximizedHorzMask); |
298 | } |
299 | break; |
300 | } |
301 | break; |
302 | + case WindowButtonType::UNMAXIMIZE: |
303 | + switch (button) |
304 | + { |
305 | + case Button1: |
306 | + win_->maximize(0); |
307 | + break; |
308 | + case Button2: |
309 | + if (win_->actions() & CompWindowActionMaximizeVertMask) |
310 | + { |
311 | + if (!(win_->state() & CompWindowStateMaximizedVertMask)) |
312 | + win_->maximize(win_->state() | CompWindowStateMaximizedVertMask); |
313 | + else |
314 | + win_->maximize(win_->state() & ~CompWindowStateMaximizedVertMask); |
315 | + } |
316 | + break; |
317 | + case Button3: |
318 | + if (win_->actions() & CompWindowActionMaximizeHorzMask) |
319 | + { |
320 | + if (!(win_->state() & CompWindowStateMaximizedHorzMask)) |
321 | + win_->maximize(win_->state() | CompWindowStateMaximizedHorzMask); |
322 | + else |
323 | + win_->maximize(win_->state() & ~CompWindowStateMaximizedHorzMask); |
324 | + } |
325 | + break; |
326 | + } |
327 | default: |
328 | break; |
329 | } |
330 | @@ -168,7 +187,7 @@ |
331 | |
332 | std::string WindowButton::GetName() const |
333 | { |
334 | - switch (type_) |
335 | + switch (type()) |
336 | { |
337 | case WindowButtonType::CLOSE: |
338 | return "CloseWindowButton"; |
339 | |
340 | === modified file 'decorations/DecorationsWindowButton.h' |
341 | --- decorations/DecorationsWindowButton.h 2014-02-19 00:03:24 +0000 |
342 | +++ decorations/DecorationsWindowButton.h 2016-09-06 23:15:10 +0000 |
343 | @@ -33,6 +33,8 @@ |
344 | public: |
345 | WindowButton(CompWindow*, WindowButtonType type); |
346 | |
347 | + nux::Property<WindowButtonType> type; |
348 | + |
349 | WidgetState GetCurrentState() const; |
350 | |
351 | protected: |
352 | @@ -46,7 +48,6 @@ |
353 | private: |
354 | void UpdateTexture(); |
355 | |
356 | - WindowButtonType type_; |
357 | bool pressed_; |
358 | bool was_pressed_; |
359 | CompWindow* win_; |
360 | |
361 | === modified file 'launcher/SwitcherController.cpp' |
362 | --- launcher/SwitcherController.cpp 2016-07-05 10:22:42 +0000 |
363 | +++ launcher/SwitcherController.cpp 2016-09-06 23:15:10 +0000 |
364 | @@ -45,7 +45,7 @@ |
365 | const std::string DETAIL_TIMEOUT = "detail-timeout"; |
366 | const std::string VIEW_CONSTRUCT_IDLE = "view-construct-idle"; |
367 | const unsigned FADE_DURATION = 80; |
368 | -const int XY_OFFSET = 100; |
369 | +const RawPixel XY_OFFSET = 100_em; |
370 | } |
371 | |
372 | namespace switcher |
373 | @@ -441,7 +441,8 @@ |
374 | int monitor = uscreen->GetMonitorWithMouse(); |
375 | auto monitor_geo = uscreen->GetMonitorGeometry(monitor); |
376 | |
377 | - monitor_geo.Expand(-XY_OFFSET, -XY_OFFSET); |
378 | + auto em = Settings::Instance().em(monitor); |
379 | + monitor_geo.Expand(-XY_OFFSET.CP(em), -XY_OFFSET.CP(em)); |
380 | |
381 | return monitor_geo; |
382 | } |
383 | |
384 | === modified file 'launcher/SwitcherView.cpp' |
385 | --- launcher/SwitcherView.cpp 2016-07-05 10:22:42 +0000 |
386 | +++ launcher/SwitcherView.cpp 2016-09-06 23:15:10 +0000 |
387 | @@ -49,6 +49,9 @@ |
388 | RawPixel const EXTRA_ICON_SPACE = 10_em; |
389 | RawPixel const TEXT_SIZE = 15_em; |
390 | |
391 | + RawPixel const LAYOUT_SPACING = 8_em; |
392 | + RawPixel const LAYOUT_MAX_ROW_HEIGHT = 400_em; |
393 | + |
394 | unsigned int const ANIMATION_LENGTH = 250; |
395 | unsigned int const MAX_DIRECTIONS_CHANGED = 3; |
396 | unsigned int const SCROLL_WHEEL_EVENTS_DISTANCE = 75; |
397 | @@ -88,6 +91,9 @@ |
398 | text_view_->SetFontWeight(PANGO_WEIGHT_BOLD); |
399 | text_view_->SetScale(scale); |
400 | |
401 | + layout_system_.spacing = LAYOUT_SPACING.CP(scale); |
402 | + layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale); |
403 | + |
404 | icon_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnIconSizeChanged)); |
405 | tile_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnTileSizeChanged)); |
406 | scale.changed.connect(sigc::mem_fun(this, &SwitcherView::OnScaleChanged)); |
407 | @@ -211,10 +217,13 @@ |
408 | text_size = TEXT_SIZE.CP(scale); |
409 | vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2; |
410 | icon_renderer_->scale = scale; |
411 | + layout_system_.spacing = LAYOUT_SPACING.CP(scale); |
412 | + layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale); |
413 | } |
414 | |
415 | void SwitcherView::StartAnimation() |
416 | { |
417 | + animation_.SetDuration(Settings::Instance().low_gfx() ? 0 : animation_length); |
418 | animation::Start(animation_, animation::Direction::FORWARD); |
419 | } |
420 | |
421 | @@ -249,7 +258,6 @@ |
422 | render_targets_.clear(); |
423 | } |
424 | |
425 | - animation_.SetDuration(Settings::Instance().low_gfx() ? 0 : animation_length); |
426 | SaveLast(); |
427 | } |
428 | |
429 | @@ -260,7 +268,6 @@ |
430 | |
431 | delta_tracker_.ResetState(); |
432 | |
433 | - animation_.SetDuration(animation_length); |
434 | SaveLast(); |
435 | } |
436 | |
437 | |
438 | === modified file 'lockscreen/UserAuthenticatorPam.cpp' |
439 | --- lockscreen/UserAuthenticatorPam.cpp 2016-06-28 16:23:15 +0000 |
440 | +++ lockscreen/UserAuthenticatorPam.cpp 2016-09-06 23:15:10 +0000 |
441 | @@ -39,8 +39,9 @@ |
442 | first_prompt_ = true; |
443 | username_ = username; |
444 | authenticate_cb_ = authenticate_cb; |
445 | + pam_handle_ = nullptr; |
446 | |
447 | - if (!InitPam()) |
448 | + if (!InitPam() || !pam_handle_) |
449 | return false; |
450 | |
451 | glib::Object<GTask> task(g_task_new(nullptr, cancellable_, [] (GObject*, GAsyncResult*, gpointer data) { |
452 | @@ -66,7 +67,7 @@ |
453 | if (unity::Settings::Instance().pam_check_account_type()) |
454 | self->status_ = status2; |
455 | |
456 | - pam_setcred (self->pam_handle_, PAM_REINITIALIZE_CRED); |
457 | + pam_setcred(self->pam_handle_, PAM_REINITIALIZE_CRED); |
458 | } |
459 | }); |
460 | |
461 | |
462 | === modified file 'panel/PanelMenuView.cpp' |
463 | --- panel/PanelMenuView.cpp 2015-12-16 15:12:05 +0000 |
464 | +++ panel/PanelMenuView.cpp 2016-09-06 23:15:10 +0000 |
465 | @@ -724,7 +724,7 @@ |
466 | |
467 | if (new_application_ && !is_inside_) |
468 | { |
469 | - if (opacity() != 1.0f) |
470 | + if (opacity() != 1.0f && menu_manager_->discovery() > 0) |
471 | StartFadeIn(menu_manager_->discovery_fadein()); |
472 | } |
473 | else |
474 | |
475 | === modified file 'panel/PanelView.cpp' |
476 | --- panel/PanelView.cpp 2016-07-05 10:22:42 +0000 |
477 | +++ panel/PanelView.cpp 2016-09-06 23:15:10 +0000 |
478 | @@ -867,6 +867,9 @@ |
479 | menu_view_->SetMonitor(monitor); |
480 | indicators_->SetMonitor(monitor); |
481 | Resize(); |
482 | + |
483 | + if (WindowManager::Default().IsScaleActive()) |
484 | + EnableOverlayMode(true); |
485 | } |
486 | |
487 | void PanelView::Resize() |
488 | |
489 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
490 | --- plugins/unityshell/src/unityshell.cpp 2016-08-01 08:50:22 +0000 |
491 | +++ plugins/unityshell/src/unityshell.cpp 2016-09-06 23:15:10 +0000 |
492 | @@ -570,8 +570,8 @@ |
493 | void UnityScreen::OnInitiateSpread() |
494 | { |
495 | scale_just_activated_ = super_keypressed_; |
496 | - spread_filter_ = std::make_shared<spread::Filter>(); |
497 | - spread_filter_->text.changed.connect([this] (std::string const& filter) { |
498 | + spread_widgets_ = std::make_shared<spread::Widgets>(); |
499 | + spread_widgets_->GetFilter()->text.changed.connect([this] (std::string const& filter) { |
500 | if (filter.empty()) |
501 | { |
502 | sScreen->relayoutSlots(CompMatch::emptyMatch); |
503 | @@ -579,7 +579,7 @@ |
504 | else |
505 | { |
506 | CompMatch windows_match; |
507 | - auto const& filtered_windows = spread_filter_->FilteredWindows(); |
508 | + auto const& filtered_windows = spread_widgets_->GetFilter()->FilteredWindows(); |
509 | |
510 | for (auto const& swin : sScreen->getWindows()) |
511 | { |
512 | @@ -610,7 +610,7 @@ |
513 | |
514 | void UnityScreen::OnTerminateSpread() |
515 | { |
516 | - spread_filter_.reset(); |
517 | + spread_widgets_.reset(); |
518 | |
519 | for (auto const& swin : sScreen->getWindows()) |
520 | UnityWindow::get(swin->window)->OnTerminateSpread(); |
521 | @@ -1745,7 +1745,7 @@ |
522 | auto const& geo = NuxGeometryFromCompRect(r); |
523 | wt->PresentWindowsIntersectingGeometryOnThisFrame(geo); |
524 | } |
525 | - |
526 | + |
527 | auto const& launchers = launcher_controller_->launchers(); |
528 | |
529 | for (auto const& launcher : launchers) |
530 | @@ -1857,8 +1857,13 @@ |
531 | } |
532 | if (wm.IsScaleActive()) |
533 | { |
534 | - if (spread_filter_ && spread_filter_->Visible()) |
535 | - skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root); |
536 | + if (spread_widgets_) |
537 | + { |
538 | + auto const& spread_filter = spread_widgets_->GetFilter(); |
539 | + |
540 | + if (spread_filter && spread_filter->Visible()) |
541 | + skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root); |
542 | + } |
543 | |
544 | if (!skip_other_plugins) |
545 | { |
546 | @@ -1941,8 +1946,13 @@ |
547 | } |
548 | else if (wm.IsScaleActive()) |
549 | { |
550 | - if (spread_filter_ && spread_filter_->Visible()) |
551 | - skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root); |
552 | + if (spread_widgets_) |
553 | + { |
554 | + auto const& spread_filter = spread_widgets_->GetFilter(); |
555 | + |
556 | + if (spread_filter && spread_filter->Visible()) |
557 | + skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root); |
558 | + } |
559 | |
560 | if (!skip_other_plugins) |
561 | { |
562 | @@ -2018,12 +2028,12 @@ |
563 | } |
564 | } |
565 | |
566 | - if (spread_filter_ && spread_filter_->Visible()) |
567 | + if (spread_widgets_ && spread_widgets_->GetFilter()->Visible()) |
568 | { |
569 | if (key_sym == XK_Escape) |
570 | { |
571 | skip_other_plugins = true; |
572 | - spread_filter_->text = ""; |
573 | + spread_widgets_->GetFilter()->text = ""; |
574 | } |
575 | } |
576 | |
577 | @@ -2072,7 +2082,7 @@ |
578 | skip_other_plugins = true; |
579 | } |
580 | |
581 | - if (spread_filter_ && spread_filter_->Visible()) |
582 | + if (spread_widgets_ && spread_widgets_->GetFilter() && spread_widgets_->GetFilter()->Visible()) |
583 | skip_other_plugins = false; |
584 | |
585 | if (!skip_other_plugins && |
586 | @@ -3189,6 +3199,9 @@ |
587 | |
588 | bool UnityWindow::damageRect(bool initial, CompRect const& rect) |
589 | { |
590 | + if (uScreen->lockscreen_controller_->IsLocked() && !CanBypassLockScreen()) |
591 | + return true; |
592 | + |
593 | if (initial) |
594 | deco_win_->Update(); |
595 | |
596 | @@ -3418,7 +3431,7 @@ |
597 | uScreen->fullscreen_windows_.remove(window); |
598 | } |
599 | |
600 | - deco_win_->Update(); |
601 | + deco_win_->UpdateWindowState(lastState); |
602 | PluginAdapter::Default().NotifyStateChange(window, window->state(), lastState); |
603 | window->stateChangeNotify(lastState); |
604 | } |
605 | @@ -3460,6 +3473,7 @@ |
606 | void UnityWindow::resizeNotify(int x, int y, int w, int h) |
607 | { |
608 | deco_win_->UpdateDecorationPositionDelayed(); |
609 | + CleanupCachedTextures(); |
610 | PluginAdapter::Default().NotifyResized(window, x, y, w, h); |
611 | window->resizeNotify(x, y, w, h); |
612 | } |
613 | @@ -4774,7 +4788,7 @@ |
614 | |
615 | Introspectable::IntrospectableList ScreenIntrospection::GetIntrospectableChildren() |
616 | { |
617 | - IntrospectableList children({uScreen->spread_filter_.get()}); |
618 | + IntrospectableList children({uScreen->spread_widgets_ ? uScreen->spread_widgets_->GetFilter().get() : nullptr}); |
619 | |
620 | for (auto const& win : screen_->windows()) |
621 | children.push_back(UnityWindow::get(win)); |
622 | |
623 | === modified file 'plugins/unityshell/src/unityshell.h' |
624 | --- plugins/unityshell/src/unityshell.h 2016-06-06 14:28:29 +0000 |
625 | +++ plugins/unityshell/src/unityshell.h 2016-09-06 23:15:10 +0000 |
626 | @@ -69,7 +69,7 @@ |
627 | #include "SwitcherController.h" |
628 | #include "SessionController.h" |
629 | #include "SessionDBusManager.h" |
630 | -#include "SpreadFilter.h" |
631 | +#include "SpreadWidgets.h" |
632 | #include "UBusWrapper.h" |
633 | #include "UnityshellPrivate.h" |
634 | #include "UnityShowdesktopHandler.h" |
635 | @@ -340,7 +340,7 @@ |
636 | ui::EdgeBarrierController::Ptr edge_barriers_; |
637 | debug::DebugDBusInterface debugger_; |
638 | std::unique_ptr<BGHash> bghash_; |
639 | - spread::Filter::Ptr spread_filter_; |
640 | + spread::Widgets::Ptr spread_widgets_; |
641 | |
642 | /* Subscription for gestures that manipulate Unity launcher */ |
643 | std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_; |
644 | |
645 | === removed file 'resources/dash_bottom_right_corner_rotated.png' |
646 | Binary files resources/dash_bottom_right_corner_rotated.png 2016-02-02 07:25:02 +0000 and resources/dash_bottom_right_corner_rotated.png 1970-01-01 00:00:00 +0000 differ |
647 | === removed file 'resources/dash_bottom_right_corner_rotated_mask.png' |
648 | Binary files resources/dash_bottom_right_corner_rotated_mask.png 2016-02-14 11:26:30 +0000 and resources/dash_bottom_right_corner_rotated_mask.png 1970-01-01 00:00:00 +0000 differ |
649 | === removed file 'resources/dash_bottom_tile.png' |
650 | Binary files resources/dash_bottom_tile.png 2016-02-14 11:26:30 +0000 and resources/dash_bottom_tile.png 1970-01-01 00:00:00 +0000 differ |
651 | === removed file 'resources/dash_top_border_tile.png' |
652 | Binary files resources/dash_top_border_tile.png 2016-02-14 11:26:30 +0000 and resources/dash_top_border_tile.png 1970-01-01 00:00:00 +0000 differ |
653 | === removed file 'resources/dash_top_border_tile_mask.png' |
654 | Binary files resources/dash_top_border_tile_mask.png 2016-02-14 11:26:30 +0000 and resources/dash_top_border_tile_mask.png 1970-01-01 00:00:00 +0000 differ |
655 | === removed file 'resources/dash_top_left_corner.png' |
656 | Binary files resources/dash_top_left_corner.png 2016-02-14 11:26:30 +0000 and resources/dash_top_left_corner.png 1970-01-01 00:00:00 +0000 differ |
657 | === removed file 'resources/dash_top_left_corner_mask.png' |
658 | Binary files resources/dash_top_left_corner_mask.png 2016-02-14 11:26:30 +0000 and resources/dash_top_left_corner_mask.png 1970-01-01 00:00:00 +0000 differ |
659 | === removed file 'resources/dash_top_right_corner_rotated.png' |
660 | Binary files resources/dash_top_right_corner_rotated.png 2016-02-02 07:25:02 +0000 and resources/dash_top_right_corner_rotated.png 1970-01-01 00:00:00 +0000 differ |
661 | === removed file 'resources/dash_top_right_corner_rotated_mask.png' |
662 | Binary files resources/dash_top_right_corner_rotated_mask.png 2016-02-14 11:26:30 +0000 and resources/dash_top_right_corner_rotated_mask.png 1970-01-01 00:00:00 +0000 differ |
663 | === added file 'resources/overlay_top_left_tile.png' |
664 | Binary files resources/overlay_top_left_tile.png 1970-01-01 00:00:00 +0000 and resources/overlay_top_left_tile.png 2016-09-06 23:15:10 +0000 differ |
665 | === modified file 'shutdown/SessionView.cpp' |
666 | --- shutdown/SessionView.cpp 2015-07-01 01:38:02 +0000 |
667 | +++ shutdown/SessionView.cpp 2016-09-06 23:15:10 +0000 |
668 | @@ -356,14 +356,6 @@ |
669 | } |
670 | } |
671 | } |
672 | - else if (key_code == NUX_VK_ESCAPE) |
673 | - { |
674 | - nux::InputArea* focused = nux::GetWindowCompositor().GetKeyFocusArea(); |
675 | - |
676 | - // Let's reset the focused area if we're in keyboard-navigation mode. |
677 | - if (focused && focused->IsChildOf(buttons_layout_) && !focused->IsMouseInside()) |
678 | - return this; |
679 | - } |
680 | |
681 | return UnityWindowView::FindKeyFocusArea(etype, key_code, modifiers); |
682 | } |
683 | |
684 | === modified file 'unity-shared/CMakeLists.txt' |
685 | --- unity-shared/CMakeLists.txt 2016-02-25 15:59:41 +0000 |
686 | +++ unity-shared/CMakeLists.txt 2016-09-06 23:15:10 +0000 |
687 | @@ -58,6 +58,7 @@ |
688 | SearchBar.cpp |
689 | SearchBarSpinner.cpp |
690 | SpreadFilter.cpp |
691 | + SpreadWidgets.cpp |
692 | StaticCairoText.cpp |
693 | TextureCache.cpp |
694 | TextInput.cpp |
695 | |
696 | === modified file 'unity-shared/DashStyle.cpp' |
697 | --- unity-shared/DashStyle.cpp 2016-06-28 16:23:27 +0000 |
698 | +++ unity-shared/DashStyle.cpp 2016-09-06 23:15:10 +0000 |
699 | @@ -2121,24 +2121,14 @@ |
700 | return true; |
701 | } |
702 | |
703 | -BaseTexturePtr Style::GetDashHorizontalTile(double scale, Position dash_position) const |
704 | +BaseTexturePtr Style::GetDashHorizontalTile(double scale) const |
705 | { |
706 | - std::string horizontal_tile; |
707 | - if (dash_position == Position::BOTTOM) |
708 | - horizontal_tile = "dash_top_border_tile"; |
709 | - else |
710 | - horizontal_tile = "dash_bottom_border_tile"; |
711 | - return pimpl->LoadScaledTexture(horizontal_tile, scale); |
712 | + return pimpl->LoadScaledTexture("dash_bottom_border_tile", scale); |
713 | } |
714 | |
715 | -BaseTexturePtr Style::GetDashHorizontalTileMask(double scale, Position dash_position) const |
716 | +BaseTexturePtr Style::GetDashHorizontalTileMask(double scale) const |
717 | { |
718 | - std::string horizontal_tile_mask; |
719 | - if (dash_position == Position::BOTTOM) |
720 | - horizontal_tile_mask = "dash_top_border_tile_mask"; |
721 | - else |
722 | - horizontal_tile_mask = "dash_bottom_border_tile_mask"; |
723 | - return pimpl->LoadScaledTexture(horizontal_tile_mask, scale); |
724 | + return pimpl->LoadScaledTexture("dash_bottom_border_tile_mask", scale); |
725 | } |
726 | |
727 | BaseTexturePtr Style::GetDashRightTile(double scale) const |
728 | @@ -2151,79 +2141,49 @@ |
729 | return pimpl->LoadScaledTexture("dash_right_border_tile_mask", scale); |
730 | } |
731 | |
732 | +BaseTexturePtr Style::GetDashTopLeftTile(double scale) const |
733 | +{ |
734 | + return pimpl->LoadScaledTexture("overlay_top_left_tile", scale); |
735 | +} |
736 | + |
737 | BaseTexturePtr Style::GetDashLeftTile(double scale) const |
738 | { |
739 | return pimpl->LoadScaledTexture("dash_left_tile", scale); |
740 | } |
741 | |
742 | -BaseTexturePtr Style::GetDashTopOrBottomTile(double scale, Position dash_position) const |
743 | -{ |
744 | - std::string top_bottom_tile; |
745 | - if (dash_position == Position::BOTTOM) |
746 | - top_bottom_tile = "dash_bottom_tile"; |
747 | - else |
748 | - top_bottom_tile = "dash_top_tile"; |
749 | - return pimpl->LoadScaledTexture(top_bottom_tile, scale); |
750 | -} |
751 | - |
752 | -BaseTexturePtr Style::GetDashCorner(double scale, Position dash_position) const |
753 | -{ |
754 | - std::string corner; |
755 | - if (dash_position == Position::BOTTOM) |
756 | - corner = "dash_top_right_corner_rotated"; |
757 | - else |
758 | - corner = "dash_bottom_right_corner"; |
759 | - return pimpl->LoadScaledTexture(corner, scale); |
760 | -} |
761 | - |
762 | -BaseTexturePtr Style::GetDashCornerMask(double scale, Position dash_position) const |
763 | -{ |
764 | - std::string corner_mask; |
765 | - if (dash_position == Position::BOTTOM) |
766 | - corner_mask = "dash_top_right_corner_rotated_mask"; |
767 | - else |
768 | - corner_mask = "dash_bottom_right_corner_mask"; |
769 | - return pimpl->LoadScaledTexture(corner_mask, scale); |
770 | -} |
771 | - |
772 | -BaseTexturePtr Style::GetDashLeftCorner(double scale, Position dash_position) const |
773 | -{ |
774 | - std::string left_corner; |
775 | - if (dash_position == Position::BOTTOM) |
776 | - left_corner = "dash_top_left_corner"; |
777 | - else |
778 | - left_corner = "dash_bottom_left_corner"; |
779 | - return pimpl->LoadScaledTexture(left_corner, scale); |
780 | -} |
781 | - |
782 | -BaseTexturePtr Style::GetDashLeftCornerMask(double scale, Position dash_position) const |
783 | -{ |
784 | - std::string left_corner_mask; |
785 | - if (dash_position == Position::BOTTOM) |
786 | - left_corner_mask = "dash_top_left_corner_mask"; |
787 | - else |
788 | - left_corner_mask = "dash_bottom_left_corner_mask"; |
789 | - return pimpl->LoadScaledTexture(left_corner_mask, scale); |
790 | -} |
791 | - |
792 | -BaseTexturePtr Style::GetDashRightCorner(double scale, Position dash_position) const |
793 | -{ |
794 | - std::string right_corner; |
795 | - if (dash_position == Position::BOTTOM) |
796 | - right_corner = "dash_bottom_right_corner_rotated"; |
797 | - else |
798 | - right_corner = "dash_top_right_corner"; |
799 | - return pimpl->LoadScaledTexture(right_corner, scale); |
800 | -} |
801 | - |
802 | -BaseTexturePtr Style::GetDashRightCornerMask(double scale, Position dash_position) const |
803 | -{ |
804 | - std::string right_corner_mask; |
805 | - if (dash_position == Position::BOTTOM) |
806 | - right_corner_mask = "dash_bottom_right_corner_rotated_mask"; |
807 | - else |
808 | - right_corner_mask = "dash_top_right_corner_mask"; |
809 | - return pimpl->LoadScaledTexture(right_corner_mask, scale); |
810 | +BaseTexturePtr Style::GetDashTopTile(double scale) const |
811 | +{ |
812 | + return pimpl->LoadScaledTexture("dash_top_tile", scale); |
813 | +} |
814 | + |
815 | +BaseTexturePtr Style::GetDashCorner(double scale) const |
816 | +{ |
817 | + return pimpl->LoadScaledTexture("dash_bottom_right_corner", scale); |
818 | +} |
819 | + |
820 | +BaseTexturePtr Style::GetDashCornerMask(double scale) const |
821 | +{ |
822 | + return pimpl->LoadScaledTexture("dash_bottom_right_corner_mask", scale); |
823 | +} |
824 | + |
825 | +BaseTexturePtr Style::GetDashLeftCorner(double scale) const |
826 | +{ |
827 | + return pimpl->LoadScaledTexture("dash_bottom_left_corner", scale); |
828 | +} |
829 | + |
830 | +BaseTexturePtr Style::GetDashLeftCornerMask(double scale) const |
831 | +{ |
832 | + return pimpl->LoadScaledTexture("dash_bottom_left_corner_mask", scale); |
833 | +} |
834 | + |
835 | +BaseTexturePtr Style::GetDashRightCorner(double scale) const |
836 | +{ |
837 | + return pimpl->LoadScaledTexture("dash_top_right_corner", scale); |
838 | +} |
839 | + |
840 | +BaseTexturePtr Style::GetDashRightCornerMask(double scale) const |
841 | +{ |
842 | + return pimpl->LoadScaledTexture("dash_top_right_corner_mask", scale); |
843 | } |
844 | |
845 | BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const |
846 | |
847 | === modified file 'unity-shared/DashStyle.h' |
848 | --- unity-shared/DashStyle.h 2016-06-28 16:23:27 +0000 |
849 | +++ unity-shared/DashStyle.h 2016-09-06 23:15:10 +0000 |
850 | @@ -85,11 +85,6 @@ |
851 | NONE |
852 | }; |
853 | |
854 | -enum class Position { |
855 | - LEFT, |
856 | - BOTTOM |
857 | -}; |
858 | - |
859 | class Style : public StyleInterface |
860 | { |
861 | public: |
862 | @@ -175,19 +170,20 @@ |
863 | BaseTexturePtr const& GetCategoryBackground() const; |
864 | BaseTexturePtr const& GetCategoryBackgroundNoFilters() const; |
865 | |
866 | - BaseTexturePtr GetDashHorizontalTile(double scale, Position) const; |
867 | - BaseTexturePtr GetDashHorizontalTileMask(double scale, Position) const; |
868 | + BaseTexturePtr GetDashHorizontalTile(double scale) const; |
869 | + BaseTexturePtr GetDashHorizontalTileMask(double scale) const; |
870 | BaseTexturePtr GetDashRightTile(double scale) const; |
871 | BaseTexturePtr GetDashRightTileMask(double scale) const; |
872 | + BaseTexturePtr GetDashTopLeftTile(double scale) const; |
873 | BaseTexturePtr GetDashLeftTile(double scale) const; |
874 | - BaseTexturePtr GetDashTopOrBottomTile(double scale, Position) const; |
875 | + BaseTexturePtr GetDashTopTile(double scale) const; |
876 | |
877 | - BaseTexturePtr GetDashCorner(double scale, Position) const; |
878 | - BaseTexturePtr GetDashCornerMask(double scale, Position) const; |
879 | - BaseTexturePtr GetDashLeftCorner(double scale, Position) const; |
880 | - BaseTexturePtr GetDashLeftCornerMask(double scale, Position) const; |
881 | - BaseTexturePtr GetDashRightCorner(double scale, Position) const; |
882 | - BaseTexturePtr GetDashRightCornerMask(double scale, Position) const; |
883 | + BaseTexturePtr GetDashCorner(double scale) const; |
884 | + BaseTexturePtr GetDashCornerMask(double scale) const; |
885 | + BaseTexturePtr GetDashLeftCorner(double scale) const; |
886 | + BaseTexturePtr GetDashLeftCornerMask(double scale) const; |
887 | + BaseTexturePtr GetDashRightCorner(double scale) const; |
888 | + BaseTexturePtr GetDashRightCornerMask(double scale) const; |
889 | |
890 | RawPixel GetDashHorizontalBorderHeight() const; |
891 | RawPixel GetDashVerticalBorderWidth() const; |
892 | |
893 | === modified file 'unity-shared/DecorationStyle.cpp' |
894 | --- unity-shared/DecorationStyle.cpp 2016-05-17 02:55:35 +0000 |
895 | +++ unity-shared/DecorationStyle.cpp 2016-09-06 23:15:10 +0000 |
896 | @@ -124,6 +124,10 @@ |
897 | |
898 | param = g_param_spec_boxed("glow-color", "Selected Window Glow Color", "", GDK_TYPE_RGBA, G_PARAM_READABLE); |
899 | gtk_widget_class_install_style_property(GTK_WIDGET_CLASS(klass), param); |
900 | + |
901 | +#if GTK_CHECK_VERSION(3, 20, 0) |
902 | + gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "UnityDecoration"); |
903 | +#endif |
904 | } |
905 | |
906 | Border BorderFromGtkBorder(GtkBorder* b, Border const& fallback = Border()) |
907 | @@ -369,6 +373,7 @@ |
908 | void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr) |
909 | { |
910 | ctx = ctx ? ctx : ctx_; |
911 | + gtk_style_context_add_class(ctx, "unity-decoration"); |
912 | gtk_style_context_add_class(ctx, "background"); |
913 | gtk_style_context_add_class(ctx, "gnome-panel-menu-bar"); |
914 | if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); } |
915 | @@ -804,4 +809,4 @@ |
916 | } |
917 | |
918 | } // decoration namespace |
919 | -} // unity namespace |
920 | \ No newline at end of file |
921 | +} // unity namespace |
922 | |
923 | === modified file 'unity-shared/OverlayRenderer.cpp' |
924 | --- unity-shared/OverlayRenderer.cpp 2016-07-05 10:22:42 +0000 |
925 | +++ unity-shared/OverlayRenderer.cpp 2016-09-06 23:15:10 +0000 |
926 | @@ -50,6 +50,12 @@ |
927 | // Now that we mask the corners of the dash, |
928 | // draw longer lines to fill the minimal gaps |
929 | const RawPixel CORNER_OVERLAP = 3_em; |
930 | + |
931 | +enum class OverlayPosition |
932 | +{ |
933 | + LEFT, |
934 | + BOTTOM |
935 | +}; |
936 | } |
937 | |
938 | // Impl class |
939 | @@ -82,7 +88,9 @@ |
940 | nux::ObjectPtr<nux::BaseTexture> right_texture_; |
941 | nux::ObjectPtr<nux::BaseTexture> right_texture_mask_; |
942 | nux::ObjectPtr<nux::BaseTexture> left_texture_; |
943 | - nux::ObjectPtr<nux::BaseTexture> top_bottom_texture_; |
944 | + nux::ObjectPtr<nux::BaseTexture> top_left_texture_; |
945 | + nux::ObjectPtr<nux::BaseTexture> top_texture_; |
946 | + nux::ObjectPtr<nux::BaseTexture> bottom_texture_; |
947 | |
948 | nux::ObjectPtr<nux::BaseTexture> corner_; |
949 | nux::ObjectPtr<nux::BaseTexture> corner_mask_; |
950 | @@ -120,7 +128,6 @@ |
951 | parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
952 | parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
953 | Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures))); |
954 | - Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
955 | dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures)); |
956 | dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)); |
957 | |
958 | @@ -132,24 +139,21 @@ |
959 | { |
960 | double scale = parent->scale; |
961 | auto& style = dash::Style::Instance(); |
962 | - auto dash_position = dash::Position::LEFT; |
963 | - |
964 | - if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && parent->owner_type() == OverlayOwner::Dash) |
965 | - dash_position = dash::Position::BOTTOM; |
966 | - |
967 | - horizontal_texture_ = style.GetDashHorizontalTile(scale, dash_position); |
968 | - horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale, dash_position); |
969 | + |
970 | + horizontal_texture_ = style.GetDashHorizontalTile(scale); |
971 | + horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale); |
972 | right_texture_ = style.GetDashRightTile(scale); |
973 | right_texture_mask_ = style.GetDashRightTileMask(scale); |
974 | + top_left_texture_ = style.GetDashTopLeftTile(scale); |
975 | left_texture_ = style.GetDashLeftTile(scale); |
976 | - top_bottom_texture_ = style.GetDashTopOrBottomTile(scale, dash_position); |
977 | + top_texture_ = style.GetDashTopTile(scale); |
978 | |
979 | - corner_ = style.GetDashCorner(scale, dash_position); |
980 | - corner_mask_ = style.GetDashCornerMask(scale, dash_position); |
981 | - left_corner_ = style.GetDashLeftCorner(scale, dash_position); |
982 | - left_corner_mask_ = style.GetDashLeftCornerMask(scale, dash_position); |
983 | - right_corner_ = style.GetDashRightCorner(scale, dash_position); |
984 | - right_corner_mask_ = style.GetDashRightCornerMask(scale, dash_position); |
985 | + corner_ = style.GetDashCorner(scale); |
986 | + corner_mask_ = style.GetDashCornerMask(scale); |
987 | + left_corner_ = style.GetDashLeftCorner(scale); |
988 | + left_corner_mask_ = style.GetDashLeftCornerMask(scale); |
989 | + right_corner_ = style.GetDashRightCorner(scale); |
990 | + right_corner_mask_ = style.GetDashRightCornerMask(scale); |
991 | } |
992 | |
993 | void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color) |
994 | @@ -610,19 +614,19 @@ |
995 | |
996 | if (settings.form_factor() != FormFactor::NETBOOK || force_edges) |
997 | { |
998 | - int monitor = unity::UScreen::GetDefault()->GetMonitorWithMouse(); |
999 | - nux::Geometry const& monitor_geo = unity::UScreen::GetDefault()->GetMonitorGeometry(monitor); |
1000 | + int monitor = UScreen::GetDefault()->GetMonitorAtPosition(absolute_geo.x, absolute_geo.y); |
1001 | + auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor); |
1002 | int launcher_size = Settings::Instance().LauncherSize(monitor); |
1003 | int panel_height = panel::Style::Instance().PanelHeight(monitor); |
1004 | |
1005 | - auto dash_position = dash::Position::LEFT; |
1006 | + auto dash_position = OverlayPosition::LEFT; |
1007 | int border_y = content_geo.y; |
1008 | int border_height = larger_absolute_geo.height; |
1009 | if (parent->owner_type() == OverlayOwner::Dash && settings.launcher_position() == LauncherPosition::BOTTOM) |
1010 | { |
1011 | border_y = panel_height; |
1012 | border_height = monitor_geo.height - launcher_size; |
1013 | - dash_position = dash::Position::BOTTOM; |
1014 | + dash_position = OverlayPosition::BOTTOM; |
1015 | } |
1016 | |
1017 | nux::Geometry geo_border(content_geo.x, border_y, larger_absolute_geo.width - content_geo.x, border_height); |
1018 | @@ -646,7 +650,13 @@ |
1019 | auto const& left_tile = left_texture_; |
1020 | auto const& right_corner = right_corner_; |
1021 | auto const& right_corner_mask = right_corner_mask_; |
1022 | - auto const& top_tile = top_bottom_texture_; |
1023 | + auto const& horizontal_tile = top_texture_; |
1024 | + |
1025 | + if (dash_position == OverlayPosition::BOTTOM) |
1026 | + { |
1027 | + // Let's flip all the textures vertically |
1028 | + texxform.flip_v_coord = true; |
1029 | + } |
1030 | |
1031 | int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale); |
1032 | int top_corner_offset = TOP_CORNER_OFFSET.CP(scale); |
1033 | @@ -662,7 +672,7 @@ |
1034 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1035 | int corner_y = geo.y + (geo.height - corner_size.height); |
1036 | |
1037 | - if (dash_position == dash::Position::BOTTOM) |
1038 | + if (dash_position == OverlayPosition::BOTTOM) |
1039 | corner_y = geo.y - corner_size.height + top_corner_offset; |
1040 | |
1041 | // Selectively erase blur region in the curbe |
1042 | @@ -700,19 +710,18 @@ |
1043 | { |
1044 | // Horizontal repeated texture |
1045 | int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width; |
1046 | - int offset = real_width % horizontal->GetWidth(); |
1047 | int horizontal_y = geo.y + (geo.height - horizontal->GetHeight()); |
1048 | |
1049 | - if (dash_position == dash::Position::BOTTOM) |
1050 | + if (dash_position == OverlayPosition::BOTTOM) |
1051 | horizontal_y = geo.y - horizontal->GetHeight() + top_corner_offset; |
1052 | |
1053 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1054 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1055 | |
1056 | // Selectively erase blur region in the curbe |
1057 | - gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset, |
1058 | + gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset, |
1059 | horizontal_y, |
1060 | - real_width + offset, |
1061 | + real_width, |
1062 | horizontal->GetHeight(), |
1063 | horizontal_mask->GetDeviceTexture(), |
1064 | texxform, |
1065 | @@ -721,9 +730,9 @@ |
1066 | // Write correct alpha |
1067 | gfx_context.GetRenderStates().SetBlend(false); |
1068 | gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
1069 | - RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset, |
1070 | + RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset, |
1071 | horizontal_y, |
1072 | - real_width + offset, |
1073 | + real_width, |
1074 | horizontal->GetHeight(), |
1075 | horizontal_mask->GetDeviceTexture(), |
1076 | texxform, |
1077 | @@ -733,9 +742,9 @@ |
1078 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1079 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
1080 | |
1081 | - gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset, |
1082 | + gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset, |
1083 | horizontal_y, |
1084 | - real_width + offset, |
1085 | + real_width, |
1086 | horizontal->GetHeight(), |
1087 | horizontal->GetDeviceTexture(), |
1088 | texxform, |
1089 | @@ -747,10 +756,10 @@ |
1090 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1091 | int left_corner_y = geo.y + (geo.height - left_corner_size.height); |
1092 | |
1093 | - if (dash_position == dash::Position::BOTTOM) |
1094 | + if (dash_position == OverlayPosition::BOTTOM) |
1095 | left_corner_y = geo.y - left_corner_size.height + top_corner_offset; |
1096 | |
1097 | - if (dash_position == dash::Position::LEFT) |
1098 | + if (dash_position == OverlayPosition::LEFT) |
1099 | { |
1100 | // Selectively erase blur region in the curbe |
1101 | gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset, |
1102 | @@ -792,14 +801,14 @@ |
1103 | int offset = real_height % left_tile->GetHeight(); |
1104 | int left_texture_y = geo.y + geo.height; |
1105 | |
1106 | - if (dash_position == dash::Position::BOTTOM) |
1107 | + if (dash_position == OverlayPosition::BOTTOM) |
1108 | { |
1109 | - left_texture_y = panel_height; |
1110 | - real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset; |
1111 | + left_texture_y = panel_height + top_left_texture_->GetHeight(); |
1112 | + real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset - top_left_texture_->GetHeight(); |
1113 | } |
1114 | else if (settings.launcher_position() == LauncherPosition::BOTTOM) |
1115 | { |
1116 | - real_height -= launcher_size; |
1117 | + real_height -= launcher_size + top_left_texture_->GetWidth(); |
1118 | } |
1119 | |
1120 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1121 | @@ -819,7 +828,7 @@ |
1122 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1123 | int right_edge_y = geo.y + right_corner_size.height - top_corner_offset; |
1124 | |
1125 | - if (dash_position == dash::Position::BOTTOM) |
1126 | + if (dash_position == OverlayPosition::BOTTOM) |
1127 | right_edge_y = geo.y + top_corner_offset; |
1128 | |
1129 | // Selectively erase blur region in the curbe |
1130 | @@ -860,7 +869,7 @@ |
1131 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1132 | int right_corner_y = geo.y - top_corner_offset; |
1133 | |
1134 | - if (dash_position == dash::Position::BOTTOM) |
1135 | + if (dash_position == OverlayPosition::BOTTOM) |
1136 | right_corner_y = geo.y + content_geo.height - right_corner_size.height + top_corner_offset; |
1137 | |
1138 | // Selectively erase blur region in the curbe |
1139 | @@ -900,17 +909,79 @@ |
1140 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1141 | int y = geo.y - top_corner_offset; |
1142 | |
1143 | - if (dash_position == dash::Position::BOTTOM) |
1144 | - y = geo.y + content_geo.height - top_tile->GetHeight() + top_corner_offset; |
1145 | + if (dash_position == OverlayPosition::BOTTOM) |
1146 | + y = geo.y + content_geo.height - horizontal_tile->GetHeight() + top_corner_offset; |
1147 | |
1148 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1149 | gfx_context.QRP_1Tex(geo.x + geo.width, |
1150 | y, |
1151 | geometry.width - (geo.x + geo.width), |
1152 | - top_tile->GetHeight(), |
1153 | - top_tile->GetDeviceTexture(), |
1154 | + horizontal_tile->GetHeight(), |
1155 | + horizontal_tile->GetDeviceTexture(), |
1156 | texxform, |
1157 | nux::color::White); |
1158 | + |
1159 | + if (dash_position == OverlayPosition::BOTTOM) |
1160 | + { |
1161 | + // Top Left edge |
1162 | + nux::TexCoordXForm top_texxform; |
1163 | + top_texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1164 | + top_texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1165 | + |
1166 | + gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1167 | + gfx_context.QRP_1Tex(0, |
1168 | + panel_height, |
1169 | + top_left_texture_->GetWidth(), |
1170 | + top_left_texture_->GetHeight(), |
1171 | + top_left_texture_->GetDeviceTexture(), |
1172 | + top_texxform, |
1173 | + nux::color::White); |
1174 | + // Top edge |
1175 | + top_texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1176 | + top_texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1177 | + gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1178 | + gfx_context.QRP_1Tex(top_left_texture_->GetWidth(), |
1179 | + panel_height - top_corner_offset, |
1180 | + monitor_geo.width - top_left_texture_->GetWidth(), |
1181 | + horizontal_tile->GetHeight(), |
1182 | + horizontal_tile->GetDeviceTexture(), |
1183 | + top_texxform, |
1184 | + nux::color::White); |
1185 | + } |
1186 | + else if (settings.launcher_position() == LauncherPosition::BOTTOM) |
1187 | + { |
1188 | + int above_launcher_y = monitor_geo.height - panel_height - launcher_size; |
1189 | + bool was_flipped = texxform.flip_v_coord; |
1190 | + |
1191 | + // Bottom Left edge |
1192 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1193 | + texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1194 | + texxform.flip_v_coord = true; |
1195 | + |
1196 | + gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1197 | + gfx_context.QRP_1Tex(0, |
1198 | + above_launcher_y - top_left_texture_->GetWidth(), |
1199 | + top_left_texture_->GetWidth(), |
1200 | + top_left_texture_->GetHeight(), |
1201 | + top_left_texture_->GetDeviceTexture(), |
1202 | + texxform, |
1203 | + nux::color::White); |
1204 | + |
1205 | + // Bottom edge |
1206 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1207 | + texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1208 | + |
1209 | + gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1210 | + gfx_context.QRP_1Tex(top_left_texture_->GetHeight(), |
1211 | + above_launcher_y + top_corner_offset - horizontal_tile->GetHeight(), |
1212 | + monitor_geo.width - top_left_texture_->GetHeight(), |
1213 | + horizontal_tile->GetHeight(), |
1214 | + horizontal_tile->GetDeviceTexture(), |
1215 | + texxform, |
1216 | + nux::color::White); |
1217 | + |
1218 | + texxform.flip_v_coord = was_flipped; |
1219 | + } |
1220 | } |
1221 | } |
1222 | |
1223 | |
1224 | === modified file 'unity-shared/PluginAdapter.cpp' |
1225 | --- unity-shared/PluginAdapter.cpp 2016-07-14 10:04:31 +0000 |
1226 | +++ unity-shared/PluginAdapter.cpp 2016-09-06 23:15:10 +0000 |
1227 | @@ -608,7 +608,7 @@ |
1228 | |
1229 | CompPoint window_vp = window->defaultViewport(); |
1230 | // Check if any windows above this one are blocking it |
1231 | - for (CompWindow* sibling = window->next; sibling != NULL; sibling = sibling->next) |
1232 | + for (CompWindow* sibling = window->serverNext; sibling != NULL; sibling = sibling->serverNext) |
1233 | { |
1234 | if (sibling->defaultViewport() == window_vp |
1235 | && !sibling->minimized() |
1236 | |
1237 | === added file 'unity-shared/SpreadWidgets.cpp' |
1238 | --- unity-shared/SpreadWidgets.cpp 1970-01-01 00:00:00 +0000 |
1239 | +++ unity-shared/SpreadWidgets.cpp 2016-09-06 23:15:10 +0000 |
1240 | @@ -0,0 +1,195 @@ |
1241 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1242 | +/* |
1243 | +* Copyright (C) 2016 Canonical Ltd |
1244 | +* |
1245 | +* This program is free software: you can redistribute it and/or modify |
1246 | +* it under the terms of the GNU General Public License version 3 as |
1247 | +* published by the Free Software Foundation. |
1248 | +* |
1249 | +* This program is distributed in the hope that it will be useful, |
1250 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1251 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1252 | +* GNU General Public License for more details. |
1253 | +* |
1254 | +* You should have received a copy of the GNU General Public License |
1255 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1256 | +* |
1257 | +* Authored by: Marco Trevisan <marco@ubuntu.com> |
1258 | +*/ |
1259 | + |
1260 | +#include "SpreadWidgets.h" |
1261 | + |
1262 | +#include "DashStyle.h" |
1263 | +#include "PanelStyle.h" |
1264 | +#include "RawPixel.h" |
1265 | +#include "SearchBar.h" |
1266 | +#include "UnitySettings.h" |
1267 | +#include "UScreen.h" |
1268 | + |
1269 | +namespace unity |
1270 | +{ |
1271 | +namespace spread |
1272 | +{ |
1273 | +namespace |
1274 | +{ |
1275 | +const RawPixel LEFT_CORNER_OFFSET = 10_em; |
1276 | +} |
1277 | + |
1278 | +class Decorations : public nux::BaseWindow |
1279 | +{ |
1280 | +public: |
1281 | + nux::Property<int> monitor; |
1282 | + |
1283 | + Decorations(int monitor_) |
1284 | + : monitor(monitor_) |
1285 | + { |
1286 | + monitor.changed.connect(sigc::mem_fun(this, &Decorations::Update)); |
1287 | + SetBackgroundColor(nux::color::Transparent); |
1288 | + |
1289 | + Update(monitor); |
1290 | + PushToFront(); |
1291 | + ShowWindow(true); |
1292 | + } |
1293 | + |
1294 | + ~Decorations() |
1295 | + { |
1296 | + ShowWindow(false); |
1297 | + object_destroyed.emit(this); |
1298 | + } |
1299 | + |
1300 | + void Update(int monitor) |
1301 | + { |
1302 | + auto& settings = Settings::Instance(); |
1303 | + auto abs_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor); |
1304 | + int panel_height = panel::Style::Instance().PanelHeight(monitor); |
1305 | + int launcher_size = settings.LauncherSize(monitor); |
1306 | + scale_ = settings.em(monitor)->DPIScale(); |
1307 | + |
1308 | + if (settings.launcher_position() == LauncherPosition::LEFT) |
1309 | + { |
1310 | + abs_geo.x += launcher_size; |
1311 | + abs_geo.width -= launcher_size; |
1312 | + } |
1313 | + else |
1314 | + { |
1315 | + abs_geo.height -= launcher_size; |
1316 | + } |
1317 | + |
1318 | + abs_geo.y += panel_height; |
1319 | + abs_geo.height -= panel_height; |
1320 | + SetGeometry(abs_geo); |
1321 | + |
1322 | + auto& dash_style = dash::Style::Instance(); |
1323 | + corner_tex_ = dash_style.GetDashTopLeftTile(scale_); |
1324 | + left_edge_tex_ = dash_style.GetDashLeftTile(scale_); |
1325 | + horizontal_tex_ = dash_style.GetDashTopTile(scale_); |
1326 | + } |
1327 | + |
1328 | + void DrawContent(nux::GraphicsEngine& gfx_context, bool force_draw) override |
1329 | + { |
1330 | + auto const& geo = GetGeometry(); |
1331 | + auto launcher_position = Settings::Instance().launcher_position(); |
1332 | + int x_offset = 0; |
1333 | + |
1334 | + nux::TexCoordXForm texxform; |
1335 | + |
1336 | + if (launcher_position == LauncherPosition::LEFT) |
1337 | + { |
1338 | + // Corner |
1339 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1340 | + texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
1341 | + |
1342 | + gfx_context.QRP_1Tex(0, |
1343 | + 0, |
1344 | + corner_tex_->GetWidth(), |
1345 | + corner_tex_->GetHeight(), |
1346 | + corner_tex_->GetDeviceTexture(), |
1347 | + texxform, |
1348 | + nux::color::White); |
1349 | + |
1350 | + x_offset = corner_tex_->GetWidth(); |
1351 | + } |
1352 | + |
1353 | + // Top Edge |
1354 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1355 | + texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1356 | + |
1357 | + gfx_context.QRP_1Tex(x_offset, |
1358 | + -LEFT_CORNER_OFFSET.CP(scale_), |
1359 | + geo.width - x_offset, |
1360 | + horizontal_tex_->GetHeight(), |
1361 | + horizontal_tex_->GetDeviceTexture(), |
1362 | + texxform, |
1363 | + nux::color::White); |
1364 | + |
1365 | + if (launcher_position == LauncherPosition::LEFT) |
1366 | + { |
1367 | + // Left edge |
1368 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1369 | + texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1370 | + |
1371 | + gfx_context.QRP_1Tex(-LEFT_CORNER_OFFSET.CP(scale_), |
1372 | + corner_tex_->GetHeight(), |
1373 | + left_edge_tex_->GetWidth(), |
1374 | + geo.height, |
1375 | + left_edge_tex_->GetDeviceTexture(), |
1376 | + texxform, |
1377 | + nux::color::White); |
1378 | + } |
1379 | + else if (launcher_position == LauncherPosition::BOTTOM) |
1380 | + { |
1381 | + texxform.flip_v_coord = true; |
1382 | + |
1383 | + // Bottom Edge |
1384 | + texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
1385 | + texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1386 | + |
1387 | + gfx_context.QRP_1Tex(0, |
1388 | + geo.height - horizontal_tex_->GetHeight() + LEFT_CORNER_OFFSET.CP(scale_), |
1389 | + geo.width, |
1390 | + horizontal_tex_->GetHeight(), |
1391 | + horizontal_tex_->GetDeviceTexture(), |
1392 | + texxform, |
1393 | + nux::color::White); |
1394 | + } |
1395 | + } |
1396 | + |
1397 | + double scale_; |
1398 | + dash::BaseTexturePtr corner_tex_; |
1399 | + dash::BaseTexturePtr left_edge_tex_; |
1400 | + dash::BaseTexturePtr horizontal_tex_; |
1401 | +}; |
1402 | + |
1403 | + |
1404 | +Widgets::Widgets() |
1405 | + : filter_(std::make_shared<Filter>()) |
1406 | +{ |
1407 | + auto const& uscreen = UScreen::GetDefault(); |
1408 | + auto num_monitors = uscreen->GetPluggedMonitorsNumber(); |
1409 | + |
1410 | + for (auto i = 0; i < num_monitors; ++i) |
1411 | + decos_.push_back(std::make_shared<Decorations>(i)); |
1412 | + |
1413 | + uscreen->changed.connect(sigc::track_obj([this] (int, std::vector<nux::Geometry> const& monitors) { |
1414 | + auto num_monitors = monitors.size(); |
1415 | + decos_.reserve(num_monitors); |
1416 | + |
1417 | + while (decos_.size() < num_monitors) |
1418 | + decos_.emplace_back(std::make_shared<Decorations>(decos_.size()-1)); |
1419 | + |
1420 | + decos_.resize(num_monitors); |
1421 | + for (auto i = 0u; i < num_monitors; ++i) |
1422 | + { |
1423 | + decos_[i]->monitor = i; |
1424 | + decos_[i]->monitor.changed.emit(i); |
1425 | + } |
1426 | + }, *this)); |
1427 | +} |
1428 | + |
1429 | +Filter::Ptr Widgets::GetFilter() const |
1430 | +{ |
1431 | + return filter_; |
1432 | +} |
1433 | + |
1434 | +} // namespace spread |
1435 | +} // namespace unity |
1436 | |
1437 | === added file 'unity-shared/SpreadWidgets.h' |
1438 | --- unity-shared/SpreadWidgets.h 1970-01-01 00:00:00 +0000 |
1439 | +++ unity-shared/SpreadWidgets.h 2016-09-06 23:15:10 +0000 |
1440 | @@ -0,0 +1,48 @@ |
1441 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1442 | +/* |
1443 | +* Copyright (C) 2016 Canonical Ltd |
1444 | +* |
1445 | +* This program is free software: you can redistribute it and/or modify |
1446 | +* it under the terms of the GNU General Public License version 3 as |
1447 | +* published by the Free Software Foundation. |
1448 | +* |
1449 | +* This program is distributed in the hope that it will be useful, |
1450 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1451 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1452 | +* GNU General Public License for more details. |
1453 | +* |
1454 | +* You should have received a copy of the GNU General Public License |
1455 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1456 | +* |
1457 | +* Authored by: Marco Trevisan <marco@ubuntu.com> |
1458 | +*/ |
1459 | + |
1460 | +#ifndef UNITYSHELL_SPREAD_WIDGETS_H |
1461 | +#define UNITYSHELL_SPREAD_WIDGETS_H |
1462 | + |
1463 | +#include "SpreadFilter.h" |
1464 | + |
1465 | +namespace unity |
1466 | +{ |
1467 | +namespace spread |
1468 | +{ |
1469 | +class Decorations; |
1470 | + |
1471 | +class Widgets : public sigc::trackable |
1472 | +{ |
1473 | +public: |
1474 | + typedef std::shared_ptr<Widgets> Ptr; |
1475 | + |
1476 | + Widgets(); |
1477 | + |
1478 | + Filter::Ptr GetFilter() const; |
1479 | + |
1480 | +private: |
1481 | + Filter::Ptr filter_; |
1482 | + std::vector<std::shared_ptr<Decorations>> decos_; |
1483 | +}; |
1484 | + |
1485 | +} // namespace spread |
1486 | +} // namespace unity |
1487 | + |
1488 | +#endif |
1489 | |
1490 | === modified file 'unity-shared/WindowButtons.cpp' |
1491 | --- unity-shared/WindowButtons.cpp 2016-03-07 18:37:24 +0000 |
1492 | +++ unity-shared/WindowButtons.cpp 2016-09-06 23:15:10 +0000 |
1493 | @@ -420,10 +420,23 @@ |
1494 | { |
1495 | WindowManager& wm = WindowManager::Default(); |
1496 | Window to_restore = controlled_window(); |
1497 | + int button = nux::GetGraphicsDisplay()->GetCurrentEvent().GetEventButton(); |
1498 | |
1499 | wm.Raise(to_restore); |
1500 | wm.Activate(to_restore); |
1501 | - wm.Restore(to_restore); |
1502 | + |
1503 | + if (button == nux::NUX_MOUSE_BUTTON1) |
1504 | + { |
1505 | + wm.Restore(to_restore); |
1506 | + } |
1507 | + else if (button == nux::NUX_MOUSE_BUTTON2) |
1508 | + { |
1509 | + wm.VerticallyMaximize(to_restore); |
1510 | + } |
1511 | + else if (button == nux::NUX_MOUSE_BUTTON3) |
1512 | + { |
1513 | + wm.HorizontallyMaximize(to_restore); |
1514 | + } |
1515 | } |
1516 | |
1517 | restore_clicked.emit(); |