mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:57:36 +00:00
LibGUI+WindowServer: Remove now-obsolete cursor tracking feature
This feature was problematic for several reasons: - Tracking *all* the user activity seems like a privacy nightmare. - LibGUI actually only supports one globally tracking widget per window, even if no window is necessary, or if multiple callbacks are desired. - Widgets can easily get confused whether an event is actually directed at it, or is actually just the result of global tracking. The third item caused an issue where right-clicking CatDog opened two context menus instead of one.
This commit is contained in:
parent
0a69da08aa
commit
c6e56612f5
8 changed files with 1 additions and 60 deletions
|
@ -653,16 +653,6 @@ void ClientConnection::set_window_backing_store(i32 window_id, [[maybe_unused]]
|
|||
window.invalidate(false);
|
||||
}
|
||||
|
||||
void ClientConnection::set_global_cursor_tracking(i32 window_id, bool enabled)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
did_misbehave("SetGlobalCursorTracking: Bad window ID");
|
||||
return;
|
||||
}
|
||||
it->value->set_global_cursor_tracking_enabled(enabled);
|
||||
}
|
||||
|
||||
void ClientConnection::set_global_mouse_tracking(bool enabled)
|
||||
{
|
||||
m_does_global_mouse_tracking = enabled;
|
||||
|
|
|
@ -113,7 +113,6 @@ private:
|
|||
virtual Messages::WindowServer::GetAppletRectOnScreenResponse get_applet_rect_on_screen(i32) override;
|
||||
virtual void invalidate_rect(i32, Vector<Gfx::IntRect> const&, bool) override;
|
||||
virtual void did_finish_painting(i32, Vector<Gfx::IntRect> const&) override;
|
||||
virtual void set_global_cursor_tracking(i32, bool) override;
|
||||
virtual void set_global_mouse_tracking(bool) override;
|
||||
virtual void set_window_opacity(i32, float) override;
|
||||
virtual void set_window_backing_store(i32, i32, i32, IPC::File const&, i32, bool, Gfx::IntSize const&, bool) override;
|
||||
|
|
|
@ -1201,12 +1201,6 @@ void WindowManager::process_mouse_event(MouseEvent& event)
|
|||
return;
|
||||
|
||||
// 2. Send the mouse event to all clients with global cursor tracking enabled.
|
||||
auto& window_stack = current_window_stack();
|
||||
for_each_visible_window_from_front_to_back([&](Window& window) {
|
||||
if (window.global_cursor_tracking() && &window != window_stack.active_input_tracking_window())
|
||||
deliver_mouse_event(window, event, false);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
ClientConnection::for_each_client([&](ClientConnection& conn) {
|
||||
if (conn.does_global_mouse_tracking()) {
|
||||
conn.async_track_mouse_move(event.position());
|
||||
|
|
|
@ -74,7 +74,6 @@ endpoint WindowServer
|
|||
invalidate_rect(i32 window_id, Vector<Gfx::IntRect> rects, bool ignore_occlusion) =|
|
||||
did_finish_painting(i32 window_id, Vector<Gfx::IntRect> rects) =|
|
||||
|
||||
set_global_cursor_tracking(i32 window_id, bool enabled) =|
|
||||
set_global_mouse_tracking(bool enabled) =|
|
||||
set_window_opacity(i32 window_id, float opacity) =|
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue