summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVT
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2022-06-20 11:57:26 +0200
committerSam Atkins <atkinssj@gmail.com>2022-08-31 17:29:44 +0100
commit1d9ec8bd56b76749ddc8f22e0a24ce059e3653d4 (patch)
treed283778712545431c0df0c6ce4dd7a52818436d5 /Userland/Libraries/LibVT
parentf1aa03b7790175b5a936ee337afb71bbeff41ef5 (diff)
downloadserenity-1d9ec8bd56b76749ddc8f22e0a24ce059e3653d4.zip
LibVT: Accept supported drag enter events
Diffstat (limited to 'Userland/Libraries/LibVT')
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.cpp7
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp
index 5edb5b5f8c..bc544d6336 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.cpp
+++ b/Userland/Libraries/LibVT/TerminalWidget.cpp
@@ -1115,6 +1115,13 @@ void TerminalWidget::context_menu_event(GUI::ContextMenuEvent& event)
}
}
+void TerminalWidget::drag_enter_event(GUI::DragEvent& event)
+{
+ auto const& mime_types = event.mime_types();
+ if (mime_types.contains_slow("text/plain") || mime_types.contains_slow("text/uri-list"))
+ event.accept();
+}
+
void TerminalWidget::drop_event(GUI::DropEvent& event)
{
if (event.mime_data().has_urls()) {
diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h
index 63de6617f6..be4bcbb78c 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.h
+++ b/Userland/Libraries/LibVT/TerminalWidget.h
@@ -120,6 +120,7 @@ private:
virtual void focusin_event(GUI::FocusEvent&) override;
virtual void focusout_event(GUI::FocusEvent&) override;
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
+ virtual void drag_enter_event(GUI::DragEvent&) override;
virtual void drop_event(GUI::DropEvent&) override;
virtual void leave_event(Core::Event&) override;
virtual void did_change_font() override;