Fix to Bug 8984

David Logan <[email protected]>
Newsgroups gmane.comp.gnu.dotgnu.developer
Message-ID <[email protected]>
I have updates to Widget.cs and MdiClientWidget.cs. I do not know who to 
send the sources to, so they are attached. The problem boils down to this:

Widget.cs: When trying to set the focus of a child window or a child 
control, we eventually get into Widget.cs, which tries to get the top 
level window. The top level window is the application window, the top 
guy (i.e. no parent.) In order to do so, it starts with the current 
widget, and travels upward through the parent chain until it finds a 
widget of type "TopLevelWindow". This widget must have the primary focus 
(i.e. the application itself must have focus, regardless of any child 
windows.) Otherwise, child windows do not actually *get* the focus, they 
are just marked as "will get focus" when the application gets the 
primary focus.

However, MdiClientWidget.cs creates instances of TopLevelWindow as child 
windows of an MDI application. This causes a problem because Widget.cs 
cannot distinguish between the actual top level window and the top level 
windows created by this class. And, of course, the MDI child never has 
primary focus, because it is not the application window.

My solution was to add a bool to Widget.cs, called "mdiWidget". 
MdiClientWidget.cs sets this bool to true when it creates MDI child 
windows. Then Widget.cs knows to keep travelling upward rather than stop 
there.

David Logan
Bug8984.tgz (application/x-gzip, 11.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.