mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix problem dropping files when a popup window is opened.
This commit is contained in:
parent
c47ac99d86
commit
0b19612860
@ -21,13 +21,13 @@
|
||||
#include <allegro.h>
|
||||
#include <vector>
|
||||
|
||||
#include "gui/frame.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "base/mutex.h"
|
||||
#include "base/scoped_lock.h"
|
||||
#include "commands/commands.h"
|
||||
#include "commands/params.h"
|
||||
#include "gui/frame.h"
|
||||
#include "gui/manager.h"
|
||||
#include "ui_context.h"
|
||||
|
||||
#ifdef ALLEGRO_WINDOWS
|
||||
@ -73,7 +73,9 @@ void check_for_dropped_files()
|
||||
if (!base_wnd_proc) // drop-files hook not installed
|
||||
return;
|
||||
|
||||
if (!app_get_top_window()->is_toplevel())
|
||||
// If the main window is not the current foreground one. We discard
|
||||
// the drop-files event.
|
||||
if (jmanager_get_foreground_window() != app_get_top_window())
|
||||
return;
|
||||
|
||||
ScopedLock lock(*dropped_files_mutex);
|
||||
|
@ -723,6 +723,18 @@ JWidget jmanager_get_top_window()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JWidget jmanager_get_foreground_window()
|
||||
{
|
||||
JLink link;
|
||||
JI_LIST_FOR_EACH(default_manager->children, link) {
|
||||
Frame* frame = (Frame*)link->data;
|
||||
if (frame->is_foreground() ||
|
||||
frame->is_desktop())
|
||||
return frame;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JWidget jmanager_get_focus()
|
||||
{
|
||||
return focus_widget;
|
||||
|
@ -34,6 +34,7 @@ bool jmanager_timer_is_running(int timer_id);
|
||||
void jmanager_enqueue_message(Message* msg);
|
||||
|
||||
JWidget jmanager_get_top_window();
|
||||
JWidget jmanager_get_foreground_window();
|
||||
|
||||
JWidget jmanager_get_focus();
|
||||
JWidget jmanager_get_mouse();
|
||||
|
Loading…
x
Reference in New Issue
Block a user