mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
WindowServer: Mouse switching between system menu and app menu was broken.
This commit is contained in:
parent
b77f9a5042
commit
18ef6b111b
Notes:
sideshowbarker
2024-07-19 14:40:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/18ef6b111b6
2 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
template<typename T> class OwnPtr;
|
||||
|
||||
template<typename T>
|
||||
class WeakPtr {
|
||||
friend class Weakable<T>;
|
||||
|
@ -43,6 +45,8 @@ public:
|
|||
|
||||
WeakLink<T>* leak_link() { return m_link.leak_ref(); }
|
||||
|
||||
bool operator==(const OwnPtr<T>& other) const { return ptr() == other.ptr(); }
|
||||
|
||||
private:
|
||||
WeakPtr(RetainPtr<WeakLink<T>>&& link) : m_link(move(link)) { }
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ void WSWindowManager::pick_new_active_window()
|
|||
|
||||
void WSWindowManager::handle_menu_mouse_event(WSMenu& menu, const WSMouseEvent& event)
|
||||
{
|
||||
bool is_hover_with_any_menu_open = event.type() == WSMouseEvent::MouseMove && m_current_menu && m_current_menu->menubar();
|
||||
bool is_hover_with_any_menu_open = event.type() == WSMouseEvent::MouseMove && m_current_menu && (m_current_menu->menubar() || m_current_menu == m_system_menu);
|
||||
bool is_mousedown_with_left_button = event.type() == WSMouseEvent::MouseDown && event.button() == MouseButton::Left;
|
||||
bool should_open_menu = &menu != current_menu() && (is_hover_with_any_menu_open || is_mousedown_with_left_button);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue