Pet bug bounty

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1209
Joined: Thu Apr 11, 2013 11:27 am

Re: Pet bug bounty

Post by LCMark » Tue May 21, 2013 11:13 am

@malte: Although the code you found is C# related it does help clarify things (WinForms is based on Win32, so they have the same low-level APIs to play with) - indeed, I did a quick test and it seems that setting the 'owner' window of the modal (in MCScreenDC::openwindow) is enough to make alt-Tab work correctlyish... Unfortunately, it then hits a problem with window focus when switching between apps which needs to be investigated. I think perhaps the correct place to set owners and such is in MCScreenDC::enableformodal which iterates over the stacks and ensures modals (of all types) are correctly enabled. So, some progress at least...

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Pet bug bounty

Post by malte » Tue May 21, 2013 11:29 am

Hey Mark,

so this is one bottle for you already then :-)

I thought I saw a C++ implementation on the MSDN site:

Code: Select all

// C++
private:
   System::Void mnuAbout_Click(System::Object *  sender,
      System::EventArgs *  e)
   {
      Form * f = new Form();
      f->ShowDialog(this);
   }
But as this is still a little over my head I might be mistaken.

Best,

Malte

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1209
Joined: Thu Apr 11, 2013 11:27 am

Re: Pet bug bounty

Post by LCMark » Tue May 21, 2013 11:35 am

@malte: That's managed C++ calling the WinForms (.NET) framwork. The engine uses native C++ and Win32 - however, the key piece gained from that code is that it is the setting of the 'owner' link on the Win32 window that's the key piece which at least tells us how to solve the problem (assuming the focus problem it uncovers is fixed) :)

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Pet bug bounty

Post by malte » Fri Aug 09, 2013 11:38 pm

As I had a complaint about this in one of my apps again, I raise the bounty by another bottle, so whoever fixes this now can get seriously tipsy. :-)

Cheers,

Malte

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Pet bug bounty

Post by FourthWorld » Sat Aug 10, 2013 12:26 am

malte wrote: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.
Does the behavior in other programs differ if the dialog is document-modal rather than application-modal ("...as sheet" will give you document-modal in LC, odd syntax given that there's no sheet effect but oh well)? If so, does LC reflect that same difference?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Pet bug bounty

Post by mwieder » Sat Aug 10, 2013 12:38 am

Looking over this thread again, I see that both Microsoft apps and LC don't do "real" modal dialogs, but fake them. Real modal dialogs would block other system messages and exhibit the kind of behavior you're seeing, where alt-Tab is blocked. So Microsoft fakes it instead by disabling the parent window but not making the foreground window modal. That's why you can still use alt-Tab in MS apps.

LC also doesn't use real modal dialogs, for the same reason. Any application that does do real modal blocking will... er... block. Applications that are build with MFC do the fake thing instead of real modal dialogs, so they'll be immune to this.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Pet bug bounty

Post by malte » Thu Jan 09, 2014 11:01 pm

*bump*

4 bottles...

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Pet bug bounty

Post by trevordevore » Wed Jan 15, 2014 3:11 pm

I would really love to see this one get fixed as well. I have had customers complain about this for years.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Pet bug bounty

Post by malte » Wed Jan 15, 2014 3:28 pm

Same boat Trevor... :-(

Locked

Return to “Engine Contributors”