Author: fireball
Date: Mon Dec 27 15:24:25 2010
New Revision: 50160

URL: http://svn.reactos.org/svn/reactos?rev=50160&view=rev
Log:
[VENDOR/WINE]
- Import Wine-1.3.10 gdi32, user32, winex11.drv, server.

Modified:
    vendor/wine/dlls/gdi32/current/freetype.c
    vendor/wine/dlls/gdi32/current/tests/bitmap.c
    vendor/wine/dlls/gdi32/current/tests/dc.c
    vendor/wine/dlls/user32/current/cursoricon.c
    vendor/wine/dlls/user32/current/tests/dde.c
    vendor/wine/dlls/user32/current/tests/input.c
    vendor/wine/dlls/user32/current/tests/msg.c
    vendor/wine/dlls/user32/current/win.c
    vendor/wine/dlls/user32/current/winpos.c
    vendor/wine/dlls/winex11.drv/current/dib.c
    vendor/wine/dlls/winex11.drv/current/event.c
    vendor/wine/dlls/winex11.drv/current/mouse.c
    vendor/wine/dlls/winex11.drv/current/systray.c
    vendor/wine/dlls/winex11.drv/current/window.c
    vendor/wine/dlls/winex11.drv/current/x11drv.h
    vendor/wine/dlls/winex11.drv/current/xrender.c
    vendor/wine/server/current/Makefile.in
    vendor/wine/server/current/change.c
    vendor/wine/server/current/fd.c
    vendor/wine/server/current/sock.c

Modified: vendor/wine/dlls/gdi32/current/freetype.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/freetype.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/gdi32/current/freetype.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/freetype.c [iso-8859-1] Mon Dec 27 15:24:25 
2010
@@ -6230,6 +6230,7 @@
     {
         glyphset->cbThis = size;
         glyphset->cRanges = num_ranges;
+        glyphset->flAccel = 0;
     }
     return size;
 }

Modified: vendor/wine/dlls/gdi32/current/tests/bitmap.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/bitmap.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/bitmap.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/bitmap.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -1218,7 +1218,8 @@
     BITMAPINFO * info2;
     void * bits;
     void * bits2;
-    UINT dib_size;
+    UINT dib_size, dib32_size;
+    DWORD pixel;
     HDC dib_dc, dc;
     HBITMAP old_bmp;
     BOOL equalContents;
@@ -1254,6 +1255,7 @@
     dib = CreateDIBSection(NULL, info, DIB_RGB_COLORS, &bits, NULL, 0);
     assert(dib);
     dib_size = bpp * (info->bmiHeader.biWidth * info->bmiHeader.biHeight) / 8;
+    dib32_size = 32 * (info->bmiHeader.biWidth * info->bmiHeader.biHeight) / 8;
 
     /* Set the bits of the DIB section */
     for (i=0; i < dib_size; i++)
@@ -1265,7 +1267,7 @@
     dib_dc = CreateCompatibleDC(NULL);
     old_bmp = SelectObject(dib_dc, dib);
     dc = CreateCompatibleDC(NULL);
-    bits2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dib_size);
+    bits2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dib32_size);
     assert(bits2);
 
     /* Copy the DIB attributes but not the color table */
@@ -1299,6 +1301,15 @@
         }
     }
     ok(equalContents, "GetDIBits with %d bpp DIB selected in DC: Invalid DIB 
bits\n",bpp);
+
+    /* Map into a 32bit-DIB */
+    info2->bmiHeader.biBitCount = 32;
+    res = GetDIBits(dc, dib, 0, info->bmiHeader.biHeight, bits2, info2, 
DIB_RGB_COLORS);
+    ok(res, "GetDIBits failed\n");
+
+    /* Check if last pixel was set */
+    pixel = ((DWORD *)bits2)[info->bmiHeader.biWidth * 
info->bmiHeader.biHeight - 1];
+    ok(pixel != 0, "Pixel: 0x%08x\n", pixel);
 
     HeapFree(GetProcessHeap(), 0, bits2);
     DeleteDC(dc);

Modified: vendor/wine/dlls/gdi32/current/tests/dc.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/dc.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/dc.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/dc.c [iso-8859-1] Mon Dec 27 15:24:25 
2010
@@ -528,12 +528,15 @@
            "Expected GetBoundsRect to return 0, got %u\n", ret);
 
         ret = GetBoundsRect(hdc, &rect, 0);
-        ok(ret == DCB_RESET,
-           "Expected GetBoundsRect to return DCB_RESET, got %u\n", ret);
-        SetRect(&expect, 0, 0, 0, 0);
-        ok(EqualRect(&rect, &expect),
-           "Expected output rectangle (0,0)-(0,0), got (%d,%d)-(%d,%d)\n",
-           rect.left, rect.top, rect.right, rect.bottom);
+        if (ret != DCB_SET) /* WinME */
+        {
+            ok(ret == DCB_RESET,
+               "Expected GetBoundsRect to return DCB_RESET, got %u\n", ret);
+            SetRect(&expect, 0, 0, 0, 0);
+            ok(EqualRect(&rect, &expect),
+               "Expected output rectangle (0,0)-(0,0), got (%d,%d)-(%d,%d)\n",
+               rect.left, rect.top, rect.right, rect.bottom);
+       }
     }
 
     if (GetBoundsRect(hdc, NULL, 0) == DCB_RESET)

Modified: vendor/wine/dlls/user32/current/cursoricon.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/cursoricon.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/cursoricon.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/cursoricon.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -1682,6 +1682,7 @@
 BOOL WINAPI GetIconInfoExW( HICON icon, ICONINFOEXW *info )
 {
     struct cursoricon_object *ptr;
+    HMODULE module;
     BOOL ret = TRUE;
 
     if (info->cbSize != sizeof(*info))
@@ -1707,7 +1708,6 @@
     info->szResName[0] = 0;
     if (ptr->module)
     {
-        GetModuleFileNameW( ptr->module, info->szModName, MAX_PATH );
         if (IS_INTRESOURCE( ptr->resname )) info->wResID = LOWORD( 
ptr->resname );
         else lstrcpynW( info->szResName, ptr->resname, MAX_PATH );
     }
@@ -1717,7 +1717,9 @@
         DeleteObject( info->hbmColor );
         ret = FALSE;
     }
+    module = ptr->module;
     release_icon_ptr( icon, ptr );
+    if (ret && module) GetModuleFileNameW( module, info->szModName, MAX_PATH );
     return ret;
 }
 

Modified: vendor/wine/dlls/user32/current/tests/dde.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/dde.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/tests/dde.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/dde.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -2043,12 +2043,6 @@
     dde_inst = 0xdeadbeef;
     SetLastError(0xdeadbeef);
     ret = DdeInitializeW(&dde_inst, client_ddeml_callback, APPCMD_CLIENTONLY, 
0);
-    if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
-    {
-        win_skip("DdeInitializeW is unimplemented\n");
-        return;
-    }
-
     ok(ret == DMLERR_INVALIDPARAMETER, "DdeInitializeW should fail, but got 
%04x instead\n", ret);
     ok(DdeGetLastError(dde_inst) == DMLERR_INVALIDPARAMETER, "expected 
DMLERR_INVALIDPARAMETER\n");
 
@@ -2696,6 +2690,7 @@
     char buffer[MAX_PATH];
     STARTUPINFO startup;
     PROCESS_INFORMATION proc;
+    DWORD dde_inst = 0xdeadbeef;
 
     argc = winetest_get_mainargs(&argv);
     if (argc == 3)
@@ -2714,6 +2709,14 @@
 
     test_initialisation();
 
+    SetLastError(0xdeadbeef);
+    DdeInitializeW(&dde_inst, client_ddeml_callback, APPCMD_CLIENTONLY, 0);
+    if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+    {
+        win_skip("Skipping tests on win9x because of brokenness\n");
+        return;
+    }
+
     ZeroMemory(&startup, sizeof(STARTUPINFO));
     sprintf(buffer, "%s dde ddeml", argv[0]);
     startup.cb = sizeof(startup);

Modified: vendor/wine/dlls/user32/current/tests/input.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/input.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/tests/input.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/input.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -233,7 +233,7 @@
         ADDTOINPUTS(td[i])
         strcat(buf, getdesc[td[i]]);
         if(td[i])
-            expmsg[i].message = KbdMessage(td[i], &(expmsg[i].wParam), 
&(expmsg[i].lParam)); /* see queue_kbd_event() */
+            expmsg[i].message = KbdMessage(td[i], &(expmsg[i].wParam), 
&(expmsg[i].lParam));
         else
             expmsg[i].message = 0;
     }
@@ -1139,6 +1139,8 @@
     WNDCLASSW wclass;
     HANDLE hInstance = GetModuleHandleW(NULL);
     HHOOK hook;
+    HMODULE hModuleImm32;
+    BOOL (WINAPI *pImmDisableIME)(DWORD);
 
     wclass.lpszClassName = classNameW;
     wclass.style         = CS_HREDRAW | CS_VREDRAW;
@@ -1154,6 +1156,16 @@
         win_skip("Unicode functions not supported\n");
         return;
     }
+
+    hModuleImm32 = LoadLibrary("imm32.dll");
+    if (hModuleImm32) {
+        pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME");
+        if (pImmDisableIME)
+            pImmDisableIME(0);
+    }
+    pImmDisableIME = NULL;
+    FreeLibrary(hModuleImm32);
+
     /* create the test window that will receive the keystrokes */
     hWndTest = CreateWindowW(wclass.lpszClassName, windowNameW,
                              WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 100, 100,

Modified: vendor/wine/dlls/user32/current/tests/msg.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/msg.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/tests/msg.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/msg.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -11581,6 +11581,7 @@
     ok( !PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE ), "got message %x\n", 
msg.message );
 
     DestroyWindow(hwnd);
+    DestroyWindow(hwnd2);
 }
 
 #define ID_LISTBOX 0x000f
@@ -12668,6 +12669,8 @@
     char **test_argv;
     BOOL ret;
     BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, 
"IsWinEventHookInstalled");*/
+    HMODULE hModuleImm32;
+    BOOL (WINAPI *pImmDisableIME)(DWORD);
 
     int argc = winetest_get_mainargs( &test_argv );
     if (argc >= 3)
@@ -12680,6 +12683,15 @@
     }
 
     init_procs();
+
+    hModuleImm32 = LoadLibrary("imm32.dll");
+    if (hModuleImm32) {
+        pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME");
+        if (pImmDisableIME)
+            pImmDisableIME(0);
+    }
+    pImmDisableIME = NULL;
+    FreeLibrary(hModuleImm32);
 
     if (!RegisterWindowClasses()) assert(0);
 

Modified: vendor/wine/dlls/user32/current/win.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/win.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/win.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/win.c [iso-8859-1] Mon Dec 27 15:24:25 2010
@@ -740,8 +740,11 @@
                     goto other_process;
                 }
                 win = parent;
-                OffsetRect( &window_rect, win->rectClient.left, 
win->rectClient.top );
-                OffsetRect( &client_rect, win->rectClient.left, 
win->rectClient.top );
+                if (win->parent)
+                {
+                    OffsetRect( &window_rect, win->rectClient.left, 
win->rectClient.top );
+                    OffsetRect( &client_rect, win->rectClient.left, 
win->rectClient.top );
+                }
             }
             break;
         }

Modified: vendor/wine/dlls/user32/current/winpos.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/winpos.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/user32/current/winpos.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/winpos.c [iso-8859-1] Mon Dec 27 15:24:25 
2010
@@ -445,7 +445,7 @@
                 mirror_from = TRUE;
                 offset.x += wndPtr->rectClient.right - wndPtr->rectClient.left;
             }
-            for (;;)
+            while (wndPtr->parent)
             {
                 offset.x += wndPtr->rectClient.left;
                 offset.y += wndPtr->rectClient.top;
@@ -460,6 +460,7 @@
                     goto other_process;
                 }
             }
+            if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr );
         }
     }
 
@@ -475,7 +476,7 @@
                 mirror_to = TRUE;
                 offset.x -= wndPtr->rectClient.right - wndPtr->rectClient.left;
             }
-            for (;;)
+            while (wndPtr->parent)
             {
                 offset.x -= wndPtr->rectClient.left;
                 offset.y -= wndPtr->rectClient.top;
@@ -490,6 +491,7 @@
                     goto other_process;
                 }
             }
+            if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr );
         }
     }
 
@@ -1229,8 +1231,18 @@
     }
     if (pWnd == WND_OTHER_PROCESS)
     {
-        if (IsWindow( hwnd )) FIXME( "not supported on other process window 
%p\n", hwnd );
-        return FALSE;
+        if (!IsWindow( hwnd )) return FALSE;
+        FIXME( "not supported on other process window %p\n", hwnd );
+        /* provide some dummy information */
+        wndpl->length  = sizeof(*wndpl);
+        wndpl->showCmd = SW_SHOWNORMAL;
+        wndpl->flags = 0;
+        wndpl->ptMinPosition.x = -1;
+        wndpl->ptMinPosition.y = -1;
+        wndpl->ptMaxPosition.x = -1;
+        wndpl->ptMaxPosition.y = -1;
+        GetWindowRect( hwnd, &wndpl->rcNormalPosition );
+        return TRUE;
     }
 
     /* update the placement according to the current style */

Modified: vendor/wine/dlls/winex11.drv/current/dib.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/dib.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/dib.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/dib.c [iso-8859-1] Mon Dec 27 15:24:25 
2010
@@ -4210,8 +4210,7 @@
      descr.ySrc = startscan;
   }
   descr.shm_mode = physBitmap->shm_mode;
-  descr.dibpitch = (obj_size == sizeof(DIBSECTION)) ? dib.dsBm.bmWidthBytes
-                      : (((descr.infoWidth * descr.infoBpp + 31) &~31) / 8);
+  descr.dibpitch = (((descr.infoWidth * descr.infoBpp + 31) &~31) / 8);
 
   X11DRV_DIB_Lock( physBitmap, DIB_Status_GdiMod );
   X11DRV_DIB_GetImageBits( &descr );

Modified: vendor/wine/dlls/winex11.drv/current/event.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/event.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/event.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/event.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -788,6 +788,7 @@
 
         flags |= RDW_ALLCHILDREN;
     }
+    else OffsetRect( &rect, virtual_screen_rect.left, virtual_screen_rect.top 
);
 
     RedrawWindow( hwnd, &rect, 0, flags );
 }

Modified: vendor/wine/dlls/winex11.drv/current/mouse.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/mouse.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/mouse.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/mouse.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -238,6 +238,11 @@
     {
         x += data->whole_rect.left - data->client_rect.left;
         y += data->whole_rect.top - data->client_rect.top;
+    }
+    if (window == root_window)
+    {
+        x += virtual_screen_rect.left;
+        y += virtual_screen_rect.top;
     }
     pt->x = x;
     pt->y = y;

Modified: vendor/wine/dlls/winex11.drv/current/systray.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/systray.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/systray.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/systray.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -32,6 +32,7 @@
 
 #include <X11/Xlib.h>
 
+#define NONAMELESSUNION
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
@@ -53,11 +54,16 @@
     HWND           owner;    /* the HWND passed in to the Shell_NotifyIcon 
call */
     HWND           window;   /* the adaptor window */
     HWND           tooltip;  /* Icon tooltip */
+    UINT           state;    /* state flags */
     UINT           id;       /* the unique id given by the app */
     UINT           callback_message;
     int            display;  /* display index, or -1 if hidden */
-    WCHAR          tiptext[256]; /* Tooltip text. If empty => tooltip disabled 
*/
-    WCHAR          tiptitle[64]; /* Tooltip title for ballon style tooltips.  
If empty => tooltip is not balloon style. */
+    WCHAR          tiptext[128];    /* tooltip text */
+    WCHAR          info_text[256];  /* info balloon text */
+    WCHAR          info_title[64];  /* info balloon title */
+    UINT           info_flags;      /* flags for info balloon */
+    UINT           info_timeout;    /* timeout for info balloon */
+    HICON          info_icon;       /* info balloon icon */
 };
 
 static struct list icon_list = LIST_INIT( icon_list );
@@ -77,6 +83,19 @@
 
 #define MIN_DISPLAYED 8
 #define ICON_BORDER 2
+
+#define VALID_WIN_TIMER      1
+#define BALLOON_CREATE_TIMER 2
+#define BALLOON_SHOW_TIMER   3
+
+#define VALID_WIN_TIMEOUT        2000
+#define BALLOON_CREATE_TIMEOUT   2000
+#define BALLOON_SHOW_MIN_TIMEOUT 10000
+#define BALLOON_SHOW_MAX_TIMEOUT 30000
+
+static struct tray_icon *balloon_icon;
+static HWND balloon_window;
+static POINT balloon_pos;
 
 /* stand-alone tray window */
 static HWND standalone_tray;
@@ -93,37 +112,31 @@
     return NULL;
 }
 
+static void init_common_controls(void)
+{
+    static BOOL initialized = FALSE;
+
+    if (!initialized)
+    {
+        INITCOMMONCONTROLSEX init_tooltip;
+
+        init_tooltip.dwSize = sizeof(INITCOMMONCONTROLSEX);
+        init_tooltip.dwICC = ICC_TAB_CLASSES;
+
+        InitCommonControlsEx(&init_tooltip);
+        initialized = TRUE;
+    }
+}
+
 /* create tooltip window for icon */
 static void create_tooltip(struct tray_icon *icon)
 {
-    static BOOL tooltips_initialized = FALSE;
-
-    if (!tooltips_initialized)
-    {
-        INITCOMMONCONTROLSEX init_tooltip;
-
-        init_tooltip.dwSize = sizeof(INITCOMMONCONTROLSEX);
-        init_tooltip.dwICC = ICC_TAB_CLASSES;
-
-        InitCommonControlsEx(&init_tooltip);
-        tooltips_initialized = TRUE;
-    }
-    if (icon->tiptitle[0] != 0)
-    {
-        icon->tooltip = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL,
-                                         WS_POPUP | TTS_ALWAYSTIP | 
TTS_BALLOON,
-                                         CW_USEDEFAULT, CW_USEDEFAULT,
-                                         CW_USEDEFAULT, CW_USEDEFAULT,
-                                         icon->window, NULL, NULL, NULL);
-    }
-    else
-    {
-        icon->tooltip = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL,
-                                         WS_POPUP | TTS_ALWAYSTIP,
-                                         CW_USEDEFAULT, CW_USEDEFAULT,
-                                         CW_USEDEFAULT, CW_USEDEFAULT,
-                                         icon->window, NULL, NULL, NULL);
-    }
+    init_common_controls();
+    icon->tooltip = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL,
+                                     WS_POPUP | TTS_ALWAYSTIP,
+                                     CW_USEDEFAULT, CW_USEDEFAULT,
+                                     CW_USEDEFAULT, CW_USEDEFAULT,
+                                     icon->window, NULL, NULL, NULL);
     if (icon->tooltip)
     {
         TTTOOLINFOW ti;
@@ -137,6 +150,101 @@
     }
 }
 
+void update_systray_balloon_position(void)
+{
+    RECT rect;
+    POINT pos;
+
+    if (!balloon_icon) return;
+    GetWindowRect( balloon_icon->window, &rect );
+    pos.x = (rect.left + rect.right) / 2;
+    pos.y = (rect.top + rect.bottom) / 2;
+    if (pos.x == balloon_pos.x && pos.y == balloon_pos.y) return;  /* nothing 
changed */
+    balloon_pos = pos;
+    SendMessageW( balloon_window, TTM_TRACKPOSITION, 0, MAKELONG( pos.x, pos.y 
));
+}
+
+static void balloon_create_timer( struct tray_icon *icon )
+{
+    TTTOOLINFOW ti;
+
+    init_common_controls();
+    balloon_window = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL,
+                                      WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX 
| TTS_BALLOON | TTS_CLOSE,
+                                      CW_USEDEFAULT, CW_USEDEFAULT, 
CW_USEDEFAULT, CW_USEDEFAULT,
+                                      icon->window, NULL, NULL, NULL);
+
+    memset( &ti, 0, sizeof(ti) );
+    ti.cbSize = sizeof(TTTOOLINFOW);
+    ti.hwnd = icon->window;
+    ti.uId = (UINT_PTR)icon->window;
+    ti.uFlags = TTF_TRACK | TTF_IDISHWND;
+    ti.lpszText = icon->info_text;
+    SendMessageW( balloon_window, TTM_ADDTOOLW, 0, (LPARAM)&ti );
+    if ((icon->info_flags & NIIF_ICONMASK) == NIIF_USER)
+        SendMessageW( balloon_window, TTM_SETTITLEW, (WPARAM)icon->info_icon, 
(LPARAM)icon->info_title );
+    else
+        SendMessageW( balloon_window, TTM_SETTITLEW, icon->info_flags, 
(LPARAM)icon->info_title );
+    balloon_icon = icon;
+    balloon_pos.x = balloon_pos.y = MAXLONG;
+    update_systray_balloon_position();
+    SendMessageW( balloon_window, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti );
+    KillTimer( icon->window, BALLOON_CREATE_TIMER );
+    SetTimer( icon->window, BALLOON_SHOW_TIMER, icon->info_timeout, NULL );
+}
+
+static BOOL show_balloon( struct tray_icon *icon )
+{
+    if (standalone_tray && !show_systray) return FALSE;  /* no systray window 
*/
+    if (!icon->window) return FALSE;  /* not displayed */
+    if (!icon->info_text[0]) return FALSE;  /* no balloon */
+    balloon_icon = icon;
+    SetTimer( icon->window, BALLOON_CREATE_TIMER, BALLOON_CREATE_TIMEOUT, NULL 
);
+    return TRUE;
+}
+
+static void hide_balloon(void)
+{
+    if (!balloon_icon) return;
+    if (balloon_window)
+    {
+        KillTimer( balloon_icon->window, BALLOON_SHOW_TIMER );
+        DestroyWindow( balloon_window );
+        balloon_window = 0;
+    }
+    else KillTimer( balloon_icon->window, BALLOON_CREATE_TIMER );
+    balloon_icon = NULL;
+}
+
+static void show_next_balloon(void)
+{
+    struct tray_icon *icon;
+
+    LIST_FOR_EACH_ENTRY( icon, &icon_list, struct tray_icon, entry )
+        if (show_balloon( icon )) break;
+}
+
+static void update_balloon( struct tray_icon *icon )
+{
+    if (balloon_icon == icon)
+    {
+        hide_balloon();
+        show_balloon( icon );
+    }
+    else if (!balloon_icon)
+    {
+        if (!show_balloon( icon )) return;
+    }
+    if (!balloon_icon) show_next_balloon();
+}
+
+static void balloon_timer(void)
+{
+    if (balloon_icon) balloon_icon->info_text[0] = 0;  /* clear text now that 
balloon has been shown */
+    hide_balloon();
+    show_next_balloon();
+}
+
 /* synchronize tooltip text with tooltip window */
 static void update_tooltip_text(struct tray_icon *icon)
 {
@@ -183,8 +291,12 @@
 {
     switch (msg)
     {
+    case WM_MOVE:
+        update_systray_balloon_position();
+        break;
     case WM_CLOSE:
         ShowWindow( hwnd, SW_HIDE );
+        hide_balloon();
         show_systray = FALSE;
         return 0;
     case WM_DESTROY:
@@ -266,7 +378,7 @@
     switch (msg)
     {
     case WM_CREATE:
-        SetTimer( hwnd, 1, 1000, NULL );
+        SetTimer( hwnd, VALID_WIN_TIMER, VALID_WIN_TIMEOUT, NULL );
         break;
 
     case WM_PAINT:
@@ -306,8 +418,23 @@
         }
         return 0;
 
+    case WM_WINDOWPOSCHANGED:
+        update_systray_balloon_position();
+        break;
+
     case WM_TIMER:
-        if (!IsWindow( icon->owner )) delete_icon( icon );
+        switch (wparam)
+        {
+        case VALID_WIN_TIMER:
+            if (!IsWindow( icon->owner )) delete_icon( icon );
+            break;
+        case BALLOON_CREATE_TIMER:
+            balloon_create_timer( icon );
+            break;
+        case BALLOON_SHOW_TIMER:
+            balloon_timer();
+            break;
+        }
         return 0;
 
     case WM_CLOSE:
@@ -458,6 +585,7 @@
     icon->window = 0;
     icon->tooltip = 0;
     remove_from_standalone_tray( icon );
+    update_balloon( icon );
     return TRUE;
 }
 
@@ -476,6 +604,7 @@
     else
         add_to_standalone_tray( icon );
 
+    update_balloon( icon );
     return TRUE;
 }
 
@@ -484,10 +613,9 @@
 {
     TRACE( "id=0x%x hwnd=%p flags=%x\n", nid->uID, nid->hWnd, nid->uFlags );
 
-    if ((nid->uFlags & NIF_STATE) && (nid->dwStateMask & NIS_HIDDEN))
-    {
-        if (nid->dwState & NIS_HIDDEN) hide_icon( icon );
-        else show_icon( icon );
+    if (nid->uFlags & NIF_STATE)
+    {
+        icon->state = (icon->state & ~nid->dwStateMask) | (nid->dwState & 
nid->dwStateMask);
     }
 
     if (nid->uFlags & NIF_ICON)
@@ -512,15 +640,19 @@
     if (nid->uFlags & NIF_TIP)
     {
         lstrcpynW(icon->tiptext, nid->szTip, 
sizeof(icon->tiptext)/sizeof(WCHAR));
-        icon->tiptitle[0] = 0;
         if (icon->tooltip) update_tooltip_text(icon);
     }
     if (nid->uFlags & NIF_INFO && nid->cbSize >= NOTIFYICONDATAA_V2_SIZE)
     {
-        lstrcpynW(icon->tiptext, nid->szInfo, 
sizeof(icon->tiptext)/sizeof(WCHAR));
-        lstrcpynW(icon->tiptitle, nid->szInfoTitle, 
sizeof(icon->tiptitle)/sizeof(WCHAR));
-        if (icon->tooltip) update_tooltip_text(icon);
-    }
+        lstrcpynW( icon->info_text, nid->szInfo, 
sizeof(icon->info_text)/sizeof(WCHAR) );
+        lstrcpynW( icon->info_title, nid->szInfoTitle, 
sizeof(icon->info_title)/sizeof(WCHAR) );
+        icon->info_flags = nid->dwInfoFlags;
+        icon->info_timeout = max(min(nid->u.uTimeout, 
BALLOON_SHOW_MAX_TIMEOUT), BALLOON_SHOW_MIN_TIMEOUT);
+        icon->info_icon = nid->hBalloonIcon;
+        update_balloon( icon );
+    }
+    if (icon->state & NIS_HIDDEN) hide_icon( icon );
+    else show_icon( icon );
     return TRUE;
 }
 
@@ -549,10 +681,6 @@
     icon->display = -1;
 
     list_add_tail(&icon_list, &icon->entry);
-
-    /* if hidden state is specified, modify_icon will take care of it */
-    if (!((nid->uFlags & NIF_STATE) && (nid->dwStateMask & NIS_HIDDEN)))
-        show_icon( icon );
 
     return modify_icon( icon, nid );
 }

Modified: vendor/wine/dlls/winex11.drv/current/window.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/window.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -1819,17 +1819,16 @@
  */
 void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
 {
-    struct x11drv_win_data *data;
+    struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
     DWORD changed;
 
     if (hwnd == GetDesktopWindow()) return;
     changed = style->styleNew ^ style->styleOld;
 
-    if (offset == GWL_STYLE && (changed & WS_VISIBLE) && (style->styleNew & 
WS_VISIBLE))
-    {
-        /* we don't unmap windows, that causes trouble with the window manager 
*/
-        if (!(data = X11DRV_get_win_data( hwnd )) &&
-            !(data = X11DRV_create_win_data( hwnd ))) return;
+    /* if WS_VISIBLE was set through WM_SETREDRAW, map the window if it's the 
first time */
+    if (offset == GWL_STYLE && (changed & WS_VISIBLE) && (style->styleNew & 
WS_VISIBLE) && !data)
+    {
+        if (!(data = X11DRV_create_win_data( hwnd ))) return;
 
         if (data->whole_window && is_window_rect_mapped( &data->window_rect ))
         {
@@ -1838,20 +1837,13 @@
             if (!data->mapped) map_window( display, data, style->styleNew );
         }
     }
+    if (!data || !data->whole_window) return;
 
     if (offset == GWL_STYLE && (changed & WS_DISABLED))
-    {
-        data = X11DRV_get_win_data( hwnd );
-        if (data && data->whole_window)
-            set_wm_hints( thread_display(), data );
-    }
-
-    if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED))
-    {
-        /* changing WS_EX_LAYERED resets attributes */
-        if ((data = X11DRV_get_win_data( hwnd )) && data->whole_window)
-            sync_window_opacity( thread_display(), data->whole_window, 0, 0, 0 
);
-    }
+        set_wm_hints( thread_display(), data );
+
+    if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing 
WS_EX_LAYERED resets attributes */
+        sync_window_opacity( thread_display(), data->whole_window, 0, 0, 0 );
 }
 
 
@@ -2069,6 +2061,9 @@
 {
     switch(msg)
     {
+    case WM_WINDOWPOSCHANGED:
+        update_systray_balloon_position();
+        break;
     case WM_PARENTNOTIFY:
         if (LOWORD(wparam) == WM_DESTROY)
         {

Modified: vendor/wine/dlls/winex11.drv/current/x11drv.h
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/x11drv.h?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/x11drv.h [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/x11drv.h [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -784,6 +784,7 @@
 extern void update_net_wm_states( Display *display, struct x11drv_win_data 
*data );
 extern void make_window_embedded( Display *display, struct x11drv_win_data 
*data );
 extern void change_systray_owner( Display *display, Window systray_window );
+extern void update_systray_balloon_position(void);
 extern HWND create_foreign_window( Display *display, Window window );
 
 static inline void mirror_rect( const RECT *window_rect, RECT *rect )

Modified: vendor/wine/dlls/winex11.drv/current/xrender.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/xrender.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/xrender.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/xrender.c [iso-8859-1] Mon Dec 27 
15:24:25 2010
@@ -1067,6 +1067,9 @@
     lfsz.devsize.cx = X11DRV_XWStoDS( physDev, lfsz.lf.lfWidth );
     lfsz.devsize.cy = X11DRV_YWStoDS( physDev, lfsz.lf.lfHeight );
     GetWorldTransform( physDev->hdc, &lfsz.xform );
+    /* Not used fields, would break hashing */
+    lfsz.xform.eDx = lfsz.xform.eDy = 0;
+
     lfsz_calc_hash(&lfsz);
 
     info = get_xrender_info(physDev);

Modified: vendor/wine/server/current/Makefile.in
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/Makefile.in?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/server/current/Makefile.in [iso-8859-1] (original)
+++ vendor/wine/server/current/Makefile.in [iso-8859-1] Mon Dec 27 15:24:25 2010
@@ -47,7 +47,9 @@
        winstation.c
 
 PROGRAMS = wineserver wineserver-installed
-MANPAGES = wineserver.man wineserver.de.man wineserver.fr.man
+
+MANPAGE = wineserver.man
+EXTRA_MANPAGES = wineserver.de.man wineserver.fr.man
 
 INSTALLDIRS = \
        $(DESTDIR)$(bindir) \
@@ -55,7 +57,7 @@
        $(DESTDIR)$(mandir)/de.UTF-8/man$(prog_manext) \
        $(DESTDIR)$(mandir)/fr.UTF-8/man$(prog_manext)
 
-all: $(PROGRAMS) $(MANPAGES)
+all: $(PROGRAMS)
 
 @MAKE_RULES@
 
@@ -65,13 +67,14 @@
 wineserver-installed: $(OBJS)
        $(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(LIBS) 
$(LDRPATH_INSTALL)
 
-install install-lib:: wineserver-installed $(MANPAGES) $(INSTALLDIRS)
+install install-lib:: wineserver-installed $(DESTDIR)$(bindir) 
install-man-pages
        $(INSTALL_PROGRAM) wineserver-installed $(DESTDIR)$(bindir)/wineserver
-       $(INSTALL_DATA) wineserver.man 
$(DESTDIR)$(mandir)/man$(prog_manext)/wineserver.$(prog_manext)
+
+install-man-pages:: $(EXTRA_MANPAGES) $(INSTALLDIRS)
        $(INSTALL_DATA) wineserver.de.man 
$(DESTDIR)$(mandir)/de.UTF-8/man$(prog_manext)/wineserver.$(prog_manext)
        $(INSTALL_DATA) wineserver.fr.man 
$(DESTDIR)$(mandir)/fr.UTF-8/man$(prog_manext)/wineserver.$(prog_manext)
 
 uninstall::
-       $(RM) $(DESTDIR)$(bindir)/wineserver 
$(DESTDIR)$(mandir)/man$(prog_manext)/wineserver.$(prog_manext)
+       $(RM) $(DESTDIR)$(bindir)/wineserver
        $(RM) 
$(DESTDIR)$(mandir)/de.UTF-8/man$(prog_manext)/wineserver.$(prog_manext)
        $(RM) 
$(DESTDIR)$(mandir)/fr.UTF-8/man$(prog_manext)/wineserver.$(prog_manext)

Modified: vendor/wine/server/current/change.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/change.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/server/current/change.c [iso-8859-1] (original)
+++ vendor/wine/server/current/change.c [iso-8859-1] Mon Dec 27 15:24:25 2010
@@ -94,40 +94,21 @@
 #define IN_DELETE        0x00000200
 #define IN_DELETE_SELF   0x00000400
 
+#define IN_ISDIR         0x40000000
+
 static inline int inotify_init( void )
 {
-    int ret;
-    __asm__ __volatile__( "int $0x80"
-                          : "=a" (ret)
-                          : "0" (SYS_inotify_init));
-    if (ret<0) { errno = -ret; ret = -1; }
-    return ret;
+    return syscall( SYS_inotify_init );
 }
 
 static inline int inotify_add_watch( int fd, const char *name, unsigned int 
mask )
 {
-    int ret;
-    __asm__ __volatile__( "pushl %%ebx;\n\t"
-                          "movl %2,%%ebx;\n\t"
-                          "int $0x80;\n\t"
-                          "popl %%ebx"
-                          : "=a" (ret) : "0" (SYS_inotify_add_watch),
-                            "r" (fd), "c" (name), "d" (mask) );
-    if (ret<0) { errno = -ret; ret = -1; }
-    return ret;
+    return syscall( SYS_inotify_add_watch, fd, name, mask );
 }
 
 static inline int inotify_rm_watch( int fd, int wd )
 {
-    int ret;
-    __asm__ __volatile__( "pushl %%ebx;\n\t"
-                          "movl %2,%%ebx;\n\t"
-                          "int $0x80;\n\t"
-                          "popl %%ebx"
-                          : "=a" (ret) : "0" (SYS_inotify_rm_watch),
-                            "r" (fd), "c" (wd) );
-    if (ret<0) { errno = -ret; ret = -1; }
-    return ret;
+    return syscall( SYS_inotify_rm_watch, fd, wd );
 }
 
 #define USE_INOTIFY
@@ -664,6 +645,11 @@
     if (ie->mask & IN_CREATE)
         filter |= FILE_NOTIFY_CHANGE_CREATION;
 
+    if (ie->mask & IN_ISDIR)
+        filter &= ~FILE_NOTIFY_CHANGE_FILE_NAME;
+    else
+        filter &= ~FILE_NOTIFY_CHANGE_DIR_NAME;
+
     return filter;
 }
 
@@ -719,30 +705,22 @@
     return path;
 }
 
-static int inode_check_dir( struct inode *parent, const char *name )
+static void inode_check_dir( struct inode *parent, const char *name )
 {
     char *path;
     unsigned int filter;
     struct inode *inode;
     struct stat st;
-    int wd = -1, r = -1;
+    int wd = -1;
 
     path = inode_get_path( parent, strlen(name) );
     if (!path)
-        return r;
+        return;
 
     strcat( path, name );
 
-    r = stat( path, &st );
-    if (r < 0) goto end;
-
-    if (!S_ISDIR(st.st_mode))
-    {
-        r = 0;
+    if (stat( path, &st ) < 0)
         goto end;
-    }
-
-    r = 1;
 
     filter = filter_from_inode( parent, 1 );
     if (!filter)
@@ -760,7 +738,6 @@
 
 end:
     free( path );
-    return r;
 }
 
 static int prepend( char **path, const char *segment )
@@ -808,22 +785,17 @@
     
     if (ie->mask & IN_CREATE)
     {
-        switch (inode_check_dir( inode, ie->name ))
-        {
-        case 1:
-            filter &= ~FILE_NOTIFY_CHANGE_FILE_NAME;
-            break;
-        case 0:
-            filter &= ~FILE_NOTIFY_CHANGE_DIR_NAME;
-            break;
-        default:
-            break;
-            /* Maybe the file disappeared before we could check it? */
-        }
+        if (ie->mask & IN_ISDIR)
+            inode_check_dir( inode, ie->name );
+
         action = FILE_ACTION_ADDED;
     }
     else if (ie->mask & IN_DELETE)
         action = FILE_ACTION_REMOVED;
+    else if (ie->mask & IN_MOVED_FROM)
+        action = FILE_ACTION_RENAMED_OLD_NAME;
+    else if (ie->mask & IN_MOVED_TO)
+        action = FILE_ACTION_RENAMED_NEW_NAME;
     else
         action = FILE_ACTION_MODIFIED;
 

Modified: vendor/wine/server/current/fd.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/fd.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/server/current/fd.c [iso-8859-1] (original)
+++ vendor/wine/server/current/fd.c [iso-8859-1] Mon Dec 27 15:24:25 2010
@@ -127,38 +127,20 @@
   epoll_data_t data;
 };
 
-#define SYSCALL_RET(ret) do { \
-        if (ret < 0) { errno = -ret; ret = -1; } \
-        return ret; \
-    } while(0)
-
 static inline int epoll_create( int size )
 {
-    int ret;
-    __asm__( "pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
-             : "=a" (ret) : "0" (254 /*NR_epoll_create*/), "r" (size) );
-    SYSCALL_RET(ret);
+    return syscall( 254 /*NR_epoll_create*/, size );
 }
 
 static inline int epoll_ctl( int epfd, int op, int fd, const struct 
epoll_event *event )
 {
-    int ret;
-    __asm__( "pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
-             : "=a" (ret)
-             : "0" (255 /*NR_epoll_ctl*/), "r" (epfd), "c" (op), "d" (fd), "S" 
(event), "m" (*event) );
-    SYSCALL_RET(ret);
+    return syscall( 255 /*NR_epoll_ctl*/, epfd, op, fd, event );
 }
 
 static inline int epoll_wait( int epfd, struct epoll_event *events, int 
maxevents, int timeout )
 {
-    int ret;
-    __asm__( "pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
-             : "=a" (ret)
-             : "0" (256 /*NR_epoll_wait*/), "r" (epfd), "c" (events), "d" 
(maxevents), "S" (timeout)
-             : "memory" );
-    SYSCALL_RET(ret);
-}
-#undef SYSCALL_RET
+    return syscall( 256 /*NR_epoll_wait*/, epfd, events, maxevents, timeout );
+}
 
 #endif /* linux && __i386__ && HAVE_STDINT_H */
 

Modified: vendor/wine/server/current/sock.c
URL: 
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/sock.c?rev=50160&r1=50159&r2=50160&view=diff
==============================================================================
--- vendor/wine/server/current/sock.c [iso-8859-1] (original)
+++ vendor/wine/server/current/sock.c [iso-8859-1] Mon Dec 27 15:24:25 2010
@@ -203,7 +203,8 @@
     pfd.events = POLLIN;
     pfd.revents = 0;
 
-    n = poll( &pfd, 1, 0 );
+    /* Solaris' poll() sometimes returns nothing if given a 0ms timeout here */
+    n = poll( &pfd, 1, 1 );
     if ( n != 1 ) goto out; /* error or timeout */
     if ( pfd.revents & POLLHUP )
         ret = SOCK_SHUTDOWN_POLLHUP;


Reply via email to