1
0
Fork 0

Canvas: Add an option for Canvas dialogs to not take focus from the simulator

This commit is contained in:
Josh Davidson 2022-06-28 16:41:36 -04:00 committed by James Turner
parent cb5ecad1ec
commit 918b5fd72f

View file

@ -73,11 +73,12 @@ var Window = {
# Constructor
#
# @param size ([width, height])
new: func(size, type = nil, id = nil)
new: func(size, type = nil, id = nil, allowfocus = 1)
{
var ghost = _newWindowGhost(id);
var m = {
parents: [Window, PropertyElement, ghost],
_allowfocus: allowfocus,
_ghost: ghost,
_node: props.wrapNode(ghost._node_ghost),
_focused: 0,
@ -215,6 +216,8 @@ var Window = {
if( gui.focused_window != nil )
gui.focused_window.clearFocus();
if (!me._allowfocus) return me; # Make the window not take focus, so focus returns to FGFS
me._focused = 1;
# me.onFocusIn();
me._onStateChange();