mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
Make buttons unpress when the cursor leaves the button rect.
Implement this functionality by adding global cursor tracking. It's currently only possible for one GWidget per GWindow to track the cursor.
This commit is contained in:
@@ -244,3 +244,16 @@ int Process::gui$set_window_rect(int window_id, const GUI_Rect* rect)
|
||||
WSMessageLoop::the().server_process().request_wakeup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::gui$set_global_cursor_tracking_enabled(int window_id, bool enabled)
|
||||
{
|
||||
if (window_id < 0)
|
||||
return -EINVAL;
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end())
|
||||
return -EBADWINDOW;
|
||||
auto& window = *(*it).value;
|
||||
WSWindowLocker locker(window);
|
||||
window.set_global_cursor_tracking_enabled(enabled);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user