Page 1 of 2

Pet bug bounty

Posted: Fri May 17, 2013 10:29 am
by malte
Now, actually I am not (yet) in the situation that I can mess with the guts of the engine. Sooooo... I really need to have a specific bug fixed. How do I a) start looking what might cause it and b) go about fixing it (while I am learning C) :-)

The bug in question is:

http://quality.runrev.com/show_bug.cgi?id=10384

Bottle of Whisk(e)y to the one who helps fixing :-)

Best,

Malte

Re: Pet bug bounty

Posted: Fri May 17, 2013 10:33 am
by shaosean
can you post what the bug is, not everyone has access to the bug database..

Re: Pet bug bounty

Posted: Fri May 17, 2013 11:08 am
by malte
Hi s.

Modal dialogue prevents alt tab on windows to get back to LC app

If a modal dialogue is open you can not use alt + Tab on windows to come back to your liveCode application.

Cheers,

Malte

Re: Pet bug bounty

Posted: Fri May 17, 2013 7:49 pm
by shaosean
Good God Windows sucks :P

Re: Pet bug bounty

Posted: Sat May 18, 2013 11:16 pm
by mwieder
Looks like this is an issue that was first reported in 2006.
I so do not want to mess with this.
Whisky's tempting, though...

Re: Pet bug bounty

Posted: Sun May 19, 2013 12:04 am
by malte
2 bottles then... <g>

Re: Pet bug bounty

Posted: Sun May 19, 2013 5:27 am
by shaosean
From what I can tell, this is standard Windows behaviour when there is a modal dialog open and has nothing to do with Windows.. Either pick a different window type (modeless) or live with it ;-)

Re: Pet bug bounty

Posted: Sun May 19, 2013 8:48 am
by snm
It's not my busines, but shaosean should get two botles of whisk(e)y :)

Marek

Re: Pet bug bounty

Posted: Sun May 19, 2013 9:05 am
by malte
Actually no, as far as I can see it is not. Or at least there are other Windows programs that can have modals open and can be alt tabbed back to.

Cheers,

Malte

Re: Pet bug bounty

Posted: Sun May 19, 2013 1:53 pm
by trevordevore
My original report has some more details about how other applications behave. The LiveCode behavior is not standard.

http://quality.runrev.com/show_bug.cgi?id=3865

Re: Pet bug bounty

Posted: Mon May 20, 2013 4:49 am
by shaosean
Again, not everyone has access to the bug database so would you be so kind as to post the content of it?

Re: Pet bug bounty

Posted: Mon May 20, 2013 4:52 am
by shaosean
A side effect of displaying a dialog box using the native win32 api is that the normal message loop processing of the application is disabled and replaced by a special dialog box message processing loop. This has various unpleasant side-effects and I think possibly the alt-tab issue is one of them. The MFC class library gets around this by "faking" a modal dialog box. It does this by explicitly calling EnableWindow(FALSE) on the parent window, effectively making it look like the dialog box is modal.

Re: Pet bug bounty

Posted: Mon May 20, 2013 10:38 am
by BvG
ShaoSean: everyone should currently have access to the bug database. Previously it was pay-to-read, but that's gone now, so you should be able to create a login, or email support if it doesn't work.

Re: Pet bug bounty

Posted: Mon May 20, 2013 11:48 am
by LCMark
It would be great if someone could figure out what needs to be done to make this work correctly.

The engine doesn't use the Win32 'modal loop' as this isn't compatible with the way the engine works for commands that block (such as ask / answer etc.). Also, the engine supports application and window modality - again something which Win32 doesn't support with the higher-level Modal loop it provides.

In terms of what the current problem is, I'm not entirely sure (despite having looked at it a few times). There are various aspects of Window relationships (child, parent, owner) and the enablement state whose interactions are not clearly documented (on MSDN). Also, the code for window stacking and display in the Windows engine has had so many small corrections for bug-fixes over the years it is now a bit spaghetti like.

So, moving forward on this, if someone can find some example code that is very clear that shows a modal dialog subordinate to a main window without using the Win32 Modal loop functionality and preserves alt-Tab behavior (and other behaviors that are expected!) we can compare with what the engine is doing and see how to apply an appropriate fix.

Re: Pet bug bounty

Posted: Mon May 20, 2013 4:04 pm
by malte
Quick search on stackOverflow yields this:

http://stackoverflow.com/questions/1405 ... dal-dialog

and in detail this:

http://msdn.microsoft.com/en-us/library ... FilterText

The discussion on SO said if the owner argument is set when using Form.ShowDialog, it does not vanish from the task switcher anymore.

"The Form.ShowDialog method has an optional argument, owner, that can be used to specify a parent-child relationship for a form."

Now, I am not sure if that is used by the engine of course... Please excuse my dumbness there.