From 8c4d1d251e09999043a08356e858e871e10b042e Mon Sep 17 00:00:00 2001 From: Jonathan Gillaspie Date: Tue, 13 Apr 2010 19:11:40 +0000 Subject: [PATCH] * Source/win32/WIN32Server.m: Have non-key, non-main windows that order front not become active. Also don't bring windows that are ordering out to the foreground first. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@30142 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/win32/WIN32Server.m | 22 +++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 583c1b9..dd21a35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-14 Jonathan Gillaspie + + * Source/win32/WIN32Server.m: Have non-key, non-main windows + that order front not become active. Also don't bring windows + that are ordering out to the foreground first. + 2010-03-25 Fred Kiefer * Source/art/ftfont.m, diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index ccd1475..fc96589 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -1011,6 +1011,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, int foreground = 0; int otherLevel; int level; + NSWindow *window = GSWindowWithNumber(winNum); NSDebugLLog(@"WTrace", @"orderwindow: %d : %d : %d", op, otherWin, winNum); @@ -1036,11 +1037,6 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, } } - flag = SW_SHOW; - if (IsIconic((HWND)winNum)) - flag = SW_RESTORE; - ShowWindow((HWND)winNum, flag); - if (op == NSWindowOut) { SetWindowLong((HWND)winNum, OFF_ORDERED, 0); @@ -1048,6 +1044,22 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER); return; } + + if (![window canBecomeMainWindow] && ![window canBecomeKeyWindow]) + { // Bring front, but do not activate, eg - tooltips + flag = SW_SHOWNA; + ShowWindow((HWND)winNum, flag); + } + else + { + flag = SW_SHOW; + + if (IsIconic((HWND)winNum)) + flag = SW_RESTORE; + + ShowWindow((HWND)winNum, flag); + } + SetWindowLong((HWND)winNum, OFF_ORDERED, 1); level = GetWindowLong((HWND)winNum, OFF_LEVEL);