diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-10-21 14:48:59 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-10-21 14:48:59 +0000 |
commit | 29dd8bbd9e39cde1a5e0e7e7cca02f894559e6c0 (patch) | |
tree | 7d34104a62a1c9d4dea0e65da2ca59f764eec67f | |
parent | c10000ca290e88df57f35abded93be279dd20027 (diff) |
CWS-TOOLING: integrate CWS fwk123
2009-10-14 10:18:49 +0200 cd r276885 : #i99971# Use AttachThreadInput to force SetForegroundWindow
2009-10-14 08:56:20 +0200 mav r276881 : #i105476# let the allocated memory live long anough
2009-10-14 08:53:51 +0200 mav r276880 : #i105476# let ZipFile use mutex while creating the requested stream
2009-10-14 08:51:52 +0200 mav r276879 : #i105476# let buffered IO use mutex ( patch from MHU )
2009-10-09 12:20:22 +0200 cd r276803 : #i99971# Use configuration to control window to front/focus handling
2009-10-09 12:19:22 +0200 cd r276802 : #i99971# New configuration item to force set focus and window to front for new document windows
2009-10-09 12:18:23 +0200 cd r276801 : #i99971# Introduction of a new show flag to force window to front
2009-10-06 11:04:16 +0200 ab r276695 : #i105386# Call xmlInitParser() before registering input callbacks
-rw-r--r-- | vcl/inc/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 12 |
3 files changed, 13 insertions, 2 deletions
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 3f05383d4f80..eba46362d94e 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -165,6 +165,7 @@ namespace vcl { struct ControlLayoutData; } #define SHOW_NOPARENTUPDATE ((USHORT)0x0001) #define SHOW_NOFOCUSCHANGE ((USHORT)0x0002) #define SHOW_NOACTIVATE ((USHORT)0x0004) +#define SHOW_FOREGROUNDTASK ((USHORT)0x0008) // Flags for SetZOrder() #define WINDOW_ZORDER_BEFOR ((USHORT)0x0001) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 6aff4779d8b2..63bf407ce49f 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -6514,7 +6514,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) // nach vorne, wenn es gewuenscht ist if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) ) { - ImplStartToTop( 0 ); + ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 ); ImplFocusToTop( 0, FALSE ); } diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 4a49d83918da..78c4e4e6ddcc 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2157,7 +2157,17 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags ) BringWindowToTop( hWnd ); if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK ) - SetForegroundWindow( hWnd ); + { + // This magic code is necessary to connect the input focus of the
+ // current window thread and the thread which owns the window that
+ // should be the new foreground window.
+ HWND hCurrWnd = GetForegroundWindow();
+ DWORD myThreadID = GetCurrentThreadId();
+ DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,NULL);
+ AttachThreadInput(myThreadID, currThreadID,TRUE);
+ SetForegroundWindow(hWnd);
+ AttachThreadInput(myThreadID,currThreadID,FALSE);
+ } if ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) { |