HackStudio: Activate window only on file drop
This commit is contained in:
parent
d7f0472b25
commit
b2daaca5ee
Notes:
sideshowbarker
2024-07-19 17:25:45 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/b2daaca5ee1 Pull-request: https://github.com/SerenityOS/serenity/pull/8693 Reviewed-by: https://github.com/gunnarbeutner ✅
1 changed files with 1 additions and 1 deletions
|
@ -345,12 +345,12 @@ void Editor::mousedown_event(GUI::MouseEvent& event)
|
||||||
void Editor::drop_event(GUI::DropEvent& event)
|
void Editor::drop_event(GUI::DropEvent& event)
|
||||||
{
|
{
|
||||||
event.accept();
|
event.accept();
|
||||||
window()->move_to_front();
|
|
||||||
|
|
||||||
if (event.mime_data().has_urls()) {
|
if (event.mime_data().has_urls()) {
|
||||||
auto urls = event.mime_data().urls();
|
auto urls = event.mime_data().urls();
|
||||||
if (urls.is_empty())
|
if (urls.is_empty())
|
||||||
return;
|
return;
|
||||||
|
window()->move_to_front();
|
||||||
if (urls.size() > 1) {
|
if (urls.size() > 1) {
|
||||||
GUI::MessageBox::show(window(), "HackStudio can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error);
|
GUI::MessageBox::show(window(), "HackStudio can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue