mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 12:32:52 +00:00
Do not process keyboard shortcuts (e.g. tools shortcuts) when a foreground window is on top.
This commit is contained in:
parent
27ba604797
commit
623eab27a8
@ -679,6 +679,14 @@ void jmanager_enqueue_message(JMessage msg)
|
||||
jmessage_free(msg);
|
||||
}
|
||||
|
||||
JWidget jmanager_get_top_window()
|
||||
{
|
||||
if (default_manager)
|
||||
return TOPWND(default_manager);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JWidget jmanager_get_focus()
|
||||
{
|
||||
return focus_widget;
|
||||
|
@ -31,6 +31,8 @@ bool jmanager_timer_is_running(int timer_id);
|
||||
|
||||
void jmanager_enqueue_message(JMessage msg);
|
||||
|
||||
JWidget jmanager_get_top_window();
|
||||
|
||||
JWidget jmanager_get_focus();
|
||||
JWidget jmanager_get_mouse();
|
||||
JWidget jmanager_get_capture();
|
||||
|
@ -1173,7 +1173,17 @@ static bool manager_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
break;
|
||||
|
||||
case JM_KEYPRESSED:
|
||||
case JM_KEYPRESSED: {
|
||||
Frame* toplevel_frame = dynamic_cast<Frame*>(jmanager_get_top_window());
|
||||
|
||||
// If there is a foreground window as top level...
|
||||
if (toplevel_frame &&
|
||||
toplevel_frame != app_get_top_window() &&
|
||||
toplevel_frame->is_foreground()) {
|
||||
// We just do not process keyboard shortcuts for menus and tools
|
||||
break;
|
||||
}
|
||||
|
||||
for (std::vector<Shortcut*>::iterator
|
||||
it = shortcuts->begin(); it != shortcuts->end(); ++it) {
|
||||
Shortcut* shortcut = *it;
|
||||
@ -1266,6 +1276,7 @@ static bool manager_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user