1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:27:45 +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:
Andreas Kling 2019-01-27 08:48:34 +01:00
parent 15fad649ea
commit 069d21ed7f
15 changed files with 105 additions and 7 deletions

View file

@ -56,3 +56,9 @@ int gui_notify_paint_finished(int window_id, const GUI_Rect* rect)
int rc = syscall(SC_gui_notify_paint_finished, window_id, rect);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int gui_set_global_cursor_tracking_enabled(int window_id, bool enabled)
{
int rc = syscall(SC_gui_set_global_cursor_tracking_enabled, window_id, enabled);
__RETURN_WITH_ERRNO(rc, rc, -1);
}

View file

@ -14,6 +14,7 @@ int gui_get_window_title(int window_id, char*, size_t);
int gui_set_window_title(int window_id, const char*, size_t);
int gui_get_window_rect(int window_id, GUI_Rect*);
int gui_set_window_rect(int window_id, const GUI_Rect*);
int gui_set_global_cursor_tracking_enabled(int window_id, bool);
__END_DECLS