mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
WindowServer: Add basic virtual desktop support
This creates a 2-dimensional array of WindowStack instances, one for each virtual desktop. The main desktop 0,0 is the main desktop, which is the desktop used for all stationary windows (e.g. taskbar, desktop). When adding windows to a desktop, stationary windows are always added to the main desktop. When composing the desktop, there are usually two WindowStacks involved. For stationary windows, the main desktop will be traversed, and for everything else the current virtual desktop will be iterated. Iteration is interweaved to preserve the correct order. During the transition animation, two WindowStacks will be iterated at the same time.
This commit is contained in:
parent
944e5cfb35
commit
584b144953
11 changed files with 900 additions and 213 deletions
|
@ -202,18 +202,21 @@ void WindowSwitcher::refresh()
|
|||
m_selected_index = 0;
|
||||
int window_count = 0;
|
||||
int longest_title_width = 0;
|
||||
wm.window_stack().for_each_window_of_type_from_front_to_back(
|
||||
WindowType::Normal, [&](Window& window) {
|
||||
if (window.is_frameless())
|
||||
wm.for_each_window_stack([&](auto& window_stack) {
|
||||
window_stack.for_each_window_of_type_from_front_to_back(
|
||||
WindowType::Normal, [&](Window& window) {
|
||||
if (window.is_frameless())
|
||||
return IterationDecision::Continue;
|
||||
++window_count;
|
||||
longest_title_width = max(longest_title_width, wm.font().width(window.computed_title()));
|
||||
if (selected_window == &window)
|
||||
m_selected_index = m_windows.size();
|
||||
m_windows.append(window);
|
||||
return IterationDecision::Continue;
|
||||
++window_count;
|
||||
longest_title_width = max(longest_title_width, wm.font().width(window.computed_title()));
|
||||
if (selected_window == &window)
|
||||
m_selected_index = m_windows.size();
|
||||
m_windows.append(window);
|
||||
return IterationDecision::Continue;
|
||||
},
|
||||
true);
|
||||
},
|
||||
true);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
if (m_windows.is_empty()) {
|
||||
hide();
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue