mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:17:44 +00:00
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:
parent
0d60c56b51
commit
0fc3ccaa52
6 changed files with 56 additions and 8 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue