Answer dialog intermittently loses focus

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
fredjoans
Posts: 10
Joined: Wed Sep 12, 2018 8:56 pm

Answer dialog intermittently loses focus

Post by fredjoans » Wed Feb 12, 2020 5:00 am

Hello,

I seem to be running into another issue with the Answer dialog. When used, sometimes it has focus immediately after it appears (like it should), and sometimes it does not. When it does not, the user is required to click somewhere on the dialog to place the focus back on it. I have repeatedly tested it and so far I cannot find any clues as to why it sometimes loses focus when it first appears.

Wondering if anyone knows what is going on with it? I notice there is a focus command, but I'm not sure if it will work with the answer dialog.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9655
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Answer dialog intermittently loses focus

Post by dunbarx » Wed Feb 12, 2020 3:56 pm

Hi.

Never seen this.

Are you talking about an "ask" or "answer" dialog. The "ask" dialog sort of has "focus", in that the cursor is blinking in the dialog. So in an "ask" dialog, it is possible to drop the cursor from the field by clicking somewhere else.

An answer dialog only has buttons, but you can still lose focus by clicking, say, back in the stack somewhere. Are you in the IDE or a standalone? What platform LC version and OS?

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Answer dialog intermittently loses focus

Post by bogs » Wed Feb 12, 2020 9:21 pm

dunbarx wrote:
Wed Feb 12, 2020 3:56 pm
An answer dialog only has buttons, but you can still lose focus by clicking, say, back in the stack somewhere.
Say what ?! Is that a Mac thing or something? Cause that don't happen here on 'nix, or in Windows, far as I can tell :shock:

Answer dialogs are completely blocking and should not loose focus (within their own program). The *only* way I can think of one loosing focus is if you click on something completely outside of the program it is running from, for instance, if you clicked on a desktop icon, another program not related to the answer dialog, etc.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9655
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Answer dialog intermittently loses focus

Post by dunbarx » Wed Feb 12, 2020 9:27 pm

Are there other operating systems than Mac OS?

If I open a dialog of either kind, and instead of dealing with it right away, click on the card, say, I am still in LC, but the dialog loses focus. You are right about the blocking thing, that is, I can do nothing until I go back and deal with it.

So the lost focus is mainly visual, I guess, since it changes nothing about the current state of the process.

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Answer dialog intermittently loses focus

Post by bogs » Wed Feb 12, 2020 9:40 pm

Well, if your able to even change the color of the dialog to ...erm, whatever it is when it doesn't have focus by clicking on another card from the same program, I'd say that was a bug, you can see in the video linked above that is *not* supposed to happen.

When you call an answer dialog, and you don't answer it, you have the choice of -
...moving the dialog around
...answering the dialog
and that is about it (or should be).

I wonder if that is what fredjoans means by 'loosing focus', i.e. that it is still blocking but not somehow looking like the foremost window.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9655
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Answer dialog intermittently loses focus

Post by dunbarx » Thu Feb 13, 2020 12:53 am

Bogs.

If you:

Code: Select all

ask "xyzzy"
you get a dialog with a blinking cursor. If you click somewhere inside that dialog (not in the field itself) or back on the card, your cursor remains blinking? And there is no change to the look of the dialog?

I remain unblinking.

Craig

fredjoans
Posts: 10
Joined: Wed Sep 12, 2018 8:56 pm

Re: Answer dialog intermittently loses focus

Post by fredjoans » Thu Feb 13, 2020 6:06 am

All,

This is for the Answer dialog. LC 9.5.1 x64 (Windows 10 x64).

button script:
on mouseUp
answer information "Continue or cancel?" with "Cancel" or "Continue"
(etc, etc)
end mouseUp

Build standalone executable.

Click button. Answer dialog opens. Nothing is done by user besides just moving the mouse cursor. Hover mouse cursor over "Continue" but it does not highlight. Move mouse to "Cancel" and hover but it does not highlight. Left-click once anywhere on the answer dialog and seemingly nothing happens, but now when you hover over "Continue" or "Cancel" they will get highlighted as you hover over them. Now you can left-click and have it continue or cancel like normal.

Again, this happens intermittently. The way it seems to me is that somehow between the button getting clicked and the answer dialog appearing, something grabs the focus away from it. Also, I have noticed that when this happens I can click an object like a button behind the answer dialog with a left click - basically it is like I am clicking right through the answer dialog. It's kinda hard to describe but I hope this helps make it clearer.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7230
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Answer dialog intermittently loses focus

Post by jacque » Thu Feb 13, 2020 5:05 pm

That's definitely not correct behavior. Since you can click through the dialog sometimes, it sounds like a particular condition is causing the problem. It's still a bug though. Can you repeat it in a plain new test stack with only a few buttons?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

fredjoans
Posts: 10
Joined: Wed Sep 12, 2018 8:56 pm

Re: Answer dialog intermittently loses focus

Post by fredjoans » Tue Feb 18, 2020 4:38 am

All,

Ok I think I may have discovered some more information that may help. I have been opening the answer dialog over and over, moving the mouse, trying to pay attention to any subtle differences when the problem occurs. This evening I noticed something: if I don't move the mouse cursor at all after clicking the button that opens the answer dialog, then the problem doesn't occur. It only occurs when I immediately move the mouse cursor after clicking the button that opens the answer dialog. It doesn't always cause the problem when I move the mouse cursor after clicking the button that opens the answer dialog, but if I don't move the mouse cursor at all until the answer dialog has fully appeared then the problem doesn't surface. I tried moving the cursor different directions and different speeds, but so far I have not been able to determine any common direction or speed. It still seems intermittent, but it is only occurring if I click the button to open the answer dialog and immediately start moving the mouse cursor.

jacque: I have not tested it in a plain stack (yet).

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Answer dialog intermittently loses focus

Post by bogs » Tue Feb 18, 2020 11:14 am

dunbarx wrote:
Thu Feb 13, 2020 12:53 am
If you:
ask "xyzzy"
...you get a dialog with a blinking cursor. If you click somewhere inside that dialog (not in the field itself) or back on the card, your cursor remains blinking? And there is no change to the look of the dialog?
Sorry this reply took so long Craig, but I didn't want you to think that I forgot about you :oops:
The only difference in behavior between the ask and answer dialogs is that ask obviously has a field. Of course, the OP was asking about the answer dialog, but in any case -

Two questions that are not equal here, so 2 answers -

1a. if you click somewhere in the dialog that is not in the field of the dialog, the cursor stops blinking in the field, however, this does *not* cause the dialog to loose focus, you have clicked somewhere else on that dialog, and moved the focus to another part of that dialog (card, button, etc).
However, If you move the dialog, guess what? Cursor goes straight back into the field, even though you haven't clicked inside of the field after movement occurred. This is how it *should* work, no matter the OS.
1b. If you click anywhere else outside of the dialog itself, the cursor should remain blinking because you are not clicking on the dialog itself, and since it is blocking, as I said above, your options are to deal with it, or not.

2. Of course there should be no change to the look of the dialog, it should be front and foremost until dealt with. If you are seeing something different, then you have a bug my friend :D

I have quickly set up this video before my classes begin, I have not had time to edit or even plan it out well, but I didn't want this to take any longer getting back to you.

Blocking Ask Dialog Video.
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”