mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
WindowServer: Switch Window to IntrusiveList from InlineLinkedList
Another small step towards unifying IntrusiveList / InlineLinkedList.
This commit is contained in:
parent
7e691f96e1
commit
d0dbb014a0
3 changed files with 36 additions and 29 deletions
|
@ -284,7 +284,7 @@ private:
|
|||
RefPtr<Cursor> m_wait_cursor;
|
||||
RefPtr<Cursor> m_crosshair_cursor;
|
||||
|
||||
InlineLinkedList<Window> m_windows_in_order;
|
||||
Window::List m_windows_in_order;
|
||||
|
||||
struct DoubleClickInfo {
|
||||
struct ClickMetadata {
|
||||
|
@ -411,16 +411,18 @@ IterationDecision WindowManager::for_each_visible_window_of_type_from_front_to_b
|
|||
return IterationDecision::Break;
|
||||
}
|
||||
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (!window->is_visible())
|
||||
auto reverse_iterator = m_windows_in_order.rbegin();
|
||||
for (; reverse_iterator != m_windows_in_order.rend(); ++reverse_iterator) {
|
||||
auto& window = *reverse_iterator;
|
||||
if (!window.is_visible())
|
||||
continue;
|
||||
if (window->is_minimized())
|
||||
if (window.is_minimized())
|
||||
continue;
|
||||
if (window->type() != type)
|
||||
if (window.type() != type)
|
||||
continue;
|
||||
if (!ignore_highlight && window == m_highlight_window)
|
||||
if (!ignore_highlight && &window == m_highlight_window)
|
||||
continue;
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
if (callback(window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
@ -463,8 +465,10 @@ void WindowManager::for_each_window_manager(Callback callback)
|
|||
template<typename Callback>
|
||||
void WindowManager::for_each_window(Callback callback)
|
||||
{
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
auto reverse_iterator = m_windows_in_order.rbegin();
|
||||
for (; reverse_iterator != m_windows_in_order.rend(); ++reverse_iterator) {
|
||||
auto& window = *reverse_iterator;
|
||||
if (callback(window) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -477,12 +481,14 @@ IterationDecision WindowManager::for_each_window_of_type_from_front_to_back(Wind
|
|||
return IterationDecision::Break;
|
||||
}
|
||||
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (window->type() != type)
|
||||
auto reverse_iterator = m_windows_in_order.rbegin();
|
||||
for (; reverse_iterator != m_windows_in_order.rend(); ++reverse_iterator) {
|
||||
auto& window = *reverse_iterator;
|
||||
if (window.type() != type)
|
||||
continue;
|
||||
if (!ignore_highlight && window == m_highlight_window)
|
||||
if (!ignore_highlight && &window == m_highlight_window)
|
||||
continue;
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
if (callback(window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue