Author: fireball Date: Fri Nov 26 22:59:37 2010 New Revision: 49800
URL: http://svn.reactos.org/svn/reactos?rev=49800&view=rev Log: [VENDOR/WINE] - Import Wine-1.3.8 gdi32, user32, winex11.drv, server.
Modified: vendor/wine/dlls/gdi32/current/tests/font.c vendor/wine/dlls/gdi32/current/tests/icm.c vendor/wine/dlls/user32/current/focus.c vendor/wine/dlls/user32/current/message.c vendor/wine/dlls/user32/current/painting.c vendor/wine/dlls/user32/current/tests/win.c vendor/wine/dlls/user32/current/user32.spec vendor/wine/dlls/user32/current/win.c vendor/wine/dlls/winex11.drv/current/event.c vendor/wine/dlls/winex11.drv/current/window.c vendor/wine/dlls/winex11.drv/current/x11drv_main.c
Modified: vendor/wine/dlls/gdi32/current/tests/font.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/font... ============================================================================== --- vendor/wine/dlls/gdi32/current/tests/font.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/tests/font.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -1017,16 +1017,28 @@
hdc = GetDC(0);
+ memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "System"); + lf.lfHeight = 16; + lf.lfCharSet = ANSI_CHARSET; + + hfont = CreateFontIndirectA(&lf); ok(GetTextMetrics(hdc, &textm), "GetTextMetric failed\n"); - flags |= GGI_MARK_NONEXISTING_GLYPHS; - charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); - ok((glyphs[4] == 0x001f || glyphs[4] == 0xffff /* Vista */), "GetGlyphIndicesW should have returned a nonexistent char not %04x\n", glyphs[4]); - flags = 0; - charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); - ok(glyphs[4] == textm.tmDefaultChar, "GetGlyphIndicesW should have returned a %04x not %04x\n", - textm.tmDefaultChar, glyphs[4]); + if (textm.tmCharSet == ANSI_CHARSET) + { + flags |= GGI_MARK_NONEXISTING_GLYPHS; + charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok((glyphs[4] == 0x001f || glyphs[4] == 0xffff /* Vista */), "GetGlyphIndicesW should have returned a nonexistent char not %04x\n", glyphs[4]); + flags = 0; + charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(glyphs[4] == textm.tmDefaultChar, "GetGlyphIndicesW should have returned a %04x not %04x\n", + textm.tmDefaultChar, glyphs[4]); + } + else + /* FIXME: Write tests for non-ANSI charsets. */ + skip("GetGlyphIndices System font tests only for ANSI_CHARSET\n");
if(!is_font_installed("Tahoma")) {
Modified: vendor/wine/dlls/gdi32/current/tests/icm.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/icm.... ============================================================================== --- vendor/wine/dlls/gdi32/current/tests/icm.c [iso-8859-1] (original) +++ vendor/wine/dlls/gdi32/current/tests/icm.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -217,7 +217,7 @@ ok(ret == -1 || broken(ret == 0) /* win9x, nt4 */, "expected -1, got %d\n", ret);
ret = EnumICMProfilesW( dc, enum_profiles_callbackW, 0 ); - ok(ret == -1 || broken(ret == 0) /* win9x, nt4 */, "expected -1, got %d\n", ret); + ok(ret == -1 || ret == 1 || broken(ret == 0) /* win9x, nt4 */, "expected -1, got %d\n", ret); }
static void test_SetICMProfileA( HDC dc )
Modified: vendor/wine/dlls/user32/current/focus.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/focus.c?r... ============================================================================== --- vendor/wine/dlls/user32/current/focus.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/focus.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -160,6 +160,7 @@ { GUITHREADINFO info;
+ info.cbSize = sizeof(info); GetGUIThreadInfo( GetCurrentThreadId(), &info ); /* Do not change focus if the window is no more active */ if (hwnd == info.hwndActive)
Modified: vendor/wine/dlls/user32/current/message.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/message.c... ============================================================================== --- vendor/wine/dlls/user32/current/message.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/message.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -2359,6 +2359,7 @@
/* find the window to dispatch this mouse message to */
+ info.cbSize = sizeof(info); GetGUIThreadInfo( GetCurrentThreadId(), &info ); if (info.hwndCapture) { @@ -4229,11 +4230,27 @@
/********************************************************************** + * IsGUIThread (USER32.@) + */ +BOOL WINAPI IsGUIThread( BOOL convert ) +{ + FIXME( "%u: stub\n", convert ); + return TRUE; +} + + +/********************************************************************** * GetGUIThreadInfo (USER32.@) */ BOOL WINAPI GetGUIThreadInfo( DWORD id, GUITHREADINFO *info ) { BOOL ret; + + if (info->cbSize != sizeof(*info)) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + }
SERVER_START_REQ( get_thread_input ) {
Modified: vendor/wine/dlls/user32/current/painting.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/painting.... ============================================================================== --- vendor/wine/dlls/user32/current/painting.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/painting.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -801,6 +801,7 @@ RECT rect, mapped_rcCaret; BOOL hide_caret = FALSE;
+ info.cbSize = sizeof(info); if (!GetGUIThreadInfo( GetCurrentThreadId(), &info )) return 0; if (!info.hwndCaret) return 0;
Modified: vendor/wine/dlls/user32/current/tests/win.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/win... ============================================================================== --- vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -610,6 +610,22 @@ HWND hwnd[3]; BOOL ret; MSG msg; + + if (pGetGUIThreadInfo) + { + GUITHREADINFO info; + info.cbSize = sizeof(info); + ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info ); + ok( ret || broken(!ret), /* win9x */ + "GetGUIThreadInfo failed without message queue\n" ); + SetLastError( 0xdeadbeef ); + info.cbSize = sizeof(info) + 1; + ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info ); + ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || + broken(GetLastError() == 0xdeadbeef), /* win9x */ + "wrong error %u\n", GetLastError() ); + }
PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */
Modified: vendor/wine/dlls/user32/current/user32.spec URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/user32.sp... ============================================================================== --- vendor/wine/dlls/user32/current/user32.spec [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/user32.spec [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -436,7 +436,7 @@ @ stdcall IsDialogMessageA(long ptr) @ stdcall IsDialogMessageW(long ptr) @ stdcall IsDlgButtonChecked(long long) -# @ stub IsGUIThread +@ stdcall IsGUIThread(long) @ stdcall IsHungAppWindow(long) # @ stub IsHungThread @ stdcall IsIconic(long)
Modified: vendor/wine/dlls/user32/current/win.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/win.c?rev... ============================================================================== --- vendor/wine/dlls/user32/current/win.c [iso-8859-1] (original) +++ vendor/wine/dlls/user32/current/win.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -1587,6 +1587,7 @@ { GUITHREADINFO info;
+ info.cbSize = sizeof(info); if (GetGUIThreadInfo( GetCurrentThreadId(), &info )) { if (hwnd == info.hwndCaret) DestroyCaret();
Modified: vendor/wine/dlls/winex11.drv/current/event.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/even... ============================================================================== --- vendor/wine/dlls/winex11.drv/current/event.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/event.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -497,6 +497,7 @@ TRACE( "setting foreground window to %p\n", hwnd ); SetForegroundWindow( hwnd );
+ threadinfo.cbSize = sizeof(threadinfo); GetGUIThreadInfo(0, &threadinfo); focus = threadinfo.hwndFocus; if (!focus) focus = threadinfo.hwndActive;
Modified: vendor/wine/dlls/winex11.drv/current/window.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/wind... ============================================================================== --- vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -78,6 +78,7 @@ static Time last_user_time; static Window user_time_window;
+static const char foreign_window_prop[] = "__wine_x11_foreign_window"; static const char whole_window_prop[] = "__wine_x11_whole_window"; static const char client_window_prop[]= "__wine_x11_client_window"; static const char icon_window_prop[] = "__wine_x11_icon_window"; @@ -1753,7 +1754,23 @@ */ static void destroy_whole_window( Display *display, struct x11drv_win_data *data, BOOL already_destroyed ) { - if (!data->whole_window) return; + if (!data->whole_window) + { + if (data->embedded) + { + Window xwin = (Window)GetPropA( data->hwnd, foreign_window_prop ); + if (xwin) + { + wine_tsx11_lock(); + if (!already_destroyed) XSelectInput( display, xwin, 0 ); + XDeleteContext( display, xwin, winContext ); + wine_tsx11_unlock(); + RemovePropA( data->hwnd, foreign_window_prop ); + } + } + return; + } +
TRACE( "win %p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); wine_tsx11_lock(); @@ -1894,14 +1911,7 @@ if (!(data = X11DRV_get_win_data( hwnd ))) return; if (!data->embedded) FIXME( "window %p/%lx destroyed from the outside\n", hwnd, data->whole_window );
- if (!data->whole_window) - { - wine_tsx11_lock(); - XDeleteContext( display, event->xdestroywindow.window, winContext ); - wine_tsx11_unlock(); - } - else destroy_whole_window( display, data, TRUE ); - + destroy_whole_window( display, data, TRUE ); if (data->embedded) SendMessageW( hwnd, WM_CLOSE, 0, 0 ); }
@@ -2153,6 +2163,7 @@ data->embedded = TRUE; data->mapped = TRUE;
+ SetPropA( hwnd, foreign_window_prop, (HANDLE)xwin ); wine_tsx11_lock(); XSaveContext( display, xwin, winContext, (char *)data->hwnd ); wine_tsx11_unlock();
Modified: vendor/wine/dlls/winex11.drv/current/x11drv_main.c URL: http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/x11d... ============================================================================== --- vendor/wine/dlls/winex11.drv/current/x11drv_main.c [iso-8859-1] (original) +++ vendor/wine/dlls/winex11.drv/current/x11drv_main.c [iso-8859-1] Fri Nov 26 22:59:37 2010 @@ -197,7 +197,7 @@ */ static inline BOOL ignore_error( Display *display, XErrorEvent *event ) { - if (event->request_code == X_SetInputFocus && + if ((event->request_code == X_SetInputFocus || event->request_code == X_ChangeWindowAttributes) && (event->error_code == BadMatch || event->error_code == BadWindow)) return TRUE;
/* ignore a number of errors on gdi display caused by creating/destroying windows */