1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:57:35 +00:00

WindowServer: Add API to change virtual desktop settings

This also adds the ability to query how many virtual desktops are
set up, and for the Taskbar to be notified when the active virtual
desktop has changed.
This commit is contained in:
Tom 2021-06-30 19:12:02 -06:00 committed by Andreas Kling
parent 584b144953
commit 7984c2836d
21 changed files with 383 additions and 64 deletions

View file

@ -19,9 +19,16 @@ public:
bool is_empty() const { return m_windows.is_empty(); }
void add(Window&);
void add_to_back(Window&);
void remove(Window&);
void move_to_front(Window&);
enum class MoveAllWindowsTo {
Front,
Back
};
void move_all_windows(WindowStack&, Vector<Window*, 32>&, MoveAllWindowsTo);
enum class IncludeWindowFrame {
Yes,
No,
@ -38,6 +45,8 @@ public:
template<typename Callback>
void for_each_window(Callback);
template<typename Callback>
IterationDecision for_each_window_from_back_to_front(Callback);
Window::List& windows() { return m_windows; }
@ -145,6 +154,17 @@ inline void WindowStack::for_each_window(Callback callback)
}
}
template<typename Callback>
inline IterationDecision WindowStack::for_each_window_from_back_to_front(Callback callback)
{
for (auto& window : m_windows) {
IterationDecision decision = callback(window);
if (decision != IterationDecision::Break)
return decision;
}
return IterationDecision::Continue;
}
template<typename Callback>
inline IterationDecision WindowStack::for_each_window_of_type_from_front_to_back(WindowType type, Callback callback, bool ignore_highlight)
{