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