mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
WindowServer: Toggling desktop should only toggle current desktop
We should only show/hide the windows on the current virtual desktop.
This commit is contained in:
parent
f6cca0b8f0
commit
812ee194b7
1 changed files with 15 additions and 18 deletions
|
@ -118,28 +118,25 @@ void WMClientConnection::set_window_minimized(i32 client_id, i32 window_id, bool
|
||||||
void WMClientConnection::toggle_show_desktop()
|
void WMClientConnection::toggle_show_desktop()
|
||||||
{
|
{
|
||||||
bool should_hide = false;
|
bool should_hide = false;
|
||||||
WindowServer::ClientConnection::for_each_client([&should_hide](auto& client) {
|
auto& current_window_stack = WindowManager::the().current_window_stack();
|
||||||
client.for_each_window([&should_hide](Window& window) {
|
current_window_stack.for_each_window([&](auto& window) {
|
||||||
if (window.type() == WindowType::Normal && window.is_minimizable()) {
|
if (window.type() == WindowType::Normal && window.is_minimizable()) {
|
||||||
if (!window.is_hidden() && !window.is_minimized()) {
|
if (!window.is_hidden() && !window.is_minimized()) {
|
||||||
should_hide = true;
|
should_hide = true;
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return IterationDecision::Continue;
|
}
|
||||||
});
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
|
|
||||||
WindowServer::ClientConnection::for_each_client([should_hide](auto& client) {
|
current_window_stack.for_each_window([&](auto& window) {
|
||||||
client.for_each_window([should_hide](Window& window) {
|
if (window.type() == WindowType::Normal && window.is_minimizable()) {
|
||||||
if (window.type() == WindowType::Normal && window.is_minimizable()) {
|
auto state = window.minimized_state();
|
||||||
auto state = window.minimized_state();
|
if (state == WindowMinimizedState::None || state == WindowMinimizedState::Hidden) {
|
||||||
if (state == WindowMinimizedState::None || state == WindowMinimizedState::Hidden) {
|
WindowManager::the().hide_windows(window, should_hide);
|
||||||
WindowManager::the().hide_windows(window, should_hide);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return IterationDecision::Continue;
|
}
|
||||||
});
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue