mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
WindowServer: Ignore mouse clicks we're not handling
This ignores unhandled mouse clicks for the window buttons. Right now right-clicking on the window buttons animates them as if some action were to occur when the mouse button is released.
This commit is contained in:
parent
aa70a56174
commit
a3baf06549
1 changed files with 19 additions and 0 deletions
|
@ -40,6 +40,25 @@ void Button::paint(Gfx::Painter& painter)
|
||||||
|
|
||||||
void Button::on_mouse_event(const MouseEvent& event)
|
void Button::on_mouse_event(const MouseEvent& event)
|
||||||
{
|
{
|
||||||
|
auto interesting_button = false;
|
||||||
|
|
||||||
|
switch (event.button()) {
|
||||||
|
case MouseButton::Left:
|
||||||
|
interesting_button = !!on_click;
|
||||||
|
break;
|
||||||
|
case MouseButton::Middle:
|
||||||
|
interesting_button = !!on_middle_click;
|
||||||
|
break;
|
||||||
|
case MouseButton::Right:
|
||||||
|
interesting_button = !!on_right_click;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!interesting_button)
|
||||||
|
return;
|
||||||
|
|
||||||
auto& wm = WindowManager::the();
|
auto& wm = WindowManager::the();
|
||||||
|
|
||||||
if (event.type() == Event::MouseDown && (event.button() == MouseButton::Left || event.button() == MouseButton::Right || event.button() == MouseButton::Middle)) {
|
if (event.type() == Event::MouseDown && (event.button() == MouseButton::Left || event.button() == MouseButton::Right || event.button() == MouseButton::Middle)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue