From a2885904c8209c7379ed3f98df1b6c1a7f8ea84e Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 30 Apr 2007 18:50:56 +0000 Subject: [PATCH] aggressively call SetForegroundWindow() --- panda/src/windisplay/winGraphicsWindow.cxx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 3ab4893663..ba1714405f 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -402,14 +402,18 @@ open_window() { new_foreground_window = old_foreground_window; } - if (!SetActiveWindow(new_foreground_window)) - { + if (!SetActiveWindow(new_foreground_window)) { + windisplay_cat.warning() + << "SetActiveWindow() failed!\n"; + } + + // Let's aggressively call SetForegroundWindow() in addition to + // SetActiveWindow(). It seems to work in some cases to make the + // window come to the top, where SetActiveWindow doesn't work. + if (!SetForegroundWindow(new_foreground_window)) { windisplay_cat.warning() << "SetForegroundWindow() failed!\n"; } - else - { - } // Determine the initial open status of the IME. _ime_open = false; @@ -799,17 +803,10 @@ open_fullscreen_window() // up the desktop during the mode change const WindowClass &wclass = register_window_class(_properties); HINSTANCE hinstance = GetModuleHandle(NULL); - - - _hWnd = CreateWindow(wclass._name.c_str(), title.c_str(), window_style, 0, 0, dwWidth, dwHeight, hDesktopWindow, NULL, hinstance, 0); - - - - if (!_hWnd) { windisplay_cat.error() << "CreateWindow() failed!" << endl;