summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-11-17 09:06:41 -0500
committerAndreas Kling <kling@serenityos.org>2022-11-19 16:04:42 +0100
commit3027cf7e99ee417233ec89ba0f5a7e040706b6fd (patch)
tree8511535dcfd9f666ab74234ffcd760dcc0c37685
parent5d567565a4ab17cc694e0c79f21b8b6f793960c5 (diff)
downloadserenity-3027cf7e99ee417233ec89ba0f5a7e040706b6fd.zip
LibGUI+WindowServer: Remove InputPreemptor concept
This functionality will be superceded by WindowType:Popups
-rw-r--r--Userland/Libraries/LibGUI/ComboBox.cpp1
-rw-r--r--Userland/Libraries/LibGUI/CommandPalette.cpp4
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp6
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowServer.h1
-rw-r--r--Userland/Libraries/LibGUI/EmojiInputDialog.cpp5
-rw-r--r--Userland/Libraries/LibGUI/Window.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Window.h2
-rw-r--r--Userland/Libraries/LibGUI/WindowMode.h1
-rw-r--r--Userland/Services/WindowServer/MenuManager.cpp10
-rw-r--r--Userland/Services/WindowServer/WindowClient.ipc1
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp6
-rw-r--r--Userland/Services/WindowServer/WindowManager.h1
-rw-r--r--Userland/Services/WindowServer/WindowMode.h9
13 files changed, 0 insertions, 53 deletions
diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp
index 58615c6948..f7dd1f8711 100644
--- a/Userland/Libraries/LibGUI/ComboBox.cpp
+++ b/Userland/Libraries/LibGUI/ComboBox.cpp
@@ -124,7 +124,6 @@ ComboBox::ComboBox()
}
m_open_button->set_enabled(true);
};
- m_list_window->on_input_preemption = [this](auto) { close(); };
m_list_view = m_list_window->set_main_widget<ListView>();
m_list_view->set_should_hide_unnecessary_scrollbars(true);
diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp
index 56799988e9..1b05e6e276 100644
--- a/Userland/Libraries/LibGUI/CommandPalette.cpp
+++ b/Userland/Libraries/LibGUI/CommandPalette.cpp
@@ -229,10 +229,6 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen
close();
};
- on_input_preemption = [this](InputPreemptor preemptor) {
- if (preemptor != InputPreemptor::ContextMenu)
- close();
- };
}
void CommandPalette::collect_actions(GUI::Window& parent_window)
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
index 60b03b1192..e658dab496 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
@@ -374,12 +374,6 @@ void ConnectionToWindowServer::window_state_changed(i32 window_id, bool minimize
window->notify_state_changed({}, minimized, maximized, occluded);
}
-void ConnectionToWindowServer::window_input_preempted(i32 window_id, i32 preemptor)
-{
- if (auto* window = Window::from_window_id(window_id))
- window->notify_input_preempted({}, static_cast<InputPreemptor>(preemptor));
-}
-
void ConnectionToWindowServer::display_link_notification()
{
if (m_display_link_notification_pending)
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h
index 19965ae59f..c3c176e502 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h
@@ -55,7 +55,6 @@ private:
virtual void update_system_fonts(String const&, String const&, String const&) override;
virtual void update_system_effects(Vector<bool> const&) override;
virtual void window_state_changed(i32, bool, bool, bool) override;
- virtual void window_input_preempted(i32, i32) override;
virtual void display_link_notification() override;
virtual void track_mouse_move(Gfx::IntPoint const&) override;
virtual void ping() override;
diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp
index 551af22f71..51f36164fc 100644
--- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp
+++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp
@@ -144,11 +144,6 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
close();
};
- on_input_preemption = [this](InputPreemptor preemptor) {
- if (preemptor != InputPreemptor::ContextMenu)
- close();
- };
-
m_search_box->on_change = [this]() {
update_displayed_emoji();
};
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp
index 8dd89c7e13..9f1945bb4d 100644
--- a/Userland/Libraries/LibGUI/Window.cpp
+++ b/Userland/Libraries/LibGUI/Window.cpp
@@ -1163,12 +1163,6 @@ void Window::notify_state_changed(Badge<ConnectionToWindowServer>, bool minimize
}
}
-void Window::notify_input_preempted(Badge<ConnectionToWindowServer>, InputPreemptor preemptor)
-{
- if (on_input_preemption)
- on_input_preemption(preemptor);
-}
-
Action* Window::action_for_shortcut(Shortcut const& shortcut)
{
return Action::find_action_for_shortcut(*this, shortcut);
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index bacb09346c..3597dc539e 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -99,7 +99,6 @@ public:
Function<void(bool is_active_input)> on_active_input_change;
Function<void(bool is_preempted)> on_input_preemption_change;
Function<void(bool is_active_window)> on_active_window_change;
- Function<void(InputPreemptor)> on_input_preemption;
int x() const { return rect().x(); }
int y() const { return rect().y(); }
@@ -206,7 +205,6 @@ public:
static void for_each_window(Badge<ConnectionToWindowServer>, Function<void(Window&)>);
static void update_all_windows(Badge<ConnectionToWindowServer>);
void notify_state_changed(Badge<ConnectionToWindowServer>, bool minimized, bool maximized, bool occluded);
- void notify_input_preempted(Badge<ConnectionToWindowServer>, InputPreemptor);
virtual bool is_visible_for_timer_purposes() const override { return m_visible_for_timer_purposes; }
diff --git a/Userland/Libraries/LibGUI/WindowMode.h b/Userland/Libraries/LibGUI/WindowMode.h
index 9aeff8c803..93bbad0701 100644
--- a/Userland/Libraries/LibGUI/WindowMode.h
+++ b/Userland/Libraries/LibGUI/WindowMode.h
@@ -11,6 +11,5 @@
namespace GUI {
using WindowMode = WindowServer::WindowMode;
-using InputPreemptor = WindowServer::InputPreemptor;
}
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp
index 83dbbe72ea..7b5ac31723 100644
--- a/Userland/Services/WindowServer/MenuManager.cpp
+++ b/Userland/Services/WindowServer/MenuManager.cpp
@@ -355,16 +355,6 @@ void MenuManager::set_current_menu(Menu* menu)
}
m_current_menu = menu;
-
- auto& wm = WindowManager::the();
- if (auto* window = wm.active_input_window()) {
- InputPreemptor preemptor { InputPreemptor::OtherMenu };
- if (window->rect().contains(m_current_menu->unadjusted_position()))
- preemptor = InputPreemptor::ContextMenu;
- else if (!m_current_menu->rect_in_window_menubar().is_null())
- preemptor = InputPreemptor::MenubarMenu;
- wm.notify_input_preempted(*window, preemptor);
- }
}
Menu* MenuManager::previous_menu(Menu* current)
diff --git a/Userland/Services/WindowServer/WindowClient.ipc b/Userland/Services/WindowServer/WindowClient.ipc
index 686d70c3ae..bfe9ec8186 100644
--- a/Userland/Services/WindowServer/WindowClient.ipc
+++ b/Userland/Services/WindowServer/WindowClient.ipc
@@ -20,7 +20,6 @@ endpoint WindowClient
window_activated(i32 window_id) =|
window_deactivated(i32 window_id) =|
window_state_changed(i32 window_id, bool minimized, bool maximized, bool occluded) =|
- window_input_preempted(i32 window_id, i32 preemptor) =|
window_close_request(i32 window_id) =|
window_resized(i32 window_id, Gfx::IntRect new_rect) =|
window_moved(i32 window_id, Gfx::IntRect new_rect) =|
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index dbfeb45a9f..7de186e7a5 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -642,12 +642,6 @@ void WindowManager::notify_progress_changed(Window& window)
tell_wms_window_state_changed(window);
}
-void WindowManager::notify_input_preempted(Window& window, InputPreemptor preemptor)
-{
- if (window.client())
- window.client()->async_window_input_preempted(window.window_id(), (i32)preemptor);
-}
-
void WindowManager::pick_new_active_window(Window* previous_active)
{
Window* desktop = nullptr;
diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h
index a6598e7215..1d5b665db7 100644
--- a/Userland/Services/WindowServer/WindowManager.h
+++ b/Userland/Services/WindowServer/WindowManager.h
@@ -76,7 +76,6 @@ public:
void notify_occlusion_state_changed(Window&);
void notify_progress_changed(Window&);
void notify_modified_changed(Window&);
- void notify_input_preempted(Window&, InputPreemptor = InputPreemptor::Other);
Gfx::IntRect tiled_window_rect(Window const&, WindowTileType tile_type = WindowTileType::Maximized, bool relative_to_window_screen = false) const;
diff --git a/Userland/Services/WindowServer/WindowMode.h b/Userland/Services/WindowServer/WindowMode.h
index 3cb82ee1f8..c70e821337 100644
--- a/Userland/Services/WindowServer/WindowMode.h
+++ b/Userland/Services/WindowServer/WindowMode.h
@@ -24,13 +24,4 @@ enum class WindowMode {
_Count,
};
-// InputPreemptors are Objects which take input precedence over the active input
-// window without changing its activity state or joining its modal chain
-enum class InputPreemptor {
- ContextMenu = 0,
- MenubarMenu,
- OtherMenu,
- Other,
-};
-
}