瀏覽代碼

LibGUI: Ignore drop events by default

Before this change, parent widgets such as Buttons or Labels
were stealing drop events their parents.

I noticed it during drag-n-dropping files into visualization widgets
in Sound Player (which takes practically the entire application size
and gave impression that drop events weren't supported in the app
at all).
Karol Kosek 4 年之前
父節點
當前提交
f99507bf02
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Userland/Libraries/LibGUI/Widget.cpp

+ 1 - 0
Userland/Libraries/LibGUI/Widget.cpp

@@ -554,6 +554,7 @@ void Widget::drag_leave_event(Event&)
 void Widget::drop_event(DropEvent& event)
 {
     dbgln("{} {:p} DROP @ {}, '{}'", class_name(), this, event.position(), event.text());
+    event.ignore();
 }
 
 void Widget::theme_change_event(ThemeChangeEvent&)