Module: wine
Branch: master
Commit: 4622889bd5fd64122ee9bf6e80d48a99cf878b85
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4622889bd5fd64122ee9bf6e8…
Author: Vincent Povirk <vincent(a)codeweavers.com>
Date: Wed Nov 11 14:52:14 2009 -0600
winex11.drv: Ignore FocusOut events on virtual desktop windows.
We don't want to send WM_CANCELMODE or set the foreground window to the
desktop when a virtual desktop loses focus. It has its own focus independent
of X.
---
dlls/winex11.drv/event.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 8c23203..e8e4522 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -678,6 +678,7 @@ static void X11DRV_FocusOut( HWND hwnd, XEvent *xev )
wine_tsx11_unlock();
}
if (hwnd != GetForegroundWindow()) return;
+ if (root_window != DefaultRootWindow(event->display)) return;
SendMessageW( hwnd, WM_CANCELMODE, 0, 0 );
/* don't reset the foreground window, if the window which is
Module: wine
Branch: master
Commit: 6823f4aaf8b91b729062573e4eef94f9e29b7792
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6823f4aaf8b91b729062573e4…
Author: Vincent Povirk <vincent(a)codeweavers.com>
Date: Wed Nov 11 14:37:51 2009 -0600
winex11.drv: Allow explorer to focus other process windows.
When explorer gets a take focus message, it tries to focus the foreground
window, but this doesn't work because set_focus can only focus windows in
the current process. We have to look for the focus window in the foreground
thread, not the current one, or we won't find the other process's windows.
Since the other process may crash at any time, causing its windows to be
destroyed, we also have to ignore the BadWindow error that will occur if that
happens at a critical time.
---
dlls/winex11.drv/event.c | 4 +++-
dlls/winex11.drv/x11drv_main.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 345b675..8c23203 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -476,11 +476,13 @@ static void set_focus( Display *display, HWND hwnd, Time time )
{
HWND focus;
Window win;
+ GUITHREADINFO threadinfo;
TRACE( "setting foreground window to %p\n", hwnd );
SetForegroundWindow( hwnd );
- focus = GetFocus();
+ GetGUIThreadInfo(0, &threadinfo);
+ focus = threadinfo.hwndFocus;
if (focus) focus = GetAncestor( focus, GA_ROOT );
win = X11DRV_get_whole_window(focus);
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 8299457..b97426e 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -188,7 +188,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
*/
static inline BOOL ignore_error( Display *display, XErrorEvent *event )
{
- if (event->request_code == X_SetInputFocus && event->error_code == BadMatch) return TRUE;
+ if (event->request_code == X_SetInputFocus &&
+ (event->error_code == BadMatch || event->error_code == BadWindow)) return TRUE;
/* ignore a number of errors on gdi display caused by creating/destroying windows */
if (display == gdi_display)
Module: wine
Branch: master
Commit: 05f00f4ed86697d6e0eb45e5157b867db08c75dd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=05f00f4ed86697d6e0eb45e51…
Author: Vincent Povirk <vincent(a)codeweavers.com>
Date: Wed Nov 11 13:29:58 2009 -0600
winex11.drv: Allow windows in a virtual desktop to have X focus.
---
dlls/winex11.drv/window.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 4bbd5de..5df7df2 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2025,14 +2025,11 @@ void CDECL X11DRV_SetFocus( HWND hwnd )
wine_tsx11_lock();
changes.stack_mode = Above;
XConfigureWindow( display, data->whole_window, CWStackMode, &changes );
- if (root_window == DefaultRootWindow(display))
- {
- /* we must not use CurrentTime (ICCCM), so try to use last message time instead */
- /* FIXME: this is not entirely correct */
- XSetInputFocus( display, data->whole_window, RevertToParent,
- /* CurrentTime */
- GetMessageTime() - EVENT_x11_time_to_win32_time(0));
- }
+ /* we must not use CurrentTime (ICCCM), so try to use last message time instead */
+ /* FIXME: this is not entirely correct */
+ XSetInputFocus( display, data->whole_window, RevertToParent,
+ /* CurrentTime */
+ GetMessageTime() - EVENT_x11_time_to_win32_time(0));
wine_tsx11_unlock();
}