Module: wine Branch: master Commit: 125793df0eab65798f53529784e7256d407f2ef0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=125793df0eab65798f53529784...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Feb 18 17:22:51 2008 +0100
winex11: Move the raising of windows on SetFocus to the X11 driver where it belongs.
---
dlls/user32/focus.c | 4 ---- dlls/winex11.drv/window.c | 16 ++++++---------- 2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index e2932d2..2eb1496 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -113,10 +113,6 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) if (SendMessageW( hwnd, WM_QUERYNEWPALETTE, 0, 0 )) SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0, SMTO_ABORTIFHUNG, 2000, NULL ); - - if (!GetPropA( hwnd, "__wine_x11_managed" )) - SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); - if (!IsWindow(hwnd)) return FALSE; }
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5ead133..1e65a72 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1516,13 +1516,10 @@ void X11DRV_SetFocus( HWND hwnd ) { Display *display = thread_display(); struct x11drv_win_data *data; - XWindowAttributes win_attr; - - /* Only mess with the X focus if there's */ - /* no desktop window and if the window is not managed by the WM. */ - if (root_window != DefaultRootWindow(display)) return; + XWindowChanges changes;
- if (!hwnd) /* If setting the focus to 0, uninstall the colormap */ + /* If setting the focus to 0, uninstall the colormap */ + if (!hwnd && root_window == DefaultRootWindow(display)) { wine_tsx11_lock(); if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_PRIVATE) @@ -1538,11 +1535,10 @@ void X11DRV_SetFocus( HWND hwnd )
/* Set X focus and install colormap */ wine_tsx11_lock(); - if (XGetWindowAttributes( display, data->whole_window, &win_attr ) && - (win_attr.map_state == IsViewable)) + changes.stack_mode = Above; + XConfigureWindow( display, data->whole_window, CWStackMode, &changes ); + if (root_window == DefaultRootWindow(display)) { - /* If window is not viewable, don't change anything */ - /* 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,