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:
Tom 2021-07-04 11:06:39 -06:00 committed by Andreas Kling
parent f6cca0b8f0
commit 812ee194b7
Notes: sideshowbarker 2024-07-18 10:29:33 +09:00

View File

@ -118,8 +118,8 @@ void WMClientConnection::set_window_minimized(i32 client_id, i32 window_id, bool
void WMClientConnection::toggle_show_desktop()
{
bool should_hide = false;
WindowServer::ClientConnection::for_each_client([&should_hide](auto& client) {
client.for_each_window([&should_hide](Window& window) {
auto& current_window_stack = WindowManager::the().current_window_stack();
current_window_stack.for_each_window([&](auto& window) {
if (window.type() == WindowType::Normal && window.is_minimizable()) {
if (!window.is_hidden() && !window.is_minimized()) {
should_hide = true;
@ -128,10 +128,8 @@ void WMClientConnection::toggle_show_desktop()
}
return IterationDecision::Continue;
});
});
WindowServer::ClientConnection::for_each_client([should_hide](auto& client) {
client.for_each_window([should_hide](Window& window) {
current_window_stack.for_each_window([&](auto& window) {
if (window.type() == WindowType::Normal && window.is_minimizable()) {
auto state = window.minimized_state();
if (state == WindowMinimizedState::None || state == WindowMinimizedState::Hidden) {
@ -140,7 +138,6 @@ void WMClientConnection::toggle_show_desktop()
}
return IterationDecision::Continue;
});
});
}
void WMClientConnection::set_event_mask(u32 event_mask)