Skip to content

Allow installing extensions by dropping them into the preferences dialog#5697

Merged
dacap merged 1 commit into
aseprite:mainfrom
ckaiser:preferences-drop-extensions
Mar 18, 2026
Merged

Allow installing extensions by dropping them into the preferences dialog#5697
dacap merged 1 commit into
aseprite:mainfrom
ckaiser:preferences-drop-extensions

Conversation

@ckaiser

@ckaiser ckaiser commented Mar 7, 2026

Copy link
Copy Markdown
Member

Right now if you double click an extension from the OS, install it, and then attempt to install another one, it does nothing because "dropping" files only works when the foreground window is the main window.

This change allows the event to propagate so we can have modal dialogs that accept file drops, in this case the Preferences dialog accepts .aseprite-extension and .zip (since if you're dropping something onto here, it'll most likely be an extension).

@ckaiser ckaiser requested a review from dacap as a code owner March 7, 2026 06:06

@aseprite-bot aseprite-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

miniFontPreview()->setFont(m_miniFont);
}

bool onProcessMessage(Message* msg) override

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'onProcessMessage' can be made static [readability-convert-member-functions-to-static]

Suggested change
bool onProcessMessage(Message* msg) override
static bool onProcessMessage(Message* msg) override

{
switch (msg->type()) {
case kDropFilesMessage:
base::paths files = static_cast<DropFilesMessage*>(msg)->files();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'files' of type 'base::paths' (aka 'vector<basic_string>') can be declared 'const' [misc-const-correctness]

Suggested change
base::paths files = static_cast<DropFilesMessage*>(msg)->files();
base::paths const files = static_cast<DropFilesMessage*>(msg)->files();

@dacap

dacap commented Mar 18, 2026

Copy link
Copy Markdown
Member

LGTM 👍

@dacap dacap merged commit e5f5b64 into aseprite:main Mar 18, 2026
12 checks passed
@ckaiser ckaiser deleted the preferences-drop-extensions branch May 7, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants