Page 2 of 2

Re: Pet bug bounty

Posted: Tue May 21, 2013 11:13 am
by LCMark
@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...

Re: Pet bug bounty

Posted: Tue May 21, 2013 11:29 am
by malte
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

Re: Pet bug bounty

Posted: Tue May 21, 2013 11:35 am
by LCMark
@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) :)

Re: Pet bug bounty

Posted: Fri Aug 09, 2013 11:38 pm
by malte
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

Re: Pet bug bounty

Posted: Sat Aug 10, 2013 12:26 am
by FourthWorld
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?

Re: Pet bug bounty

Posted: Sat Aug 10, 2013 12:38 am
by mwieder
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.

Re: Pet bug bounty

Posted: Thu Jan 09, 2014 11:01 pm
by malte
*bump*

4 bottles...

Re: Pet bug bounty

Posted: Wed Jan 15, 2014 3:11 pm
by trevordevore
I would really love to see this one get fixed as well. I have had customers complain about this for years.

Re: Pet bug bounty

Posted: Wed Jan 15, 2014 3:28 pm
by malte
Same boat Trevor... :-(