Merge lp:~unity-team/unity/x-sru4 into lp:unity/7.4

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
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

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
=== modified file 'dash/FilterExpanderLabel.cpp'
--- dash/FilterExpanderLabel.cpp 2015-05-08 04:24:43 +0000
+++ dash/FilterExpanderLabel.cpp 2016-09-06 23:15:10 +0000
@@ -273,6 +273,14 @@
273 graphics_engine.PopClippingRectangle();273 graphics_engine.PopClippingRectangle();
274}274}
275275
276nux::Area* FilterExpanderLabel::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type)
277{
278 if (event_type == nux::EVENT_MOUSE_WHEEL)
279 return nullptr;
280 else
281 return nux::View::FindAreaUnderMouse(mouse_position, event_type);
282}
283
276//284//
277// Key navigation285// Key navigation
278//286//
279287
=== modified file 'dash/FilterExpanderLabel.h'
--- dash/FilterExpanderLabel.h 2015-05-05 02:03:52 +0000
+++ dash/FilterExpanderLabel.h 2016-09-06 23:15:10 +0000
@@ -69,6 +69,7 @@
69 nux::Property<bool> expanded;69 nux::Property<bool> expanded;
7070
71protected:71protected:
72 nux::Area* FindAreaUnderMouse(const nux::Point&, nux::NuxEventType) override;
72 virtual bool AcceptKeyNavFocus();73 virtual bool AcceptKeyNavFocus();
73 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);74 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
74 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);75 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
7576
=== modified file 'debian/changelog'
--- debian/changelog 2016-08-01 13:10:28 +0000
+++ debian/changelog 2016-09-06 23:15:10 +0000
@@ -1,3 +1,46 @@
1unity (7.4.0+16.04.20160801.2-0ubuntu2) UNRELEASED; urgency=medium
2
3 [ Marco Trevisan (Treviño) ]
4 * SwitcherView: always disable animations when in lowgfx mode (LP:
5 #1602784)
6
7 [ Andrea Azzarone ]
8 * When locked discard damages from windows below lockscreen. (LP:
9 #1605180)
10 * DecoratedWindow: display unmaximize button if the window is
11 vertically or horizontally maximized (LP: #1608480)
12 * Make sure the switcher detail view is properly scaled. Also scale
13 the xy_offset to make sure the switcher and launcher do not overlap.
14 (LP: #1605256)
15 * Close session dialog on first ESC. (LP: #1521116)
16 * Filter out scrolling envents for FilterExpanderLabel. (LP: #1604632)
17 * Disable menu discovery animation if MenusDiscoveryDuration is 0.
18 (LP: #942962)
19 * Redraw fake decorations on window resize. (LP: #940470)
20 * Use compiz::Window::serverNext instead of compiz::Window::next in
21 IsWindowObscured as the latter can be outdated just after
22 scale/spread terminates. (LP: #1614116)
23
24 [ Marco Trevisan (Treviño) ]
25 * DecoratedWindow: avoid deferencing an invalid shadow texture ptr,
26 and split functions (LP: #1608464)
27 * DecoratedWindow: display unmaximize button if the window is
28 vertically or horizontally maximized (LP: #1608480)
29 * DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20
30 * UserAuthenticatorPam: ensure pam_handle_ is null initialized and
31 don't proceed if not set (LP: #1611668)
32 * DecorationStyle: set css name for Gtk 3.20
33 * OverlayRenderer: properly decorate launcher/panel when the launcher
34 is at the bottom (LP: #1611694)
35 * OverlayRenderer: don't use rotated textures, just rotate them at
36 rendering time
37 * SpreadWidgets: add container for spread filter and new spread
38 decorations (LP: #1283314)
39 * WindowButton: properly partially unmaximize a window when
40 middle/left clicking in the restore button (LP: #1616136)
41
42 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 23 Aug 2016 17:00:35 +0200
43
1unity (7.4.0+16.04.20160801.2-0ubuntu1) xenial; urgency=medium44unity (7.4.0+16.04.20160801.2-0ubuntu1) xenial; urgency=medium
245
3 [ Andrea Azzarone ]46 [ Andrea Azzarone ]
447
=== modified file 'decorations/DecoratedWindow.cpp'
--- decorations/DecoratedWindow.cpp 2016-08-01 13:03:39 +0000
+++ decorations/DecoratedWindow.cpp 2016-09-06 23:15:10 +0000
@@ -148,6 +148,23 @@
148 bg_textures_.clear();148 bg_textures_.clear();
149}149}
150150
151void Window::Impl::UpdateWindowState(unsigned old_state)
152{
153 Update();
154
155 if (state_change_button_)
156 {
157 if (win_->state() & (CompWindowStateMaximizedVertMask|CompWindowStateMaximizedHorzMask))
158 {
159 state_change_button_->type = WindowButtonType::UNMAXIMIZE;
160 }
161 else
162 {
163 state_change_button_->type = WindowButtonType::MAXIMIZE;
164 }
165 }
166}
167
151void Window::Impl::UnsetExtents()168void Window::Impl::UnsetExtents()
152{169{
153 if (win_->hasUnmapReference())170 if (win_->hasUnmapReference())
@@ -410,7 +427,13 @@
410 top_layout_->Append(std::make_shared<WindowButton>(win_, WindowButtonType::MINIMIZE));427 top_layout_->Append(std::make_shared<WindowButton>(win_, WindowButtonType::MINIMIZE));
411428
412 if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask))429 if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask))
413 top_layout_->Append(std::make_shared<WindowButton>(win_, WindowButtonType::MAXIMIZE));430 {
431 auto type = (win_->state() & (CompWindowStateMaximizedVertMask|CompWindowStateMaximizedHorzMask)) ?
432 WindowButtonType::UNMAXIMIZE : WindowButtonType::MAXIMIZE;
433 auto state_change_button = std::make_shared<WindowButton>(win_, type);
434 top_layout_->Append(state_change_button);
435 state_change_button_ = state_change_button;
436 }
414437
415 auto title = std::make_shared<Title>();438 auto title = std::make_shared<Title>();
416 title->text = last_title_.empty() ? WindowManager::Default().GetWindowName(win_->id()) : last_title_;439 title->text = last_title_.empty() ? WindowManager::Default().GetWindowName(win_->id()) : last_title_;
@@ -1003,6 +1026,11 @@
1003 impl_->Update();1026 impl_->Update();
1004}1027}
10051028
1029void Window::UpdateWindowState(unsigned old_state)
1030{
1031 impl_->UpdateWindowState(old_state);
1032}
1033
1006void Window::UpdateFrameRegion(CompRegion& r)1034void Window::UpdateFrameRegion(CompRegion& r)
1007{1035{
1008 if (impl_->frame_region_.isEmpty())1036 if (impl_->frame_region_.isEmpty())
10091037
=== modified file 'decorations/DecoratedWindow.h'
--- decorations/DecoratedWindow.h 2016-08-01 08:50:22 +0000
+++ decorations/DecoratedWindow.h 2016-09-06 23:15:10 +0000
@@ -53,6 +53,7 @@
53 void UpdateDecorationPositionDelayed();53 void UpdateDecorationPositionDelayed();
54 void UpdateFrameRegion(CompRegion&);54 void UpdateFrameRegion(CompRegion&);
55 void UpdateOutputExtents(compiz::window::extents::Extents&);55 void UpdateOutputExtents(compiz::window::extents::Extents&);
56 void UpdateWindowState(unsigned old_state);
56 void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);57 void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
57 void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);58 void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
5859
5960
=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
--- decorations/DecorationsForceQuitDialog.cpp 2016-03-22 15:29:31 +0000
+++ decorations/DecorationsForceQuitDialog.cpp 2016-09-06 23:15:10 +0000
@@ -279,7 +279,7 @@
279 int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom});279 int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom});
280280
281 gtk_css_provider_load_from_data(style, (R"(281 gtk_css_provider_load_from_data(style, (R"(
282 SheetStyleDialog {282 SheetStyleDialog, sheet-style-dialog {
283 background-color: #f7f6f5;283 background-color: #f7f6f5;
284 color: #4a4a4a;284 color: #4a4a4a;
285 border-radius: )"+std::to_string(decoration_radius)+R"(px;285 border-radius: )"+std::to_string(decoration_radius)+R"(px;
@@ -291,7 +291,7 @@
291 std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(;291 std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(;
292 }292 }
293293
294 SheetStyleDialog:backdrop {294 SheetStyleDialog:backdrop, sheet-style-dialog:backdrop {
295 background-color: shade(#f7f6f5, 1.2);295 background-color: shade(#f7f6f5, 1.2);
296 color: shade(#4a4a4a, 1.5);296 color: shade(#4a4a4a, 1.5);
297 border-radius: )"+std::to_string(decoration_radius)+R"(px;297 border-radius: )"+std::to_string(decoration_radius)+R"(px;
@@ -327,10 +327,7 @@
327327
328 auto* title = gtk_label_new(_("This window is not responding"));328 auto* title = gtk_label_new(_("This window is not responding"));
329 glib::Object<GtkCssProvider> title_style(gtk_css_provider_new());329 glib::Object<GtkCssProvider> title_style(gtk_css_provider_new());
330 gtk_css_provider_load_from_data(title_style, (R"(330 gtk_css_provider_load_from_data(title_style, (R"(* { font-size: 17px; })"), -1, nullptr);
331 GtkLabel {
332 font-size: 17px;
333 })"), -1, nullptr);
334 style_ctx = gtk_widget_get_style_context(title);331 style_ctx = gtk_widget_get_style_context(title);
335 gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);332 gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
336 gtk_style_context_add_class(style_ctx, "unity-force-quit");333 gtk_style_context_add_class(style_ctx, "unity-force-quit");
@@ -377,6 +374,10 @@
377 gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height);374 gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height);
378 return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr);375 return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr);
379 };376 };
377
378#if GTK_CHECK_VERSION(3, 20, 0)
379 gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "sheet-style-dialog");
380#endif
380}381}
381382
382// Close button383// Close button
@@ -384,7 +385,6 @@
384{385{
385 auto* self = GTK_WIDGET(g_object_new(close_button_get_type(), nullptr));386 auto* self = GTK_WIDGET(g_object_new(close_button_get_type(), nullptr));
386 gtk_button_set_relief(GTK_BUTTON(self), GTK_RELIEF_NONE);387 gtk_button_set_relief(GTK_BUTTON(self), GTK_RELIEF_NONE);
387 gtk_button_set_focus_on_click(GTK_BUTTON(self), FALSE);
388 gtk_widget_set_can_focus(self, FALSE);388 gtk_widget_set_can_focus(self, FALSE);
389 gtk_widget_set_halign(self, GTK_ALIGN_START);389 gtk_widget_set_halign(self, GTK_ALIGN_START);
390390
391391
=== modified file 'decorations/DecorationsPriv.h'
--- decorations/DecorationsPriv.h 2016-08-01 13:03:39 +0000
+++ decorations/DecorationsPriv.h 2016-09-06 23:15:10 +0000
@@ -49,6 +49,7 @@
49class MenuLayout;49class MenuLayout;
50class SlidingLayout;50class SlidingLayout;
51class ForceQuitDialog;51class ForceQuitDialog;
52class WindowButton;
5253
53namespace cu = compiz_utils;54namespace cu = compiz_utils;
5455
@@ -103,6 +104,7 @@
103 void SetupExtents();104 void SetupExtents();
104 void ComputeBorderExtent(CompWindowExtents &border);105 void ComputeBorderExtent(CompWindowExtents &border);
105 void UpdateElements(cu::WindowFilter wf = cu::WindowFilter::NONE);106 void UpdateElements(cu::WindowFilter wf = cu::WindowFilter::NONE);
107 void UpdateWindowState(unsigned old_state);
106 void UpdateClientDecorationsState();108 void UpdateClientDecorationsState();
107 void UpdateMonitor();109 void UpdateMonitor();
108 void UpdateFrame();110 void UpdateFrame();
@@ -166,6 +168,7 @@
166 std::shared_ptr<ForceQuitDialog> force_quit_;168 std::shared_ptr<ForceQuitDialog> force_quit_;
167 InputMixer::Ptr input_mixer_;169 InputMixer::Ptr input_mixer_;
168 Layout::Ptr top_layout_;170 Layout::Ptr top_layout_;
171 uweak_ptr<WindowButton> state_change_button_;
169 uweak_ptr<MenuLayout> menus_;172 uweak_ptr<MenuLayout> menus_;
170 uweak_ptr<Title> title_;173 uweak_ptr<Title> title_;
171 uweak_ptr<SlidingLayout> sliding_layout_;174 uweak_ptr<SlidingLayout> sliding_layout_;
172175
=== modified file 'decorations/DecorationsWindowButton.cpp'
--- decorations/DecorationsWindowButton.cpp 2014-02-27 07:11:16 +0000
+++ decorations/DecorationsWindowButton.cpp 2016-09-06 23:15:10 +0000
@@ -29,8 +29,8 @@
29namespace decoration29namespace decoration
30{30{
3131
32WindowButton::WindowButton(CompWindow* win, WindowButtonType type)32WindowButton::WindowButton(CompWindow* win, WindowButtonType wbt)
33 : type_(type)33 : type(wbt)
34 , pressed_(false)34 , pressed_(false)
35 , was_pressed_(false)35 , was_pressed_(false)
36 , win_(win)36 , win_(win)
@@ -39,12 +39,13 @@
39 mouse_owner.changed.connect(cb);39 mouse_owner.changed.connect(cb);
40 focused.changed.connect(cb);40 focused.changed.connect(cb);
41 scale.changed.connect(cb);41 scale.changed.connect(cb);
42 type.changed.connect(cb);
42 UpdateTexture();43 UpdateTexture();
43}44}
4445
45void WindowButton::UpdateTexture()46void WindowButton::UpdateTexture()
46{47{
47 SetTexture(DataPool::Get()->ButtonTexture(scale(), type_, GetCurrentState()));48 SetTexture(DataPool::Get()->ButtonTexture(scale(), type(), GetCurrentState()));
48}49}
4950
50WidgetState WindowButton::GetCurrentState() const51WidgetState WindowButton::GetCurrentState() const
@@ -98,7 +99,7 @@
98 pressed_ = false;99 pressed_ = false;
99 UpdateTexture();100 UpdateTexture();
100101
101 switch (type_)102 switch (type())
102 {103 {
103 case WindowButtonType::CLOSE:104 case WindowButtonType::CLOSE:
104 if (win_->actions() & CompWindowActionCloseMask)105 if (win_->actions() & CompWindowActionCloseMask)
@@ -112,32 +113,50 @@
112 switch (button)113 switch (button)
113 {114 {
114 case Button1:115 case Button1:
115 if ((win_->state() & CompWindowStateMaximizedVertMask) ||116 if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask))
116 (win_->state() & CompWindowStateMaximizedHorzMask))
117 win_->maximize(0);
118 else if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask))
119 win_->maximize(MAXIMIZE_STATE);117 win_->maximize(MAXIMIZE_STATE);
120 break;118 break;
121 case Button2:119 case Button2:
122 if (win_->actions() & CompWindowActionMaximizeVertMask)120 if (win_->actions() & CompWindowActionMaximizeVertMask)
123 {121 {
124 if (!(win_->state() & CompWindowStateMaximizedVertMask))122 if (!(win_->state() & CompWindowStateMaximizedVertMask))
125 win_->maximize(CompWindowStateMaximizedVertMask);123 win_->maximize(win_->state() | CompWindowStateMaximizedVertMask);
126 else
127 win_->maximize(0);
128 }124 }
129 break;125 break;
130 case Button3:126 case Button3:
131 if (win_->actions() & CompWindowActionMaximizeHorzMask)127 if (win_->actions() & CompWindowActionMaximizeHorzMask)
132 {128 {
133 if (!(win_->state() & CompWindowStateMaximizedHorzMask))129 if (!(win_->state() & CompWindowStateMaximizedHorzMask))
134 win_->maximize(CompWindowStateMaximizedHorzMask);130 win_->maximize(win_->state() | CompWindowStateMaximizedHorzMask);
135 else
136 win_->maximize(0);
137 }131 }
138 break;132 break;
139 }133 }
140 break;134 break;
135 case WindowButtonType::UNMAXIMIZE:
136 switch (button)
137 {
138 case Button1:
139 win_->maximize(0);
140 break;
141 case Button2:
142 if (win_->actions() & CompWindowActionMaximizeVertMask)
143 {
144 if (!(win_->state() & CompWindowStateMaximizedVertMask))
145 win_->maximize(win_->state() | CompWindowStateMaximizedVertMask);
146 else
147 win_->maximize(win_->state() & ~CompWindowStateMaximizedVertMask);
148 }
149 break;
150 case Button3:
151 if (win_->actions() & CompWindowActionMaximizeHorzMask)
152 {
153 if (!(win_->state() & CompWindowStateMaximizedHorzMask))
154 win_->maximize(win_->state() | CompWindowStateMaximizedHorzMask);
155 else
156 win_->maximize(win_->state() & ~CompWindowStateMaximizedHorzMask);
157 }
158 break;
159 }
141 default:160 default:
142 break;161 break;
143 }162 }
@@ -168,7 +187,7 @@
168187
169std::string WindowButton::GetName() const188std::string WindowButton::GetName() const
170{189{
171 switch (type_)190 switch (type())
172 {191 {
173 case WindowButtonType::CLOSE:192 case WindowButtonType::CLOSE:
174 return "CloseWindowButton";193 return "CloseWindowButton";
175194
=== modified file 'decorations/DecorationsWindowButton.h'
--- decorations/DecorationsWindowButton.h 2014-02-19 00:03:24 +0000
+++ decorations/DecorationsWindowButton.h 2016-09-06 23:15:10 +0000
@@ -33,6 +33,8 @@
33public:33public:
34 WindowButton(CompWindow*, WindowButtonType type);34 WindowButton(CompWindow*, WindowButtonType type);
3535
36 nux::Property<WindowButtonType> type;
37
36 WidgetState GetCurrentState() const;38 WidgetState GetCurrentState() const;
3739
38protected:40protected:
@@ -46,7 +48,6 @@
46private:48private:
47 void UpdateTexture();49 void UpdateTexture();
4850
49 WindowButtonType type_;
50 bool pressed_;51 bool pressed_;
51 bool was_pressed_;52 bool was_pressed_;
52 CompWindow* win_;53 CompWindow* win_;
5354
=== modified file 'launcher/SwitcherController.cpp'
--- launcher/SwitcherController.cpp 2016-07-05 10:22:42 +0000
+++ launcher/SwitcherController.cpp 2016-09-06 23:15:10 +0000
@@ -45,7 +45,7 @@
45const std::string DETAIL_TIMEOUT = "detail-timeout";45const std::string DETAIL_TIMEOUT = "detail-timeout";
46const std::string VIEW_CONSTRUCT_IDLE = "view-construct-idle";46const std::string VIEW_CONSTRUCT_IDLE = "view-construct-idle";
47const unsigned FADE_DURATION = 80;47const unsigned FADE_DURATION = 80;
48const int XY_OFFSET = 100;48const RawPixel XY_OFFSET = 100_em;
49}49}
5050
51namespace switcher51namespace switcher
@@ -441,7 +441,8 @@
441 int monitor = uscreen->GetMonitorWithMouse();441 int monitor = uscreen->GetMonitorWithMouse();
442 auto monitor_geo = uscreen->GetMonitorGeometry(monitor);442 auto monitor_geo = uscreen->GetMonitorGeometry(monitor);
443443
444 monitor_geo.Expand(-XY_OFFSET, -XY_OFFSET);444 auto em = Settings::Instance().em(monitor);
445 monitor_geo.Expand(-XY_OFFSET.CP(em), -XY_OFFSET.CP(em));
445446
446 return monitor_geo;447 return monitor_geo;
447}448}
448449
=== modified file 'launcher/SwitcherView.cpp'
--- launcher/SwitcherView.cpp 2016-07-05 10:22:42 +0000
+++ launcher/SwitcherView.cpp 2016-09-06 23:15:10 +0000
@@ -49,6 +49,9 @@
49 RawPixel const EXTRA_ICON_SPACE = 10_em;49 RawPixel const EXTRA_ICON_SPACE = 10_em;
50 RawPixel const TEXT_SIZE = 15_em;50 RawPixel const TEXT_SIZE = 15_em;
5151
52 RawPixel const LAYOUT_SPACING = 8_em;
53 RawPixel const LAYOUT_MAX_ROW_HEIGHT = 400_em;
54
52 unsigned int const ANIMATION_LENGTH = 250;55 unsigned int const ANIMATION_LENGTH = 250;
53 unsigned int const MAX_DIRECTIONS_CHANGED = 3;56 unsigned int const MAX_DIRECTIONS_CHANGED = 3;
54 unsigned int const SCROLL_WHEEL_EVENTS_DISTANCE = 75;57 unsigned int const SCROLL_WHEEL_EVENTS_DISTANCE = 75;
@@ -88,6 +91,9 @@
88 text_view_->SetFontWeight(PANGO_WEIGHT_BOLD);91 text_view_->SetFontWeight(PANGO_WEIGHT_BOLD);
89 text_view_->SetScale(scale);92 text_view_->SetScale(scale);
9093
94 layout_system_.spacing = LAYOUT_SPACING.CP(scale);
95 layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale);
96
91 icon_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnIconSizeChanged));97 icon_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnIconSizeChanged));
92 tile_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnTileSizeChanged));98 tile_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnTileSizeChanged));
93 scale.changed.connect(sigc::mem_fun(this, &SwitcherView::OnScaleChanged));99 scale.changed.connect(sigc::mem_fun(this, &SwitcherView::OnScaleChanged));
@@ -211,10 +217,13 @@
211 text_size = TEXT_SIZE.CP(scale);217 text_size = TEXT_SIZE.CP(scale);
212 vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2;218 vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2;
213 icon_renderer_->scale = scale;219 icon_renderer_->scale = scale;
220 layout_system_.spacing = LAYOUT_SPACING.CP(scale);
221 layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale);
214}222}
215223
216void SwitcherView::StartAnimation()224void SwitcherView::StartAnimation()
217{225{
226 animation_.SetDuration(Settings::Instance().low_gfx() ? 0 : animation_length);
218 animation::Start(animation_, animation::Direction::FORWARD);227 animation::Start(animation_, animation::Direction::FORWARD);
219}228}
220229
@@ -249,7 +258,6 @@
249 render_targets_.clear();258 render_targets_.clear();
250 }259 }
251260
252 animation_.SetDuration(Settings::Instance().low_gfx() ? 0 : animation_length);
253 SaveLast();261 SaveLast();
254}262}
255263
@@ -260,7 +268,6 @@
260268
261 delta_tracker_.ResetState();269 delta_tracker_.ResetState();
262270
263 animation_.SetDuration(animation_length);
264 SaveLast();271 SaveLast();
265}272}
266273
267274
=== modified file 'lockscreen/UserAuthenticatorPam.cpp'
--- lockscreen/UserAuthenticatorPam.cpp 2016-06-28 16:23:15 +0000
+++ lockscreen/UserAuthenticatorPam.cpp 2016-09-06 23:15:10 +0000
@@ -39,8 +39,9 @@
39 first_prompt_ = true;39 first_prompt_ = true;
40 username_ = username;40 username_ = username;
41 authenticate_cb_ = authenticate_cb;41 authenticate_cb_ = authenticate_cb;
42 pam_handle_ = nullptr;
4243
43 if (!InitPam())44 if (!InitPam() || !pam_handle_)
44 return false;45 return false;
4546
46 glib::Object<GTask> task(g_task_new(nullptr, cancellable_, [] (GObject*, GAsyncResult*, gpointer data) {47 glib::Object<GTask> task(g_task_new(nullptr, cancellable_, [] (GObject*, GAsyncResult*, gpointer data) {
@@ -66,7 +67,7 @@
66 if (unity::Settings::Instance().pam_check_account_type())67 if (unity::Settings::Instance().pam_check_account_type())
67 self->status_ = status2;68 self->status_ = status2;
6869
69 pam_setcred (self->pam_handle_, PAM_REINITIALIZE_CRED);70 pam_setcred(self->pam_handle_, PAM_REINITIALIZE_CRED);
70 }71 }
71 });72 });
7273
7374
=== modified file 'panel/PanelMenuView.cpp'
--- panel/PanelMenuView.cpp 2015-12-16 15:12:05 +0000
+++ panel/PanelMenuView.cpp 2016-09-06 23:15:10 +0000
@@ -724,7 +724,7 @@
724724
725 if (new_application_ && !is_inside_)725 if (new_application_ && !is_inside_)
726 {726 {
727 if (opacity() != 1.0f)727 if (opacity() != 1.0f && menu_manager_->discovery() > 0)
728 StartFadeIn(menu_manager_->discovery_fadein());728 StartFadeIn(menu_manager_->discovery_fadein());
729 }729 }
730 else730 else
731731
=== modified file 'panel/PanelView.cpp'
--- panel/PanelView.cpp 2016-07-05 10:22:42 +0000
+++ panel/PanelView.cpp 2016-09-06 23:15:10 +0000
@@ -867,6 +867,9 @@
867 menu_view_->SetMonitor(monitor);867 menu_view_->SetMonitor(monitor);
868 indicators_->SetMonitor(monitor);868 indicators_->SetMonitor(monitor);
869 Resize();869 Resize();
870
871 if (WindowManager::Default().IsScaleActive())
872 EnableOverlayMode(true);
870}873}
871874
872void PanelView::Resize()875void PanelView::Resize()
873876
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-08-01 08:50:22 +0000
+++ plugins/unityshell/src/unityshell.cpp 2016-09-06 23:15:10 +0000
@@ -570,8 +570,8 @@
570void UnityScreen::OnInitiateSpread()570void UnityScreen::OnInitiateSpread()
571{571{
572 scale_just_activated_ = super_keypressed_;572 scale_just_activated_ = super_keypressed_;
573 spread_filter_ = std::make_shared<spread::Filter>();573 spread_widgets_ = std::make_shared<spread::Widgets>();
574 spread_filter_->text.changed.connect([this] (std::string const& filter) {574 spread_widgets_->GetFilter()->text.changed.connect([this] (std::string const& filter) {
575 if (filter.empty())575 if (filter.empty())
576 {576 {
577 sScreen->relayoutSlots(CompMatch::emptyMatch);577 sScreen->relayoutSlots(CompMatch::emptyMatch);
@@ -579,7 +579,7 @@
579 else579 else
580 {580 {
581 CompMatch windows_match;581 CompMatch windows_match;
582 auto const& filtered_windows = spread_filter_->FilteredWindows();582 auto const& filtered_windows = spread_widgets_->GetFilter()->FilteredWindows();
583583
584 for (auto const& swin : sScreen->getWindows())584 for (auto const& swin : sScreen->getWindows())
585 {585 {
@@ -610,7 +610,7 @@
610610
611void UnityScreen::OnTerminateSpread()611void UnityScreen::OnTerminateSpread()
612{612{
613 spread_filter_.reset();613 spread_widgets_.reset();
614614
615 for (auto const& swin : sScreen->getWindows())615 for (auto const& swin : sScreen->getWindows())
616 UnityWindow::get(swin->window)->OnTerminateSpread();616 UnityWindow::get(swin->window)->OnTerminateSpread();
@@ -1745,7 +1745,7 @@
1745 auto const& geo = NuxGeometryFromCompRect(r);1745 auto const& geo = NuxGeometryFromCompRect(r);
1746 wt->PresentWindowsIntersectingGeometryOnThisFrame(geo);1746 wt->PresentWindowsIntersectingGeometryOnThisFrame(geo);
1747 }1747 }
1748 1748
1749 auto const& launchers = launcher_controller_->launchers();1749 auto const& launchers = launcher_controller_->launchers();
17501750
1751 for (auto const& launcher : launchers)1751 for (auto const& launcher : launchers)
@@ -1857,8 +1857,13 @@
1857 }1857 }
1858 if (wm.IsScaleActive())1858 if (wm.IsScaleActive())
1859 {1859 {
1860 if (spread_filter_ && spread_filter_->Visible())1860 if (spread_widgets_)
1861 skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);1861 {
1862 auto const& spread_filter = spread_widgets_->GetFilter();
1863
1864 if (spread_filter && spread_filter->Visible())
1865 skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
1866 }
18621867
1863 if (!skip_other_plugins)1868 if (!skip_other_plugins)
1864 {1869 {
@@ -1941,8 +1946,13 @@
1941 }1946 }
1942 else if (wm.IsScaleActive())1947 else if (wm.IsScaleActive())
1943 {1948 {
1944 if (spread_filter_ && spread_filter_->Visible())1949 if (spread_widgets_)
1945 skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);1950 {
1951 auto const& spread_filter = spread_widgets_->GetFilter();
1952
1953 if (spread_filter && spread_filter->Visible())
1954 skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
1955 }
19461956
1947 if (!skip_other_plugins)1957 if (!skip_other_plugins)
1948 {1958 {
@@ -2018,12 +2028,12 @@
2018 }2028 }
2019 }2029 }
20202030
2021 if (spread_filter_ && spread_filter_->Visible())2031 if (spread_widgets_ && spread_widgets_->GetFilter()->Visible())
2022 {2032 {
2023 if (key_sym == XK_Escape)2033 if (key_sym == XK_Escape)
2024 {2034 {
2025 skip_other_plugins = true;2035 skip_other_plugins = true;
2026 spread_filter_->text = "";2036 spread_widgets_->GetFilter()->text = "";
2027 }2037 }
2028 }2038 }
20292039
@@ -2072,7 +2082,7 @@
2072 skip_other_plugins = true;2082 skip_other_plugins = true;
2073 }2083 }
20742084
2075 if (spread_filter_ && spread_filter_->Visible())2085 if (spread_widgets_ && spread_widgets_->GetFilter() && spread_widgets_->GetFilter()->Visible())
2076 skip_other_plugins = false;2086 skip_other_plugins = false;
20772087
2078 if (!skip_other_plugins &&2088 if (!skip_other_plugins &&
@@ -3189,6 +3199,9 @@
31893199
3190bool UnityWindow::damageRect(bool initial, CompRect const& rect)3200bool UnityWindow::damageRect(bool initial, CompRect const& rect)
3191{3201{
3202 if (uScreen->lockscreen_controller_->IsLocked() && !CanBypassLockScreen())
3203 return true;
3204
3192 if (initial)3205 if (initial)
3193 deco_win_->Update();3206 deco_win_->Update();
31943207
@@ -3418,7 +3431,7 @@
3418 uScreen->fullscreen_windows_.remove(window);3431 uScreen->fullscreen_windows_.remove(window);
3419 }3432 }
34203433
3421 deco_win_->Update();3434 deco_win_->UpdateWindowState(lastState);
3422 PluginAdapter::Default().NotifyStateChange(window, window->state(), lastState);3435 PluginAdapter::Default().NotifyStateChange(window, window->state(), lastState);
3423 window->stateChangeNotify(lastState);3436 window->stateChangeNotify(lastState);
3424}3437}
@@ -3460,6 +3473,7 @@
3460void UnityWindow::resizeNotify(int x, int y, int w, int h)3473void UnityWindow::resizeNotify(int x, int y, int w, int h)
3461{3474{
3462 deco_win_->UpdateDecorationPositionDelayed();3475 deco_win_->UpdateDecorationPositionDelayed();
3476 CleanupCachedTextures();
3463 PluginAdapter::Default().NotifyResized(window, x, y, w, h);3477 PluginAdapter::Default().NotifyResized(window, x, y, w, h);
3464 window->resizeNotify(x, y, w, h);3478 window->resizeNotify(x, y, w, h);
3465}3479}
@@ -4774,7 +4788,7 @@
47744788
4775Introspectable::IntrospectableList ScreenIntrospection::GetIntrospectableChildren()4789Introspectable::IntrospectableList ScreenIntrospection::GetIntrospectableChildren()
4776{4790{
4777 IntrospectableList children({uScreen->spread_filter_.get()});4791 IntrospectableList children({uScreen->spread_widgets_ ? uScreen->spread_widgets_->GetFilter().get() : nullptr});
47784792
4779 for (auto const& win : screen_->windows())4793 for (auto const& win : screen_->windows())
4780 children.push_back(UnityWindow::get(win));4794 children.push_back(UnityWindow::get(win));
47814795
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2016-06-06 14:28:29 +0000
+++ plugins/unityshell/src/unityshell.h 2016-09-06 23:15:10 +0000
@@ -69,7 +69,7 @@
69#include "SwitcherController.h"69#include "SwitcherController.h"
70#include "SessionController.h"70#include "SessionController.h"
71#include "SessionDBusManager.h"71#include "SessionDBusManager.h"
72#include "SpreadFilter.h"72#include "SpreadWidgets.h"
73#include "UBusWrapper.h"73#include "UBusWrapper.h"
74#include "UnityshellPrivate.h"74#include "UnityshellPrivate.h"
75#include "UnityShowdesktopHandler.h"75#include "UnityShowdesktopHandler.h"
@@ -340,7 +340,7 @@
340 ui::EdgeBarrierController::Ptr edge_barriers_;340 ui::EdgeBarrierController::Ptr edge_barriers_;
341 debug::DebugDBusInterface debugger_;341 debug::DebugDBusInterface debugger_;
342 std::unique_ptr<BGHash> bghash_;342 std::unique_ptr<BGHash> bghash_;
343 spread::Filter::Ptr spread_filter_;343 spread::Widgets::Ptr spread_widgets_;
344344
345 /* Subscription for gestures that manipulate Unity launcher */345 /* Subscription for gestures that manipulate Unity launcher */
346 std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_;346 std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_;
347347
=== removed file 'resources/dash_bottom_right_corner_rotated.png'
348Binary 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 differ348Binary 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
=== removed file 'resources/dash_bottom_right_corner_rotated_mask.png'
349Binary 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 differ349Binary 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
=== removed file 'resources/dash_bottom_tile.png'
350Binary 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 differ350Binary 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
=== removed file 'resources/dash_top_border_tile.png'
351Binary 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 differ351Binary 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
=== removed file 'resources/dash_top_border_tile_mask.png'
352Binary 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 differ352Binary 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
=== removed file 'resources/dash_top_left_corner.png'
353Binary 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 differ353Binary 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
=== removed file 'resources/dash_top_left_corner_mask.png'
354Binary 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 differ354Binary 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
=== removed file 'resources/dash_top_right_corner_rotated.png'
355Binary 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 differ355Binary 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
=== removed file 'resources/dash_top_right_corner_rotated_mask.png'
356Binary 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 differ356Binary 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
=== added file 'resources/overlay_top_left_tile.png'
357Binary 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 differ357Binary 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
=== modified file 'shutdown/SessionView.cpp'
--- shutdown/SessionView.cpp 2015-07-01 01:38:02 +0000
+++ shutdown/SessionView.cpp 2016-09-06 23:15:10 +0000
@@ -356,14 +356,6 @@
356 }356 }
357 }357 }
358 }358 }
359 else if (key_code == NUX_VK_ESCAPE)
360 {
361 nux::InputArea* focused = nux::GetWindowCompositor().GetKeyFocusArea();
362
363 // Let's reset the focused area if we're in keyboard-navigation mode.
364 if (focused && focused->IsChildOf(buttons_layout_) && !focused->IsMouseInside())
365 return this;
366 }
367359
368 return UnityWindowView::FindKeyFocusArea(etype, key_code, modifiers);360 return UnityWindowView::FindKeyFocusArea(etype, key_code, modifiers);
369}361}
370362
=== modified file 'unity-shared/CMakeLists.txt'
--- unity-shared/CMakeLists.txt 2016-02-25 15:59:41 +0000
+++ unity-shared/CMakeLists.txt 2016-09-06 23:15:10 +0000
@@ -58,6 +58,7 @@
58 SearchBar.cpp58 SearchBar.cpp
59 SearchBarSpinner.cpp59 SearchBarSpinner.cpp
60 SpreadFilter.cpp60 SpreadFilter.cpp
61 SpreadWidgets.cpp
61 StaticCairoText.cpp62 StaticCairoText.cpp
62 TextureCache.cpp63 TextureCache.cpp
63 TextInput.cpp64 TextInput.cpp
6465
=== modified file 'unity-shared/DashStyle.cpp'
--- unity-shared/DashStyle.cpp 2016-06-28 16:23:27 +0000
+++ unity-shared/DashStyle.cpp 2016-09-06 23:15:10 +0000
@@ -2121,24 +2121,14 @@
2121 return true;2121 return true;
2122}2122}
21232123
2124BaseTexturePtr Style::GetDashHorizontalTile(double scale, Position dash_position) const2124BaseTexturePtr Style::GetDashHorizontalTile(double scale) const
2125{2125{
2126 std::string horizontal_tile;2126 return pimpl->LoadScaledTexture("dash_bottom_border_tile", scale);
2127 if (dash_position == Position::BOTTOM)
2128 horizontal_tile = "dash_top_border_tile";
2129 else
2130 horizontal_tile = "dash_bottom_border_tile";
2131 return pimpl->LoadScaledTexture(horizontal_tile, scale);
2132}2127}
21332128
2134BaseTexturePtr Style::GetDashHorizontalTileMask(double scale, Position dash_position) const2129BaseTexturePtr Style::GetDashHorizontalTileMask(double scale) const
2135{2130{
2136 std::string horizontal_tile_mask;2131 return pimpl->LoadScaledTexture("dash_bottom_border_tile_mask", scale);
2137 if (dash_position == Position::BOTTOM)
2138 horizontal_tile_mask = "dash_top_border_tile_mask";
2139 else
2140 horizontal_tile_mask = "dash_bottom_border_tile_mask";
2141 return pimpl->LoadScaledTexture(horizontal_tile_mask, scale);
2142}2132}
21432133
2144BaseTexturePtr Style::GetDashRightTile(double scale) const2134BaseTexturePtr Style::GetDashRightTile(double scale) const
@@ -2151,79 +2141,49 @@
2151 return pimpl->LoadScaledTexture("dash_right_border_tile_mask", scale);2141 return pimpl->LoadScaledTexture("dash_right_border_tile_mask", scale);
2152}2142}
21532143
2144BaseTexturePtr Style::GetDashTopLeftTile(double scale) const
2145{
2146 return pimpl->LoadScaledTexture("overlay_top_left_tile", scale);
2147}
2148
2154BaseTexturePtr Style::GetDashLeftTile(double scale) const2149BaseTexturePtr Style::GetDashLeftTile(double scale) const
2155{2150{
2156 return pimpl->LoadScaledTexture("dash_left_tile", scale);2151 return pimpl->LoadScaledTexture("dash_left_tile", scale);
2157}2152}
21582153
2159BaseTexturePtr Style::GetDashTopOrBottomTile(double scale, Position dash_position) const2154BaseTexturePtr Style::GetDashTopTile(double scale) const
2160{2155{
2161 std::string top_bottom_tile;2156 return pimpl->LoadScaledTexture("dash_top_tile", scale);
2162 if (dash_position == Position::BOTTOM)2157}
2163 top_bottom_tile = "dash_bottom_tile";2158
2164 else2159BaseTexturePtr Style::GetDashCorner(double scale) const
2165 top_bottom_tile = "dash_top_tile";2160{
2166 return pimpl->LoadScaledTexture(top_bottom_tile, scale);2161 return pimpl->LoadScaledTexture("dash_bottom_right_corner", scale);
2167}2162}
21682163
2169BaseTexturePtr Style::GetDashCorner(double scale, Position dash_position) const2164BaseTexturePtr Style::GetDashCornerMask(double scale) const
2170{2165{
2171 std::string corner;2166 return pimpl->LoadScaledTexture("dash_bottom_right_corner_mask", scale);
2172 if (dash_position == Position::BOTTOM)2167}
2173 corner = "dash_top_right_corner_rotated";2168
2174 else2169BaseTexturePtr Style::GetDashLeftCorner(double scale) const
2175 corner = "dash_bottom_right_corner";2170{
2176 return pimpl->LoadScaledTexture(corner, scale);2171 return pimpl->LoadScaledTexture("dash_bottom_left_corner", scale);
2177}2172}
21782173
2179BaseTexturePtr Style::GetDashCornerMask(double scale, Position dash_position) const2174BaseTexturePtr Style::GetDashLeftCornerMask(double scale) const
2180{2175{
2181 std::string corner_mask;2176 return pimpl->LoadScaledTexture("dash_bottom_left_corner_mask", scale);
2182 if (dash_position == Position::BOTTOM)2177}
2183 corner_mask = "dash_top_right_corner_rotated_mask";2178
2184 else2179BaseTexturePtr Style::GetDashRightCorner(double scale) const
2185 corner_mask = "dash_bottom_right_corner_mask";2180{
2186 return pimpl->LoadScaledTexture(corner_mask, scale);2181 return pimpl->LoadScaledTexture("dash_top_right_corner", scale);
2187}2182}
21882183
2189BaseTexturePtr Style::GetDashLeftCorner(double scale, Position dash_position) const2184BaseTexturePtr Style::GetDashRightCornerMask(double scale) const
2190{2185{
2191 std::string left_corner;2186 return pimpl->LoadScaledTexture("dash_top_right_corner_mask", scale);
2192 if (dash_position == Position::BOTTOM)
2193 left_corner = "dash_top_left_corner";
2194 else
2195 left_corner = "dash_bottom_left_corner";
2196 return pimpl->LoadScaledTexture(left_corner, scale);
2197}
2198
2199BaseTexturePtr Style::GetDashLeftCornerMask(double scale, Position dash_position) const
2200{
2201 std::string left_corner_mask;
2202 if (dash_position == Position::BOTTOM)
2203 left_corner_mask = "dash_top_left_corner_mask";
2204 else
2205 left_corner_mask = "dash_bottom_left_corner_mask";
2206 return pimpl->LoadScaledTexture(left_corner_mask, scale);
2207}
2208
2209BaseTexturePtr Style::GetDashRightCorner(double scale, Position dash_position) const
2210{
2211 std::string right_corner;
2212 if (dash_position == Position::BOTTOM)
2213 right_corner = "dash_bottom_right_corner_rotated";
2214 else
2215 right_corner = "dash_top_right_corner";
2216 return pimpl->LoadScaledTexture(right_corner, scale);
2217}
2218
2219BaseTexturePtr Style::GetDashRightCornerMask(double scale, Position dash_position) const
2220{
2221 std::string right_corner_mask;
2222 if (dash_position == Position::BOTTOM)
2223 right_corner_mask = "dash_bottom_right_corner_rotated_mask";
2224 else
2225 right_corner_mask = "dash_top_right_corner_mask";
2226 return pimpl->LoadScaledTexture(right_corner_mask, scale);
2227}2187}
22282188
2229BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const2189BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const
22302190
=== modified file 'unity-shared/DashStyle.h'
--- unity-shared/DashStyle.h 2016-06-28 16:23:27 +0000
+++ unity-shared/DashStyle.h 2016-09-06 23:15:10 +0000
@@ -85,11 +85,6 @@
85 NONE85 NONE
86};86};
8787
88enum class Position {
89 LEFT,
90 BOTTOM
91};
92
93class Style : public StyleInterface88class Style : public StyleInterface
94{89{
95public:90public:
@@ -175,19 +170,20 @@
175 BaseTexturePtr const& GetCategoryBackground() const;170 BaseTexturePtr const& GetCategoryBackground() const;
176 BaseTexturePtr const& GetCategoryBackgroundNoFilters() const;171 BaseTexturePtr const& GetCategoryBackgroundNoFilters() const;
177172
178 BaseTexturePtr GetDashHorizontalTile(double scale, Position) const;173 BaseTexturePtr GetDashHorizontalTile(double scale) const;
179 BaseTexturePtr GetDashHorizontalTileMask(double scale, Position) const;174 BaseTexturePtr GetDashHorizontalTileMask(double scale) const;
180 BaseTexturePtr GetDashRightTile(double scale) const;175 BaseTexturePtr GetDashRightTile(double scale) const;
181 BaseTexturePtr GetDashRightTileMask(double scale) const;176 BaseTexturePtr GetDashRightTileMask(double scale) const;
177 BaseTexturePtr GetDashTopLeftTile(double scale) const;
182 BaseTexturePtr GetDashLeftTile(double scale) const;178 BaseTexturePtr GetDashLeftTile(double scale) const;
183 BaseTexturePtr GetDashTopOrBottomTile(double scale, Position) const;179 BaseTexturePtr GetDashTopTile(double scale) const;
184180
185 BaseTexturePtr GetDashCorner(double scale, Position) const;181 BaseTexturePtr GetDashCorner(double scale) const;
186 BaseTexturePtr GetDashCornerMask(double scale, Position) const;182 BaseTexturePtr GetDashCornerMask(double scale) const;
187 BaseTexturePtr GetDashLeftCorner(double scale, Position) const;183 BaseTexturePtr GetDashLeftCorner(double scale) const;
188 BaseTexturePtr GetDashLeftCornerMask(double scale, Position) const;184 BaseTexturePtr GetDashLeftCornerMask(double scale) const;
189 BaseTexturePtr GetDashRightCorner(double scale, Position) const;185 BaseTexturePtr GetDashRightCorner(double scale) const;
190 BaseTexturePtr GetDashRightCornerMask(double scale, Position) const;186 BaseTexturePtr GetDashRightCornerMask(double scale) const;
191187
192 RawPixel GetDashHorizontalBorderHeight() const;188 RawPixel GetDashHorizontalBorderHeight() const;
193 RawPixel GetDashVerticalBorderWidth() const;189 RawPixel GetDashVerticalBorderWidth() const;
194190
=== modified file 'unity-shared/DecorationStyle.cpp'
--- unity-shared/DecorationStyle.cpp 2016-05-17 02:55:35 +0000
+++ unity-shared/DecorationStyle.cpp 2016-09-06 23:15:10 +0000
@@ -124,6 +124,10 @@
124124
125 param = g_param_spec_boxed("glow-color", "Selected Window Glow Color", "", GDK_TYPE_RGBA, G_PARAM_READABLE);125 param = g_param_spec_boxed("glow-color", "Selected Window Glow Color", "", GDK_TYPE_RGBA, G_PARAM_READABLE);
126 gtk_widget_class_install_style_property(GTK_WIDGET_CLASS(klass), param);126 gtk_widget_class_install_style_property(GTK_WIDGET_CLASS(klass), param);
127
128#if GTK_CHECK_VERSION(3, 20, 0)
129 gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "UnityDecoration");
130#endif
127}131}
128132
129Border BorderFromGtkBorder(GtkBorder* b, Border const& fallback = Border())133Border BorderFromGtkBorder(GtkBorder* b, Border const& fallback = Border())
@@ -369,6 +373,7 @@
369 void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr)373 void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr)
370 {374 {
371 ctx = ctx ? ctx : ctx_;375 ctx = ctx ? ctx : ctx_;
376 gtk_style_context_add_class(ctx, "unity-decoration");
372 gtk_style_context_add_class(ctx, "background");377 gtk_style_context_add_class(ctx, "background");
373 gtk_style_context_add_class(ctx, "gnome-panel-menu-bar");378 gtk_style_context_add_class(ctx, "gnome-panel-menu-bar");
374 if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); }379 if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); }
@@ -804,4 +809,4 @@
804}809}
805810
806} // decoration namespace811} // decoration namespace
807} // unity namespace
808\ No newline at end of file812\ No newline at end of file
813} // unity namespace
809814
=== modified file 'unity-shared/OverlayRenderer.cpp'
--- unity-shared/OverlayRenderer.cpp 2016-07-05 10:22:42 +0000
+++ unity-shared/OverlayRenderer.cpp 2016-09-06 23:15:10 +0000
@@ -50,6 +50,12 @@
50// Now that we mask the corners of the dash,50// Now that we mask the corners of the dash,
51// draw longer lines to fill the minimal gaps51// draw longer lines to fill the minimal gaps
52const RawPixel CORNER_OVERLAP = 3_em;52const RawPixel CORNER_OVERLAP = 3_em;
53
54enum class OverlayPosition
55{
56 LEFT,
57 BOTTOM
58};
53}59}
5460
55// Impl class61// Impl class
@@ -82,7 +88,9 @@
82 nux::ObjectPtr<nux::BaseTexture> right_texture_;88 nux::ObjectPtr<nux::BaseTexture> right_texture_;
83 nux::ObjectPtr<nux::BaseTexture> right_texture_mask_;89 nux::ObjectPtr<nux::BaseTexture> right_texture_mask_;
84 nux::ObjectPtr<nux::BaseTexture> left_texture_;90 nux::ObjectPtr<nux::BaseTexture> left_texture_;
85 nux::ObjectPtr<nux::BaseTexture> top_bottom_texture_;91 nux::ObjectPtr<nux::BaseTexture> top_left_texture_;
92 nux::ObjectPtr<nux::BaseTexture> top_texture_;
93 nux::ObjectPtr<nux::BaseTexture> bottom_texture_;
8694
87 nux::ObjectPtr<nux::BaseTexture> corner_;95 nux::ObjectPtr<nux::BaseTexture> corner_;
88 nux::ObjectPtr<nux::BaseTexture> corner_mask_;96 nux::ObjectPtr<nux::BaseTexture> corner_mask_;
@@ -120,7 +128,6 @@
120 parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));128 parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
121 parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));129 parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
122 Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures)));130 Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures)));
123 Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
124 dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));131 dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));
125 dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures));132 dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures));
126133
@@ -132,24 +139,21 @@
132{139{
133 double scale = parent->scale;140 double scale = parent->scale;
134 auto& style = dash::Style::Instance();141 auto& style = dash::Style::Instance();
135 auto dash_position = dash::Position::LEFT;142
136143 horizontal_texture_ = style.GetDashHorizontalTile(scale);
137 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && parent->owner_type() == OverlayOwner::Dash)144 horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale);
138 dash_position = dash::Position::BOTTOM;
139
140 horizontal_texture_ = style.GetDashHorizontalTile(scale, dash_position);
141 horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale, dash_position);
142 right_texture_ = style.GetDashRightTile(scale);145 right_texture_ = style.GetDashRightTile(scale);
143 right_texture_mask_ = style.GetDashRightTileMask(scale);146 right_texture_mask_ = style.GetDashRightTileMask(scale);
147 top_left_texture_ = style.GetDashTopLeftTile(scale);
144 left_texture_ = style.GetDashLeftTile(scale);148 left_texture_ = style.GetDashLeftTile(scale);
145 top_bottom_texture_ = style.GetDashTopOrBottomTile(scale, dash_position);149 top_texture_ = style.GetDashTopTile(scale);
146150
147 corner_ = style.GetDashCorner(scale, dash_position);151 corner_ = style.GetDashCorner(scale);
148 corner_mask_ = style.GetDashCornerMask(scale, dash_position);152 corner_mask_ = style.GetDashCornerMask(scale);
149 left_corner_ = style.GetDashLeftCorner(scale, dash_position);153 left_corner_ = style.GetDashLeftCorner(scale);
150 left_corner_mask_ = style.GetDashLeftCornerMask(scale, dash_position);154 left_corner_mask_ = style.GetDashLeftCornerMask(scale);
151 right_corner_ = style.GetDashRightCorner(scale, dash_position);155 right_corner_ = style.GetDashRightCorner(scale);
152 right_corner_mask_ = style.GetDashRightCornerMask(scale, dash_position);156 right_corner_mask_ = style.GetDashRightCornerMask(scale);
153}157}
154158
155void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color)159void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color)
@@ -610,19 +614,19 @@
610614
611 if (settings.form_factor() != FormFactor::NETBOOK || force_edges)615 if (settings.form_factor() != FormFactor::NETBOOK || force_edges)
612 {616 {
613 int monitor = unity::UScreen::GetDefault()->GetMonitorWithMouse();617 int monitor = UScreen::GetDefault()->GetMonitorAtPosition(absolute_geo.x, absolute_geo.y);
614 nux::Geometry const& monitor_geo = unity::UScreen::GetDefault()->GetMonitorGeometry(monitor);618 auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor);
615 int launcher_size = Settings::Instance().LauncherSize(monitor);619 int launcher_size = Settings::Instance().LauncherSize(monitor);
616 int panel_height = panel::Style::Instance().PanelHeight(monitor);620 int panel_height = panel::Style::Instance().PanelHeight(monitor);
617621
618 auto dash_position = dash::Position::LEFT;622 auto dash_position = OverlayPosition::LEFT;
619 int border_y = content_geo.y;623 int border_y = content_geo.y;
620 int border_height = larger_absolute_geo.height;624 int border_height = larger_absolute_geo.height;
621 if (parent->owner_type() == OverlayOwner::Dash && settings.launcher_position() == LauncherPosition::BOTTOM)625 if (parent->owner_type() == OverlayOwner::Dash && settings.launcher_position() == LauncherPosition::BOTTOM)
622 {626 {
623 border_y = panel_height;627 border_y = panel_height;
624 border_height = monitor_geo.height - launcher_size;628 border_height = monitor_geo.height - launcher_size;
625 dash_position = dash::Position::BOTTOM;629 dash_position = OverlayPosition::BOTTOM;
626 }630 }
627631
628 nux::Geometry geo_border(content_geo.x, border_y, larger_absolute_geo.width - content_geo.x, border_height);632 nux::Geometry geo_border(content_geo.x, border_y, larger_absolute_geo.width - content_geo.x, border_height);
@@ -646,7 +650,13 @@
646 auto const& left_tile = left_texture_;650 auto const& left_tile = left_texture_;
647 auto const& right_corner = right_corner_;651 auto const& right_corner = right_corner_;
648 auto const& right_corner_mask = right_corner_mask_;652 auto const& right_corner_mask = right_corner_mask_;
649 auto const& top_tile = top_bottom_texture_;653 auto const& horizontal_tile = top_texture_;
654
655 if (dash_position == OverlayPosition::BOTTOM)
656 {
657 // Let's flip all the textures vertically
658 texxform.flip_v_coord = true;
659 }
650660
651 int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale);661 int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale);
652 int top_corner_offset = TOP_CORNER_OFFSET.CP(scale);662 int top_corner_offset = TOP_CORNER_OFFSET.CP(scale);
@@ -662,7 +672,7 @@
662 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);672 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
663 int corner_y = geo.y + (geo.height - corner_size.height);673 int corner_y = geo.y + (geo.height - corner_size.height);
664674
665 if (dash_position == dash::Position::BOTTOM)675 if (dash_position == OverlayPosition::BOTTOM)
666 corner_y = geo.y - corner_size.height + top_corner_offset;676 corner_y = geo.y - corner_size.height + top_corner_offset;
667677
668 // Selectively erase blur region in the curbe678 // Selectively erase blur region in the curbe
@@ -700,19 +710,18 @@
700 {710 {
701 // Horizontal repeated texture711 // Horizontal repeated texture
702 int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width;712 int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width;
703 int offset = real_width % horizontal->GetWidth();
704 int horizontal_y = geo.y + (geo.height - horizontal->GetHeight());713 int horizontal_y = geo.y + (geo.height - horizontal->GetHeight());
705714
706 if (dash_position == dash::Position::BOTTOM)715 if (dash_position == OverlayPosition::BOTTOM)
707 horizontal_y = geo.y - horizontal->GetHeight() + top_corner_offset;716 horizontal_y = geo.y - horizontal->GetHeight() + top_corner_offset;
708717
709 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);718 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
710 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);719 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
711720
712 // Selectively erase blur region in the curbe721 // Selectively erase blur region in the curbe
713 gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset,722 gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset,
714 horizontal_y,723 horizontal_y,
715 real_width + offset,724 real_width,
716 horizontal->GetHeight(),725 horizontal->GetHeight(),
717 horizontal_mask->GetDeviceTexture(),726 horizontal_mask->GetDeviceTexture(),
718 texxform,727 texxform,
@@ -721,9 +730,9 @@
721 // Write correct alpha730 // Write correct alpha
722 gfx_context.GetRenderStates().SetBlend(false);731 gfx_context.GetRenderStates().SetBlend(false);
723 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);732 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
724 RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset,733 RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset,
725 horizontal_y,734 horizontal_y,
726 real_width + offset,735 real_width,
727 horizontal->GetHeight(),736 horizontal->GetHeight(),
728 horizontal_mask->GetDeviceTexture(),737 horizontal_mask->GetDeviceTexture(),
729 texxform,738 texxform,
@@ -733,9 +742,9 @@
733 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);742 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
734 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);743 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
735744
736 gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset,745 gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset,
737 horizontal_y,746 horizontal_y,
738 real_width + offset,747 real_width,
739 horizontal->GetHeight(),748 horizontal->GetHeight(),
740 horizontal->GetDeviceTexture(),749 horizontal->GetDeviceTexture(),
741 texxform,750 texxform,
@@ -747,10 +756,10 @@
747 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);756 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
748 int left_corner_y = geo.y + (geo.height - left_corner_size.height);757 int left_corner_y = geo.y + (geo.height - left_corner_size.height);
749758
750 if (dash_position == dash::Position::BOTTOM)759 if (dash_position == OverlayPosition::BOTTOM)
751 left_corner_y = geo.y - left_corner_size.height + top_corner_offset;760 left_corner_y = geo.y - left_corner_size.height + top_corner_offset;
752761
753 if (dash_position == dash::Position::LEFT)762 if (dash_position == OverlayPosition::LEFT)
754 {763 {
755 // Selectively erase blur region in the curbe764 // Selectively erase blur region in the curbe
756 gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset,765 gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset,
@@ -792,14 +801,14 @@
792 int offset = real_height % left_tile->GetHeight();801 int offset = real_height % left_tile->GetHeight();
793 int left_texture_y = geo.y + geo.height;802 int left_texture_y = geo.y + geo.height;
794803
795 if (dash_position == dash::Position::BOTTOM)804 if (dash_position == OverlayPosition::BOTTOM)
796 {805 {
797 left_texture_y = panel_height;806 left_texture_y = panel_height + top_left_texture_->GetHeight();
798 real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset;807 real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset - top_left_texture_->GetHeight();
799 }808 }
800 else if (settings.launcher_position() == LauncherPosition::BOTTOM)809 else if (settings.launcher_position() == LauncherPosition::BOTTOM)
801 {810 {
802 real_height -= launcher_size;811 real_height -= launcher_size + top_left_texture_->GetWidth();
803 }812 }
804813
805 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);814 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
@@ -819,7 +828,7 @@
819 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);828 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
820 int right_edge_y = geo.y + right_corner_size.height - top_corner_offset;829 int right_edge_y = geo.y + right_corner_size.height - top_corner_offset;
821830
822 if (dash_position == dash::Position::BOTTOM)831 if (dash_position == OverlayPosition::BOTTOM)
823 right_edge_y = geo.y + top_corner_offset;832 right_edge_y = geo.y + top_corner_offset;
824833
825 // Selectively erase blur region in the curbe834 // Selectively erase blur region in the curbe
@@ -860,7 +869,7 @@
860 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);869 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
861 int right_corner_y = geo.y - top_corner_offset;870 int right_corner_y = geo.y - top_corner_offset;
862871
863 if (dash_position == dash::Position::BOTTOM)872 if (dash_position == OverlayPosition::BOTTOM)
864 right_corner_y = geo.y + content_geo.height - right_corner_size.height + top_corner_offset;873 right_corner_y = geo.y + content_geo.height - right_corner_size.height + top_corner_offset;
865874
866 // Selectively erase blur region in the curbe875 // Selectively erase blur region in the curbe
@@ -900,17 +909,79 @@
900 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);909 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
901 int y = geo.y - top_corner_offset;910 int y = geo.y - top_corner_offset;
902911
903 if (dash_position == dash::Position::BOTTOM)912 if (dash_position == OverlayPosition::BOTTOM)
904 y = geo.y + content_geo.height - top_tile->GetHeight() + top_corner_offset;913 y = geo.y + content_geo.height - horizontal_tile->GetHeight() + top_corner_offset;
905914
906 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);915 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
907 gfx_context.QRP_1Tex(geo.x + geo.width,916 gfx_context.QRP_1Tex(geo.x + geo.width,
908 y,917 y,
909 geometry.width - (geo.x + geo.width),918 geometry.width - (geo.x + geo.width),
910 top_tile->GetHeight(),919 horizontal_tile->GetHeight(),
911 top_tile->GetDeviceTexture(),920 horizontal_tile->GetDeviceTexture(),
912 texxform,921 texxform,
913 nux::color::White);922 nux::color::White);
923
924 if (dash_position == OverlayPosition::BOTTOM)
925 {
926 // Top Left edge
927 nux::TexCoordXForm top_texxform;
928 top_texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
929 top_texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
930
931 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
932 gfx_context.QRP_1Tex(0,
933 panel_height,
934 top_left_texture_->GetWidth(),
935 top_left_texture_->GetHeight(),
936 top_left_texture_->GetDeviceTexture(),
937 top_texxform,
938 nux::color::White);
939 // Top edge
940 top_texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
941 top_texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
942 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
943 gfx_context.QRP_1Tex(top_left_texture_->GetWidth(),
944 panel_height - top_corner_offset,
945 monitor_geo.width - top_left_texture_->GetWidth(),
946 horizontal_tile->GetHeight(),
947 horizontal_tile->GetDeviceTexture(),
948 top_texxform,
949 nux::color::White);
950 }
951 else if (settings.launcher_position() == LauncherPosition::BOTTOM)
952 {
953 int above_launcher_y = monitor_geo.height - panel_height - launcher_size;
954 bool was_flipped = texxform.flip_v_coord;
955
956 // Bottom Left edge
957 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
958 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
959 texxform.flip_v_coord = true;
960
961 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
962 gfx_context.QRP_1Tex(0,
963 above_launcher_y - top_left_texture_->GetWidth(),
964 top_left_texture_->GetWidth(),
965 top_left_texture_->GetHeight(),
966 top_left_texture_->GetDeviceTexture(),
967 texxform,
968 nux::color::White);
969
970 // Bottom edge
971 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
972 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
973
974 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
975 gfx_context.QRP_1Tex(top_left_texture_->GetHeight(),
976 above_launcher_y + top_corner_offset - horizontal_tile->GetHeight(),
977 monitor_geo.width - top_left_texture_->GetHeight(),
978 horizontal_tile->GetHeight(),
979 horizontal_tile->GetDeviceTexture(),
980 texxform,
981 nux::color::White);
982
983 texxform.flip_v_coord = was_flipped;
984 }
914 }985 }
915 }986 }
916987
917988
=== modified file 'unity-shared/PluginAdapter.cpp'
--- unity-shared/PluginAdapter.cpp 2016-07-14 10:04:31 +0000
+++ unity-shared/PluginAdapter.cpp 2016-09-06 23:15:10 +0000
@@ -608,7 +608,7 @@
608608
609 CompPoint window_vp = window->defaultViewport();609 CompPoint window_vp = window->defaultViewport();
610 // Check if any windows above this one are blocking it610 // Check if any windows above this one are blocking it
611 for (CompWindow* sibling = window->next; sibling != NULL; sibling = sibling->next)611 for (CompWindow* sibling = window->serverNext; sibling != NULL; sibling = sibling->serverNext)
612 {612 {
613 if (sibling->defaultViewport() == window_vp613 if (sibling->defaultViewport() == window_vp
614 && !sibling->minimized()614 && !sibling->minimized()
615615
=== added file 'unity-shared/SpreadWidgets.cpp'
--- unity-shared/SpreadWidgets.cpp 1970-01-01 00:00:00 +0000
+++ unity-shared/SpreadWidgets.cpp 2016-09-06 23:15:10 +0000
@@ -0,0 +1,195 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3* Copyright (C) 2016 Canonical Ltd
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License version 3 as
7* published by the Free Software Foundation.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program. If not, see <http://www.gnu.org/licenses/>.
16*
17* Authored by: Marco Trevisan <marco@ubuntu.com>
18*/
19
20#include "SpreadWidgets.h"
21
22#include "DashStyle.h"
23#include "PanelStyle.h"
24#include "RawPixel.h"
25#include "SearchBar.h"
26#include "UnitySettings.h"
27#include "UScreen.h"
28
29namespace unity
30{
31namespace spread
32{
33namespace
34{
35const RawPixel LEFT_CORNER_OFFSET = 10_em;
36}
37
38class Decorations : public nux::BaseWindow
39{
40public:
41 nux::Property<int> monitor;
42
43 Decorations(int monitor_)
44 : monitor(monitor_)
45 {
46 monitor.changed.connect(sigc::mem_fun(this, &Decorations::Update));
47 SetBackgroundColor(nux::color::Transparent);
48
49 Update(monitor);
50 PushToFront();
51 ShowWindow(true);
52 }
53
54 ~Decorations()
55 {
56 ShowWindow(false);
57 object_destroyed.emit(this);
58 }
59
60 void Update(int monitor)
61 {
62 auto& settings = Settings::Instance();
63 auto abs_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor);
64 int panel_height = panel::Style::Instance().PanelHeight(monitor);
65 int launcher_size = settings.LauncherSize(monitor);
66 scale_ = settings.em(monitor)->DPIScale();
67
68 if (settings.launcher_position() == LauncherPosition::LEFT)
69 {
70 abs_geo.x += launcher_size;
71 abs_geo.width -= launcher_size;
72 }
73 else
74 {
75 abs_geo.height -= launcher_size;
76 }
77
78 abs_geo.y += panel_height;
79 abs_geo.height -= panel_height;
80 SetGeometry(abs_geo);
81
82 auto& dash_style = dash::Style::Instance();
83 corner_tex_ = dash_style.GetDashTopLeftTile(scale_);
84 left_edge_tex_ = dash_style.GetDashLeftTile(scale_);
85 horizontal_tex_ = dash_style.GetDashTopTile(scale_);
86 }
87
88 void DrawContent(nux::GraphicsEngine& gfx_context, bool force_draw) override
89 {
90 auto const& geo = GetGeometry();
91 auto launcher_position = Settings::Instance().launcher_position();
92 int x_offset = 0;
93
94 nux::TexCoordXForm texxform;
95
96 if (launcher_position == LauncherPosition::LEFT)
97 {
98 // Corner
99 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
100 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
101
102 gfx_context.QRP_1Tex(0,
103 0,
104 corner_tex_->GetWidth(),
105 corner_tex_->GetHeight(),
106 corner_tex_->GetDeviceTexture(),
107 texxform,
108 nux::color::White);
109
110 x_offset = corner_tex_->GetWidth();
111 }
112
113 // Top Edge
114 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
115 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
116
117 gfx_context.QRP_1Tex(x_offset,
118 -LEFT_CORNER_OFFSET.CP(scale_),
119 geo.width - x_offset,
120 horizontal_tex_->GetHeight(),
121 horizontal_tex_->GetDeviceTexture(),
122 texxform,
123 nux::color::White);
124
125 if (launcher_position == LauncherPosition::LEFT)
126 {
127 // Left edge
128 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
129 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
130
131 gfx_context.QRP_1Tex(-LEFT_CORNER_OFFSET.CP(scale_),
132 corner_tex_->GetHeight(),
133 left_edge_tex_->GetWidth(),
134 geo.height,
135 left_edge_tex_->GetDeviceTexture(),
136 texxform,
137 nux::color::White);
138 }
139 else if (launcher_position == LauncherPosition::BOTTOM)
140 {
141 texxform.flip_v_coord = true;
142
143 // Bottom Edge
144 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
145 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
146
147 gfx_context.QRP_1Tex(0,
148 geo.height - horizontal_tex_->GetHeight() + LEFT_CORNER_OFFSET.CP(scale_),
149 geo.width,
150 horizontal_tex_->GetHeight(),
151 horizontal_tex_->GetDeviceTexture(),
152 texxform,
153 nux::color::White);
154 }
155 }
156
157 double scale_;
158 dash::BaseTexturePtr corner_tex_;
159 dash::BaseTexturePtr left_edge_tex_;
160 dash::BaseTexturePtr horizontal_tex_;
161};
162
163
164Widgets::Widgets()
165 : filter_(std::make_shared<Filter>())
166{
167 auto const& uscreen = UScreen::GetDefault();
168 auto num_monitors = uscreen->GetPluggedMonitorsNumber();
169
170 for (auto i = 0; i < num_monitors; ++i)
171 decos_.push_back(std::make_shared<Decorations>(i));
172
173 uscreen->changed.connect(sigc::track_obj([this] (int, std::vector<nux::Geometry> const& monitors) {
174 auto num_monitors = monitors.size();
175 decos_.reserve(num_monitors);
176
177 while (decos_.size() < num_monitors)
178 decos_.emplace_back(std::make_shared<Decorations>(decos_.size()-1));
179
180 decos_.resize(num_monitors);
181 for (auto i = 0u; i < num_monitors; ++i)
182 {
183 decos_[i]->monitor = i;
184 decos_[i]->monitor.changed.emit(i);
185 }
186 }, *this));
187}
188
189Filter::Ptr Widgets::GetFilter() const
190{
191 return filter_;
192}
193
194} // namespace spread
195} // namespace unity
0196
=== added file 'unity-shared/SpreadWidgets.h'
--- unity-shared/SpreadWidgets.h 1970-01-01 00:00:00 +0000
+++ unity-shared/SpreadWidgets.h 2016-09-06 23:15:10 +0000
@@ -0,0 +1,48 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3* Copyright (C) 2016 Canonical Ltd
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License version 3 as
7* published by the Free Software Foundation.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program. If not, see <http://www.gnu.org/licenses/>.
16*
17* Authored by: Marco Trevisan <marco@ubuntu.com>
18*/
19
20#ifndef UNITYSHELL_SPREAD_WIDGETS_H
21#define UNITYSHELL_SPREAD_WIDGETS_H
22
23#include "SpreadFilter.h"
24
25namespace unity
26{
27namespace spread
28{
29class Decorations;
30
31class Widgets : public sigc::trackable
32{
33public:
34 typedef std::shared_ptr<Widgets> Ptr;
35
36 Widgets();
37
38 Filter::Ptr GetFilter() const;
39
40private:
41 Filter::Ptr filter_;
42 std::vector<std::shared_ptr<Decorations>> decos_;
43};
44
45} // namespace spread
46} // namespace unity
47
48#endif
049
=== modified file 'unity-shared/WindowButtons.cpp'
--- unity-shared/WindowButtons.cpp 2016-03-07 18:37:24 +0000
+++ unity-shared/WindowButtons.cpp 2016-09-06 23:15:10 +0000
@@ -420,10 +420,23 @@
420 {420 {
421 WindowManager& wm = WindowManager::Default();421 WindowManager& wm = WindowManager::Default();
422 Window to_restore = controlled_window();422 Window to_restore = controlled_window();
423 int button = nux::GetGraphicsDisplay()->GetCurrentEvent().GetEventButton();
423424
424 wm.Raise(to_restore);425 wm.Raise(to_restore);
425 wm.Activate(to_restore);426 wm.Activate(to_restore);
426 wm.Restore(to_restore);427
428 if (button == nux::NUX_MOUSE_BUTTON1)
429 {
430 wm.Restore(to_restore);
431 }
432 else if (button == nux::NUX_MOUSE_BUTTON2)
433 {
434 wm.VerticallyMaximize(to_restore);
435 }
436 else if (button == nux::NUX_MOUSE_BUTTON3)
437 {
438 wm.HorizontallyMaximize(to_restore);
439 }
427 }440 }
428441
429 restore_clicked.emit();442 restore_clicked.emit();

Subscribers

People subscribed via source and target branches

to all changes: