CVS: winex/windows win.c,1.32,1.33

[email protected]
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/windows win.c,1.32,1.33Update of /var/lib/cvsd/cvsroot/winex/windows
In directory agravaine:/tmp/cvs-serv31110/windows

Modified Files:
	win.c 
Log Message:
If the game enables a window when no window is active, activate it.
I'm not sure whether this is the right thing to do, but works for now
with how StarCraft's Battle.net does wacky stuff as usual.


Index: win.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/windows/win.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- win.c	27 Mar 2007 21:01:57 -0000	1.32
+++ win.c	27 Apr 2007 13:12:54 -0000	1.33
@@ -1715,6 +1715,13 @@
     {
         WIN_SetStyle( hwnd, style & ~WS_DISABLED );
         SendMessageA( hwnd, WM_ENABLE, TRUE, 0 );
+
+        /* If this is a top-level window and no other window
+         * is active, let's activate this one...
+         * (this helps StarCraft's Battle.net dialogs;
+         * I'm not 100% sure if it is correct, but makes sense) */
+        if (!(style & WS_CHILD) && GetForegroundWindow() == 0)
+            SetForegroundWindow(hwnd);
     }
     else if (!enable && !retvalue)
     {
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.