1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

SpaceAnalyzer: Fix the crash caused by using arrow keys

Previously, SpaceAnalyzer set focus on the selected BreadcrumbButton.
Using arrow keys triggered the keydown_event of the AbstractButton,
which later on caused a Function object to be deleted while it is still
being used.

This change sets the focus on TreeMapWidget and adds an event handler
to TreeMapWidget for keydown events.

Fixes #13254.
This commit is contained in:
Arif Orhun Uzun 2022-03-30 22:44:00 +03:00 committed by Andreas Kling
parent 51df97e799
commit eb34015748
3 changed files with 11 additions and 0 deletions

View file

@ -47,6 +47,7 @@ private:
virtual void doubleclick_event(GUI::MouseEvent&) override;
virtual void mousewheel_event(GUI::MouseEvent&) override;
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
bool rect_can_contain_children(const Gfx::IntRect& rect) const;
bool rect_can_contain_label(const Gfx::IntRect& rect) const;