WindowServer: Make WSButton behave more like a normal button.

Previously it would just close the window on MouseDown. Now we do the normal
thing where we require a MouseUp inside the button rect before committing.
This commit is contained in:
Andreas Kling 2019-04-05 21:53:45 +02:00
commit 0fc3ccaa52
Notes: sideshowbarker 2024-07-19 14:48:36 +09:00
6 changed files with 56 additions and 8 deletions

View file

@ -16,7 +16,8 @@
#include <time.h>
#include <SharedGraphics/StylePainter.h>
#include <SharedGraphics/PNGLoader.h>
#include "WSCursor.h"
#include <WindowServer/WSCursor.h>
#include <WindowServer/WSButton.h>
//#define DEBUG_COUNTERS
//#define RESIZE_DEBUG
@ -614,6 +615,9 @@ void WSWindowManager::process_mouse_event(const WSMouseEvent& event, WSWindow*&
if (process_ongoing_window_resize(event, event_window))
return;
if (m_cursor_tracking_button)
return m_cursor_tracking_button->on_mouse_event(event.translated(-m_cursor_tracking_button->screen_rect().location()));
HashTable<WSWindow*> windows_who_received_mouse_event_due_to_cursor_tracking;
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {