Merge lp:~alan-griffiths/miral/BasicWindowManager-provides-active_window-logic into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: 201
Merged at revision: 176
Proposed branch: lp:~alan-griffiths/miral/BasicWindowManager-provides-active_window-logic
Merge into: lp:miral
Prerequisite: lp:~alan-griffiths/miral/mru-list-of-active-windows
Diff against target: 688 lines (+142/-196)
10 files modified
include/miral/window_management_policy.h (+2/-1)
include/miral/window_manager_tools.h (+3/-3)
miral-kiosk/kiosk_window_manager.cpp (+15/-35)
miral-kiosk/kiosk_window_manager.h (+3/-1)
miral-shell/canonical_window_manager.cpp (+15/-69)
miral-shell/canonical_window_manager.h (+3/-5)
miral-shell/tiling_window_manager.cpp (+18/-36)
miral-shell/tiling_window_manager.h (+3/-1)
miral/basic_window_manager.cpp (+73/-40)
miral/basic_window_manager.h (+7/-5)
To merge this branch: bzr merge lp:~alan-griffiths/miral/BasicWindowManager-provides-active_window-logic
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+295860@code.launchpad.net

Commit message

Provide standard "active window" support in BasicWindowManager, just calling the policies for stuff that can reasonably differ.

Description of the change

Provide standard "active window" support in BasicWindowManager, just calling the policies for stuff that can reasonably differ.

To post a comment you must log in.
200. By Alan Griffiths

Use MRU list when switching applications

201. By Alan Griffiths

Extract common code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/miral/window_management_policy.h'
2--- include/miral/window_management_policy.h 2016-05-06 15:36:23 +0000
3+++ include/miral/window_management_policy.h 2016-05-28 07:54:16 +0000
4@@ -50,7 +50,8 @@
5 virtual bool handle_pointer_event(MirPointerEvent const* event) = 0;
6 virtual void handle_raise_window(WindowInfo& window_info) = 0;
7
8- virtual auto select_active_window(Window const& hint) -> Window = 0;
9+ virtual void handle_focus_lost(miral::WindowInfo const& info) = 0;
10+ virtual void handle_focus_gained(miral::WindowInfo const& info) = 0;
11
12 virtual ~WindowManagementPolicy() = default;
13 WindowManagementPolicy() = default;
14
15=== modified file 'include/miral/window_manager_tools.h'
16--- include/miral/window_manager_tools.h 2016-05-06 16:04:34 +0000
17+++ include/miral/window_manager_tools.h 2016-05-28 07:54:16 +0000
18@@ -55,10 +55,10 @@
19 virtual auto info_for(std::weak_ptr<mir::scene::Session> const& session) const -> ApplicationInfo& = 0;
20 virtual auto info_for(std::weak_ptr<mir::scene::Surface> const& surface) const -> WindowInfo& = 0;
21 virtual auto info_for(Window const& window) const -> WindowInfo& = 0;
22- virtual auto focused_application() const -> Application = 0;
23- virtual auto focused_window() const -> Window = 0;
24+ virtual void kill_active_application(int sig) = 0;
25+ virtual auto active_window() const -> Window = 0;
26+ virtual auto select_active_window(Window const& hint) -> Window = 0;
27 virtual void focus_next_application() = 0;
28- virtual void set_focus_to(Window const& window) = 0;
29 virtual auto window_at(mir::geometry::Point cursor) const -> Window = 0;
30 virtual auto active_display() -> mir::geometry::Rectangle const = 0;
31 virtual void destroy(Window& window) = 0;
32
33=== modified file 'miral-kiosk/kiosk_window_manager.cpp'
34--- miral-kiosk/kiosk_window_manager.cpp 2016-05-28 07:54:16 +0000
35+++ miral-kiosk/kiosk_window_manager.cpp 2016-05-28 07:54:16 +0000
36@@ -116,7 +116,7 @@
37
38 void KioskWindowManagerPolicy::handle_window_ready(WindowInfo& window_info)
39 {
40- select_active_window(window_info.window());
41+ tools->select_active_window(window_info.window());
42 }
43
44 void KioskWindowManagerPolicy::handle_modify_window(
45@@ -147,7 +147,7 @@
46
47 void KioskWindowManagerPolicy::handle_raise_window(WindowInfo& window_info)
48 {
49- select_active_window(window_info.window());
50+ tools->select_active_window(window_info.window());
51 }
52
53 bool KioskWindowManagerPolicy::handle_keyboard_event(MirKeyboardEvent const* event)
54@@ -168,18 +168,18 @@
55 modifiers == mir_input_event_modifier_alt &&
56 scan_code == KEY_GRAVE)
57 {
58- if (auto const prev = tools->focused_window())
59+ if (auto const prev = tools->active_window())
60 {
61 auto const& siblings = tools->info_for(prev.application()).windows();
62 auto current = find(begin(siblings), end(siblings), prev);
63
64- while (current != end(siblings) && prev == select_active_window(*current))
65+ while (current != end(siblings) && prev == tools->select_active_window(*current))
66 ++current;
67
68 if (current == end(siblings))
69 {
70 current = begin(siblings);
71- while (prev != *current && prev == select_active_window(*current))
72+ while (prev != *current && prev == tools->select_active_window(*current))
73 ++current;
74 }
75 }
76@@ -218,41 +218,12 @@
77
78 if (action == mir_pointer_action_button_down)
79 {
80- select_active_window(tools->window_at(cursor));
81+ tools->select_active_window(tools->window_at(cursor));
82 }
83
84 return false;
85 }
86
87-auto KioskWindowManagerPolicy::select_active_window(Window const& window) -> Window
88-{
89- if (!window)
90- {
91- tools->set_focus_to({});
92- return window;
93- }
94-
95- auto const& info_for = tools->info_for(window);
96-
97- if (info_for.can_be_active())
98- {
99- tools->set_focus_to(info_for.window());
100- tools->raise_tree(window);
101-
102- raise_splash_session();
103-
104- return window;
105- }
106- else
107- {
108- // Cannot have input focus - try the parent
109- if (auto const parent = info_for.parent())
110- return select_active_window(parent);
111-
112- return {};
113- }
114-}
115-
116 void KioskWindowManagerPolicy::raise_splash_session() const
117 {
118 if (auto session = splash.session().lock())
119@@ -263,3 +234,12 @@
120 tools->raise_tree(s);
121 }
122 }
123+
124+void KioskWindowManagerPolicy::handle_focus_gained(WindowInfo const& info)
125+{
126+ tools->raise_tree(info.window());
127+}
128+
129+void KioskWindowManagerPolicy::handle_focus_lost(WindowInfo const& /*info*/)
130+{
131+}
132
133=== modified file 'miral-kiosk/kiosk_window_manager.h'
134--- miral-kiosk/kiosk_window_manager.h 2016-05-06 14:38:26 +0000
135+++ miral-kiosk/kiosk_window_manager.h 2016-05-28 07:54:16 +0000
136@@ -57,7 +57,9 @@
137
138 void handle_raise_window(miral::WindowInfo& window_info) override;
139
140- auto select_active_window(miral::Window const& window) -> miral::Window override;
141+ void handle_focus_lost(miral::WindowInfo const& info) override;
142+
143+ void handle_focus_gained(miral::WindowInfo const& info) override;
144
145 private:
146 static const int modifier_mask =
147
148=== modified file 'miral-shell/canonical_window_manager.cpp'
149--- miral-shell/canonical_window_manager.cpp 2016-05-28 07:54:16 +0000
150+++ miral-shell/canonical_window_manager.cpp 2016-05-28 07:54:16 +0000
151@@ -58,7 +58,7 @@
152 void CanonicalWindowManagerPolicy::click(Point cursor)
153 {
154 if (auto const window = tools->window_at(cursor))
155- select_active_window(window);
156+ tools->select_active_window(window);
157 }
158
159 void CanonicalWindowManagerPolicy::handle_app_info_updated(Rectangles const& /*displays*/)
160@@ -86,8 +86,8 @@
161 bool CanonicalWindowManagerPolicy::resize(Point cursor)
162 {
163 if (!resizing)
164- select_active_window(tools->window_at(old_cursor));
165- return resize(active_window(), cursor, old_cursor);
166+ tools->select_active_window(tools->window_at(old_cursor));
167+ return resize(tools->active_window(), cursor, old_cursor);
168 }
169
170
171@@ -279,7 +279,7 @@
172
173 void CanonicalWindowManagerPolicy::handle_window_ready(WindowInfo& window_info)
174 {
175- select_active_window(window_info.window());
176+ tools->select_active_window(window_info.window());
177 }
178
179 void CanonicalWindowManagerPolicy::handle_modify_window(
180@@ -370,9 +370,6 @@
181 {
182 tools->destroy(titlebar->window);
183 }
184-
185- if (active_window() == window_info.window())
186- active_window_.reset();
187 }
188
189 auto CanonicalWindowManagerPolicy::handle_set_state(WindowInfo& window_info, MirSurfaceState value)
190@@ -505,13 +502,13 @@
191
192 void CanonicalWindowManagerPolicy::drag(Point cursor)
193 {
194- select_active_window(tools->window_at(old_cursor));
195- drag(active_window(), cursor, old_cursor, display_area);
196+ tools->select_active_window(tools->window_at(old_cursor));
197+ drag(tools->active_window(), cursor, old_cursor, display_area);
198 }
199
200 void CanonicalWindowManagerPolicy::handle_raise_window(WindowInfo& window_info)
201 {
202- select_active_window(window_info.window());
203+ tools->select_active_window(window_info.window());
204 }
205
206 bool CanonicalWindowManagerPolicy::handle_keyboard_event(MirKeyboardEvent const* event)
207@@ -545,13 +542,11 @@
208 switch (modifiers & modifier_mask)
209 {
210 case mir_input_event_modifier_alt:
211- if (auto const application = tools->focused_application())
212- miral::kill(application, SIGTERM);
213-
214+ tools->kill_active_application(SIGTERM);
215 return true;
216
217 case mir_input_event_modifier_ctrl:
218- if (auto const window = tools->focused_window())
219+ if (auto const window = tools->active_window())
220 window.request_client_surface_close();
221
222 return true;
223@@ -572,18 +567,18 @@
224 modifiers == mir_input_event_modifier_alt &&
225 scan_code == KEY_GRAVE)
226 {
227- if (auto const prev = tools->focused_window())
228+ if (auto const prev = tools->active_window())
229 {
230 auto const& siblings = tools->info_for(prev.application()).windows();
231 auto current = find(begin(siblings), end(siblings), prev);
232
233- while (current != end(siblings) && prev == select_active_window(*current))
234+ while (current != end(siblings) && prev == tools->select_active_window(*current))
235 ++current;
236
237 if (current == end(siblings))
238 {
239 current = begin(siblings);
240- while (prev != *current && prev == select_active_window(*current))
241+ while (prev != *current && prev == tools->select_active_window(*current))
242 ++current;
243 }
244 }
245@@ -702,7 +697,7 @@
246
247 void CanonicalWindowManagerPolicy::toggle(MirSurfaceState state)
248 {
249- if (auto window = active_window())
250+ if (auto const window = tools->active_window())
251 {
252 auto& info = tools->info_for(window);
253
254@@ -713,54 +708,13 @@
255 }
256 }
257
258-auto CanonicalWindowManagerPolicy::select_active_window(Window const& hint) -> miral::Window
259-{
260- auto const prev_window = active_window();
261-
262- if (hint == prev_window)
263- return hint;
264-
265- if (!hint)
266- {
267- if (prev_window)
268- {
269- tools->set_focus_to({});
270- handle_focus_lost(tools->info_for(prev_window));
271- }
272-
273- return hint;
274- }
275-
276- auto const& info_for_hint = tools->info_for(hint);
277-
278- if (info_for_hint.can_be_active())
279- {
280- tools->set_focus_to(hint);
281- tools->raise_tree(hint);
282-
283- if (prev_window)
284- handle_focus_lost(tools->info_for(prev_window));
285-
286- handle_focus_gained(info_for_hint);
287- return hint;
288- }
289- else
290- {
291- // Cannot have input focus - try the parent
292- if (auto const parent = info_for_hint.parent())
293- return select_active_window(parent);
294- }
295-
296- return {};
297-}
298-
299 void CanonicalWindowManagerPolicy::handle_focus_gained(WindowInfo const& info)
300 {
301+ tools->raise_tree(info.window());
302+
303 if (auto const titlebar = std::static_pointer_cast<CanonicalWindowManagementPolicyData>(info.userdata()))
304 titlebar->paint_titlebar(0xFF);
305
306- active_window_ = info.window();
307-
308 // Frig to force the spinner to the top
309 if (auto const spinner_session = spinner.session())
310 {
311@@ -775,14 +729,6 @@
312 {
313 if (auto const titlebar = std::static_pointer_cast<CanonicalWindowManagementPolicyData>(info.userdata()))
314 titlebar->paint_titlebar(0x3F);
315-
316- active_window_.reset();
317-}
318-
319-auto CanonicalWindowManagerPolicy::active_window() const
320--> Window
321-{
322- return active_window_;
323 }
324
325 bool CanonicalWindowManagerPolicy::resize(Window const& window, Point cursor, Point old_cursor)
326
327=== modified file 'miral-shell/canonical_window_manager.h'
328--- miral-shell/canonical_window_manager.h 2016-05-28 07:54:16 +0000
329+++ miral-shell/canonical_window_manager.h 2016-05-28 07:54:16 +0000
330@@ -74,7 +74,9 @@
331
332 void handle_raise_window(miral::WindowInfo& window_info) override;
333
334- auto select_active_window(miral::Window const& hint) -> miral::Window override;
335+ void handle_focus_lost(miral::WindowInfo const& info) override;
336+
337+ void handle_focus_gained(miral::WindowInfo const& info) override;
338
339 private:
340 static const int modifier_mask =
341@@ -89,9 +91,6 @@
342 bool resize(Point cursor);
343 void toggle(MirSurfaceState state);
344
345- auto active_window() const -> miral::Window;
346- void handle_focus_lost(miral::WindowInfo const& info);
347- void handle_focus_gained(miral::WindowInfo const& info);
348
349 bool resize(miral::Window const& window, Point cursor, Point old_cursor);
350 bool drag(miral::Window window, Point to, Point from, Rectangle bounds);
351@@ -105,7 +104,6 @@
352
353 Rectangle display_area;
354 Point old_cursor{};
355- miral::Window active_window_;
356 using FullscreenSurfaces = std::set<miral::Window>;
357
358 FullscreenSurfaces fullscreen_surfaces;
359
360=== modified file 'miral-shell/tiling_window_manager.cpp'
361--- miral-shell/tiling_window_manager.cpp 2016-05-28 07:54:16 +0000
362+++ miral-shell/tiling_window_manager.cpp 2016-05-28 07:54:16 +0000
363@@ -57,7 +57,7 @@
364 void TilingWindowManagerPolicy::click(Point cursor)
365 {
366 auto const window = tools->window_at(cursor);
367- select_active_window(window);
368+ tools->select_active_window(window);
369 }
370
371 void TilingWindowManagerPolicy::handle_app_info_updated(Rectangles const& displays)
372@@ -76,7 +76,7 @@
373 {
374 if (application == application_under(old_cursor))
375 {
376- if (auto const window = select_active_window(tools->window_at(old_cursor)))
377+ if (auto const window = tools->select_active_window(tools->window_at(old_cursor)))
378 {
379 resize(window, cursor, old_cursor, tile_for(tools->info_for(application)));
380 }
381@@ -154,7 +154,7 @@
382
383 void TilingWindowManagerPolicy::handle_window_ready(WindowInfo& window_info)
384 {
385- select_active_window(window_info.window());
386+ tools->select_active_window(window_info.window());
387 }
388
389 void TilingWindowManagerPolicy::handle_modify_window(
390@@ -240,7 +240,7 @@
391 {
392 if (application == application_under(old_cursor))
393 {
394- if (auto const window = select_active_window(tools->window_at(old_cursor)))
395+ if (auto const window = tools->select_active_window(tools->window_at(old_cursor)))
396 {
397 drag(tools->info_for(window), cursor, old_cursor, tile_for(tools->info_for(application)));
398 }
399@@ -250,7 +250,7 @@
400
401 void TilingWindowManagerPolicy::handle_raise_window(WindowInfo& window_info)
402 {
403- select_active_window(window_info.window());
404+ tools-> select_active_window(window_info.window());
405 }
406
407 bool TilingWindowManagerPolicy::handle_keyboard_event(MirKeyboardEvent const* event)
408@@ -284,13 +284,12 @@
409 switch (modifiers & modifier_mask)
410 {
411 case mir_input_event_modifier_alt:
412- if (auto const application = tools->focused_application())
413- miral::kill(application, SIGTERM);
414+ tools->kill_active_application(SIGTERM);
415
416 return true;
417
418 case mir_input_event_modifier_ctrl:
419- if (auto const window = tools->focused_window())
420+ if (auto const window = tools->active_window())
421 window.request_client_surface_close();
422
423 return true;
424@@ -311,18 +310,18 @@
425 modifiers == mir_input_event_modifier_alt &&
426 scan_code == KEY_GRAVE)
427 {
428- if (auto const prev = tools->focused_window())
429+ if (auto const prev = tools->active_window())
430 {
431 auto const& siblings = tools->info_for(prev.application()).windows();
432 auto current = find(begin(siblings), end(siblings), prev);
433
434- while (current != end(siblings) && prev == select_active_window(*current))
435+ while (current != end(siblings) && prev == tools->select_active_window(*current))
436 ++current;
437
438 if (current == end(siblings))
439 {
440 current = begin(siblings);
441- while (prev != *current && prev == select_active_window(*current))
442+ while (prev != *current && prev == tools->select_active_window(*current))
443 ++current;
444 }
445 }
446@@ -420,7 +419,7 @@
447
448 void TilingWindowManagerPolicy::toggle(MirSurfaceState state)
449 {
450- if (auto window = tools->focused_window())
451+ if (auto window = tools->active_window())
452 {
453 auto& window_info = tools->info_for(window);
454
455@@ -583,28 +582,11 @@
456 }
457 }
458
459-auto TilingWindowManagerPolicy::select_active_window(Window const& window) -> Window
460-{
461- if (!window)
462- {
463- tools->set_focus_to({});
464- return window;
465- }
466-
467- auto const& info_for = tools->info_for(window);
468-
469- if (info_for.can_be_active())
470- {
471- tools->set_focus_to(info_for.window());
472- tools->raise_tree(window);
473- return window;
474- }
475- else
476- {
477- // Cannot have input focus - try the parent
478- if (auto const parent = info_for.parent())
479- return select_active_window(parent);
480-
481- return {};
482- }
483+void TilingWindowManagerPolicy::handle_focus_gained(WindowInfo const& info)
484+{
485+ tools->raise_tree(info.window());
486+}
487+
488+void TilingWindowManagerPolicy::handle_focus_lost(WindowInfo const& /*info*/)
489+{
490 }
491
492=== modified file 'miral-shell/tiling_window_manager.h'
493--- miral-shell/tiling_window_manager.h 2016-05-06 14:38:26 +0000
494+++ miral-shell/tiling_window_manager.h 2016-05-28 07:54:16 +0000
495@@ -68,7 +68,9 @@
496
497 void handle_raise_window(miral::WindowInfo& window_info) override;
498
499- auto select_active_window(miral::Window const& window) -> miral::Window override;
500+ void handle_focus_lost(miral::WindowInfo const& info) override;
501+
502+ void handle_focus_gained(miral::WindowInfo const& info) override;
503
504 private:
505 static const int modifier_mask =
506
507=== modified file 'miral/basic_window_manager.cpp'
508--- miral/basic_window_manager.cpp 2016-05-28 07:54:16 +0000
509+++ miral/basic_window_manager.cpp 2016-05-28 07:54:16 +0000
510@@ -151,38 +151,21 @@
511 if (is_active_window)
512 {
513 // Try to make the parent active
514- if (parent)
515- {
516- if (policy->select_active_window(parent))
517- return;
518- }
519-
520- // TODO the policy for choosing a window is mixed with implementing the choice.
521- // I.e. select_active_window() calls set_focus_to() which updates mru_active_windows
522- // during the iteration. There must be a better way to sequence the logic.
523- // Until then we copy the list.
524- auto const copy_mru_windows = mru_active_windows;
525-
526- // Try to activate to recently active window of same application
527- {
528- Window new_focus;
529-
530- copy_mru_windows.enumerate([&](Window& window)
531- {
532- return window.application() != session ||
533- !(new_focus = policy->select_active_window(window));
534- });
535-
536- if (new_focus) return;
537- }
538+ if (parent && select_active_window(parent))
539+ return;
540+
541+ if (can_activate_window_for_session(session))
542+ return;
543
544 // Try to activate to recently active window of any application
545 {
546 Window new_focus;
547
548- copy_mru_windows.enumerate([&](Window& window)
549+ mru_active_windows.enumerate([&](Window& window)
550 {
551- return !(new_focus = policy->select_active_window(window));
552+ // select_active_window() calls set_focus_to() which updates mru_active_windows and changes window
553+ auto const w = window;
554+ return !(new_focus = select_active_window(w));
555 });
556
557 if (new_focus) return;
558@@ -315,29 +298,27 @@
559 return info_for(std::weak_ptr<mir::scene::Surface>(window));
560 }
561
562-auto miral::BasicWindowManager::focused_application() const
563--> Application
564+void miral::BasicWindowManager::kill_active_application(int sig)
565 {
566- return focus_controller->focused_session();
567+ if (auto const application = focus_controller->focused_session())
568+ miral::kill(application, sig);
569 }
570
571-auto miral::BasicWindowManager::focused_window() const
572--> Window
573+auto miral::BasicWindowManager::active_window() const -> Window
574 {
575- auto focussed_surface = focus_controller->focused_surface();
576- return focussed_surface ? info_for(focussed_surface).window() : Window{};
577+ return mru_active_windows.top();
578 }
579
580 void miral::BasicWindowManager::focus_next_application()
581 {
582 focus_controller->focus_next_session();
583- policy->select_active_window(focused_window());
584-}
585-
586-void miral::BasicWindowManager::set_focus_to(Window const& window)
587-{
588- if (window) mru_active_windows.push(window);
589- focus_controller->set_focus_to(window.application(), window);
590+
591+ if (can_activate_window_for_session(focus_controller->focused_session()))
592+ return;
593+
594+ // Last resort: accept wherever focus_controller placed focus
595+ auto const focussed_surface = focus_controller->focused_surface();
596+ select_active_window(focussed_surface ? info_for(focussed_surface).window() : Window{});
597 }
598
599 auto miral::BasicWindowManager::window_at(geometry::Point cursor) const
600@@ -462,3 +443,55 @@
601 std::lock_guard<decltype(mutex)> lock(mutex);
602 callback();
603 }
604+
605+auto miral::BasicWindowManager::select_active_window(Window const& hint) -> miral::Window
606+{
607+ auto const prev_window = active_window();
608+
609+ if (!hint)
610+ {
611+ if (prev_window)
612+ {
613+ focus_controller->set_focus_to(hint.application(), hint);
614+ policy->handle_focus_lost(info_for(prev_window));
615+ }
616+
617+ return hint;
618+ }
619+
620+ auto const& info_for_hint = info_for(hint);
621+
622+ if (info_for_hint.can_be_active())
623+ {
624+ mru_active_windows.push(hint);
625+ focus_controller->set_focus_to(hint.application(), hint);
626+
627+ if (prev_window && prev_window != hint)
628+ policy->handle_focus_lost(info_for(prev_window));
629+
630+ policy->handle_focus_gained(info_for_hint);
631+ return hint;
632+ }
633+ else
634+ {
635+ // Cannot have input focus - try the parent
636+ if (auto const parent = info_for_hint.parent())
637+ return select_active_window(parent);
638+ }
639+
640+ return {};
641+}
642+
643+auto miral::BasicWindowManager::can_activate_window_for_session(miral::Application const& session) -> bool
644+{
645+ miral::Window new_focus;
646+
647+ mru_active_windows.enumerate([&](miral::Window& window)
648+ {
649+ // select_active_window() calls set_focus_to() which updates mru_active_windows and changes window
650+ auto const w = window;
651+ return w.application() != session || !(new_focus = miral::BasicWindowManager::select_active_window(w));
652+ });
653+
654+ return new_focus;
655+}
656\ No newline at end of file
657
658=== modified file 'miral/basic_window_manager.h'
659--- miral/basic_window_manager.h 2016-05-28 07:54:16 +0000
660+++ miral/basic_window_manager.h 2016-05-28 07:54:16 +0000
661@@ -114,14 +114,14 @@
662
663 auto info_for(Window const& window) const -> WindowInfo& override;
664
665- auto focused_application() const -> Application override;
666-
667- auto focused_window() const -> Window override;
668+ void kill_active_application(int sig) override;
669+
670+ auto active_window() const -> Window override;
671+
672+ auto select_active_window(Window const& hint) -> Window override;
673
674 void focus_next_application() override;
675
676- void set_focus_to(Window const& window) override;
677-
678 auto window_at(mir::geometry::Point cursor) const -> Window override;
679
680 auto active_display() -> mir::geometry::Rectangle const override;
681@@ -156,6 +156,8 @@
682 void update_event_timestamp(MirKeyboardEvent const* kev);
683 void update_event_timestamp(MirPointerEvent const* pev);
684 void update_event_timestamp(MirTouchEvent const* tev);
685+
686+ auto can_activate_window_for_session(miral::Application const& session) -> bool;
687 };
688 }
689

Subscribers

People subscribed via source and target branches