From 1718a40ac70f87433463ecc5723bff694b7cd4d2 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 17 Nov 2022 09:13:57 -0500 Subject: [PATCH] LibGUI+WindowServer: Add WindowType:Autocomplete and helpers --- Userland/Libraries/LibGUI/Window.h | 2 ++ Userland/Services/WindowServer/WindowFrame.cpp | 1 + Userland/Services/WindowServer/WindowManager.cpp | 1 + Userland/Services/WindowServer/WindowManager.h | 6 +++++- Userland/Services/WindowServer/WindowType.h | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 290eba0bbb..44f10d9880 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -39,6 +39,8 @@ public: bool is_blocking() const { return m_window_mode == WindowMode::Blocking; } bool is_capturing_input() const { return m_window_mode == WindowMode::CaptureInput; } + bool is_autocomplete() const { return m_window_type == WindowType::Autocomplete; } + bool is_fullscreen() const { return m_fullscreen; } void set_fullscreen(bool); diff --git a/Userland/Services/WindowServer/WindowFrame.cpp b/Userland/Services/WindowServer/WindowFrame.cpp index 1dbb42c5c6..b68321ba35 100644 --- a/Userland/Services/WindowServer/WindowFrame.cpp +++ b/Userland/Services/WindowServer/WindowFrame.cpp @@ -210,6 +210,7 @@ MultiScaleBitmaps const* WindowFrame::shadow_bitmap() const if (!WindowManager::the().system_effects().menu_shadow()) return nullptr; return s_menu_shadow; + case WindowType::Autocomplete: case WindowType::Tooltip: if (!WindowManager::the().system_effects().tooltip_shadow()) return nullptr; diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 196ce52cf6..0e68aee5ec 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -1424,6 +1424,7 @@ Gfx::IntRect WindowManager::arena_rect_for_type(Screen& screen, WindowType type) case WindowType::Applet: case WindowType::Notification: case WindowType::Popup: + case WindowType::Autocomplete: return screen.rect(); default: VERIFY_NOT_REACHED(); diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 2a63dd8621..a92ad93f6b 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -511,10 +511,12 @@ inline IterationDecision WindowManager::for_each_visible_window_from_back_to_fro return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; - if (for_each_window.template operator()() == IterationDecision::Break) + if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; + if (for_each_window.template operator()() == IterationDecision::Break) + return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; return for_each_window.template operator()(); @@ -546,6 +548,8 @@ inline IterationDecision WindowManager::for_each_visible_window_from_front_to_ba return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; + if (for_each_window.template operator()() == IterationDecision::Break) + return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) return IterationDecision::Break; if (for_each_window.template operator()() == IterationDecision::Break) diff --git a/Userland/Services/WindowServer/WindowType.h b/Userland/Services/WindowServer/WindowType.h index 632005d037..8d1dc68e2c 100644 --- a/Userland/Services/WindowServer/WindowType.h +++ b/Userland/Services/WindowServer/WindowType.h @@ -20,6 +20,7 @@ enum class WindowType { Desktop, AppletArea, Popup, + Autocomplete, _Count };