Author: fireball
Date: Sat Mar 6 16:00:23 2010
New Revision: 45949
URL:
http://svn.reactos.org/svn/reactos?rev=45949&view=rev
Log:
- Sync up to Wine-1.1.40.
- winent.drv: Since GetObject doesn't report negative height for topdown bitmaps
anymore, rely on information from bmi. In future, it should be fixed to just provide a
boolean topdown flag to the kernelmode GDI driver counterpart.
Modified:
branches/arwinss/reactos/dll/win32/gdi32/ (props changed)
branches/arwinss/reactos/dll/win32/gdi32/bitmap.c
branches/arwinss/reactos/dll/win32/gdi32/dc.c
branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c
branches/arwinss/reactos/dll/win32/user32/ (props changed)
branches/arwinss/reactos/dll/win32/user32/dialog.c
branches/arwinss/reactos/dll/win32/user32/edit.c
branches/arwinss/reactos/dll/win32/user32/input.c
branches/arwinss/reactos/dll/win32/user32/message.c
branches/arwinss/reactos/dll/win32/user32/painting.c
branches/arwinss/reactos/dll/win32/user32/spy.c
branches/arwinss/reactos/dll/win32/user32/win.c
branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
branches/arwinss/reactos/dll/win32/winex11.drv/ (props changed)
branches/arwinss/reactos/dll/win32/winex11.drv/bitblt.c
branches/arwinss/reactos/dll/win32/winex11.drv/dib.c
branches/arwinss/reactos/dll/win32/winex11.drv/ime.c
branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c
branches/arwinss/reactos/dll/win32/winex11.drv/window.c
branches/arwinss/reactos/dll/win32/winex11.drv/x11drv.h
branches/arwinss/reactos/dll/win32/winex11.drv/xdnd.c
branches/arwinss/reactos/dll/win32/winex11.drv/xim.c
branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c
branches/arwinss/reactos/subsystems/win32/win32k/wine/ (props changed)
branches/arwinss/reactos/subsystems/win32/win32k/wine/queue.c
Propchange: branches/arwinss/reactos/dll/win32/gdi32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 6 16:00:23 2010
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/gdi32:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/gdi32:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688
-/vendor/wine/dlls/gdi32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646
+/vendor/wine/dlls/gdi32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910
Modified: branches/arwinss/reactos/dll/win32/gdi32/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/bitmap.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/bitmap.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -678,7 +678,9 @@
{
if (count >= sizeof(DIBSECTION))
{
- memcpy( buffer, bmp->dib, sizeof(DIBSECTION) );
+ DIBSECTION *dib = buffer;
+ *dib = *bmp->dib;
+ dib->dsBmih.biHeight = abs( dib->dsBmih.biHeight );
ret = sizeof(DIBSECTION);
}
else /* if (count >= sizeof(BITMAP)) */
Modified: branches/arwinss/reactos/dll/win32/gdi32/dc.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/dc.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/dc.c [iso-8859-1] Sat Mar 6 16:00:23 2010
@@ -819,7 +819,7 @@
if (dc->hookProc && !dc->hookProc( hdc, DCHC_DELETEDC,
dc->dwHookData, 0 ))
{
release_dc_ptr( dc );
- return FALSE;
+ return TRUE;
}
while (dc->saveLevel)
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -89,7 +89,8 @@
static const LOGFONTW AnsiFixedFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
- 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} };
+ 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
+
{'C','o','u','r','i','e','r','\0'}
};
static const LOGFONTW AnsiVarFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
@@ -637,6 +638,50 @@
static GDIOBJHDR *large_handles[MAX_LARGE_HANDLES];
static int next_large_handle;
+static const char *gdi_obj_type( unsigned type )
+{
+ switch ( type )
+ {
+ case OBJ_PEN: return "OBJ_PEN";
+ case OBJ_BRUSH: return "OBJ_BRUSH";
+ case OBJ_DC: return "OBJ_DC";
+ case OBJ_METADC: return "OBJ_METADC";
+ case OBJ_PAL: return "OBJ_PAL";
+ case OBJ_FONT: return "OBJ_FONT";
+ case OBJ_BITMAP: return "OBJ_BITMAP";
+ case OBJ_REGION: return "OBJ_REGION";
+ case OBJ_METAFILE: return "OBJ_METAFILE";
+ case OBJ_MEMDC: return "OBJ_MEMDC";
+ case OBJ_EXTPEN: return "OBJ_EXTPEN";
+ case OBJ_ENHMETADC: return "OBJ_ENHMETADC";
+ case OBJ_ENHMETAFILE: return "OBJ_ENHMETAFILE";
+ case OBJ_COLORSPACE: return "OBJ_COLORSPACE";
+ default: return "UNKNOWN";
+ }
+}
+
+static void dump_gdi_objects( void )
+{
+ int i;
+
+ TRACE( "%u objects:\n", MAX_LARGE_HANDLES );
+
+ EnterCriticalSection( &gdi_section );
+ for (i = 0; i < MAX_LARGE_HANDLES; i++)
+ {
+ if (!large_handles[i])
+ {
+ TRACE( "index %d handle %p FREE\n", i, (HGDIOBJ)(ULONG_PTR)((i +
FIRST_LARGE_HANDLE) << 2) );
+ continue;
+ }
+ TRACE( "handle %p obj %p type %s selcount %u deleted %u\n",
+ (HGDIOBJ)(ULONG_PTR)((i + FIRST_LARGE_HANDLE) << 2),
+ large_handles[i], gdi_obj_type( large_handles[i]->type ),
+ large_handles[i]->selcount, large_handles[i]->deleted );
+ }
+ LeaveCriticalSection( &gdi_section );
+}
+
/***********************************************************************
* alloc_gdi_handle
*
@@ -660,6 +705,9 @@
for (i = 0; i <= next_large_handle; i++)
if (!large_handles[i]) goto found;
LeaveCriticalSection( &gdi_section );
+
+ ERR( "out of GDI object handles, expect a crash\n" );
+ if (TRACE_ON(gdi)) dump_gdi_objects();
return 0;
found:
Propchange: branches/arwinss/reactos/dll/win32/user32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 6 16:00:23 2010
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/user32:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/user32:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688
-/vendor/wine/dlls/user32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646
+/vendor/wine/dlls/user32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910
Modified: branches/arwinss/reactos/dll/win32/user32/dialog.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/dialog.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/dialog.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -689,11 +689,14 @@
if (dlgProc)
{
- if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param )
&&
+ HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
+ if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) &&
((~template.style & DS_CONTROL) || (template.style &
WS_VISIBLE)))
{
- /* By returning TRUE, app has requested a default focus assignment */
- dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
+ /* By returning TRUE, app has requested a default focus assignment.
+ * WM_INITDIALOG may have changed the tab order, so find the first
+ * tabstop control again. */
+ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
if( dlgInfo->hwndFocus )
SetFocus( dlgInfo->hwndFocus );
}
@@ -811,6 +814,12 @@
DispatchMessageW( &msg );
}
if (dlgInfo->flags & DF_END) break;
+
+ if (bFirstEmpty && msg.message == WM_TIMER)
+ {
+ ShowWindow( hwnd, SW_SHOWNORMAL );
+ bFirstEmpty = FALSE;
+ }
}
}
if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner );
Modified: branches/arwinss/reactos/dll/win32/user32/edit.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/edit.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/edit.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -1632,13 +1632,16 @@
INT vlc = get_vertical_line_count(es);
/* check if we are going to move too far */
if(es->y_offset + dy > es->line_count - vlc)
- dy = es->line_count - vlc - es->y_offset;
+ dy = max(es->line_count - vlc, 0) - es->y_offset;
/* Notification is done in EDIT_EM_LineScroll */
- if(dy)
+ if(dy) {
EDIT_EM_LineScroll(es, 0, dy);
- }
- return MAKELONG(dy, TRUE);
+ return MAKELONG(dy, TRUE);
+ }
+
+ }
+ return (LRESULT)FALSE;
}
Modified: branches/arwinss/reactos/dll/win32/user32/input.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/input.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/input.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -134,7 +134,7 @@
break;
case INPUT_KEYBOARD:
- TRACE("keyboard: vk %x, scan %x, flags %x, time %u, info
%lx\n",
+ TRACE("keyboard: vk %X, scan %x, flags %x, time %u, info
%lx\n",
inputs[i].u.ki.wVk, inputs[i].u.ki.wScan, inputs[i].u.ki.dwFlags,
inputs[i].u.ki.time, inputs[i].u.ki.dwExtraInfo);
break;
@@ -657,7 +657,7 @@
*/
UINT WINAPI MapVirtualKeyExW(UINT code, UINT maptype, HKL hkl)
{
- TRACE_(keyboard)("(%d, %d, %p)\n", code, maptype, hkl);
+ TRACE_(keyboard)("(%X, %d, %p)\n", code, maptype, hkl);
return USER_Driver->pMapVirtualKeyEx(code, maptype, hkl);
}
@@ -869,7 +869,7 @@
BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk)
{
static int once;
- if (!once++) FIXME_(keyboard)("(%p,%d,0x%08x,%d):
stub\n",hwnd,id,modifiers,vk);
+ if (!once++) FIXME_(keyboard)("(%p,%d,0x%08x,%X):
stub\n",hwnd,id,modifiers,vk);
return TRUE;
}
Modified: branches/arwinss/reactos/dll/win32/user32/message.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -2035,8 +2035,7 @@
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, buffer_size ))) return FALSE;
if (!first && !last) last = ~0;
- if (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST || hwnd == HWND_BOTTOM)
- hwnd = (HWND)-1;
+ if (hwnd == HWND_BROADCAST) hwnd = HWND_TOPMOST;
for (;;)
{
@@ -3000,7 +2999,7 @@
if (msg->message < WM_KEYFIRST || msg->message > WM_KEYLAST) return
FALSE;
if (msg->message != WM_KEYDOWN && msg->message != WM_SYSKEYDOWN) return
TRUE;
- TRACE_(key)("Translating key %s (%04lx), scancode %04x\n",
+ TRACE_(key)("Translating key %s (%04lX), scancode %04x\n",
SPY_GetVKeyName(msg->wParam), msg->wParam,
HIWORD(msg->lParam));
switch (msg->wParam)
Modified: branches/arwinss/reactos/dll/win32/user32/painting.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/painting.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/painting.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -297,6 +297,7 @@
{
win->dce = dce;
dce->hwnd = hwnd;
+ dce->count++;
list_add_tail( &dce_list, &dce->entry );
}
WIN_ReleasePtr( win );
@@ -496,7 +497,7 @@
* (between GetDC and ReleaseDC)
*/
USER_Lock();
- if (dce->count)
+ if (dce->count > 1)
{
WARN("Application trying to delete a busy DC %p\n", dce->hdc);
retv = FALSE;
Modified: branches/arwinss/reactos/dll/win32/user32/spy.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/spy.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/spy.c [iso-8859-1] Sat Mar 6 16:00:23 2010
@@ -1166,10 +1166,10 @@
NULL, /* 0x19 */
NULL, /* 0x1A */
"VK_ESCAPE", /* 0x1B */
- NULL, /* 0x1C */
- NULL, /* 0x1D */
- NULL, /* 0x1E */
- NULL, /* 0x1F */
+ "VK_CONVERT", /* 0x1C */
+ "VK_NONCONVERT", /* 0x1D */
+ "VK_ACCEPT", /* 0x1E */
+ "VK_MODECHANGE", /* 0x1F */
"VK_SPACE", /* 0x20 */
"VK_PRIOR", /* 0x21 */
"VK_NEXT", /* 0x22 */
@@ -1233,7 +1233,7 @@
"VK_RWIN", /* 0x5C */
"VK_APPS", /* 0x5D */
NULL, /* 0x5E */
- NULL, /* 0x5F */
+ "VK_SLEEP", /* 0x5F */
"VK_NUMPAD0", /* 0x60 */
"VK_NUMPAD1", /* 0x61 */
"VK_NUMPAD2", /* 0x62 */
@@ -1284,11 +1284,11 @@
NULL, /* 0x8F */
"VK_NUMLOCK", /* 0x90 */
"VK_SCROLL", /* 0x91 */
- NULL, /* 0x92 */
- NULL, /* 0x93 */
- NULL, /* 0x94 */
- NULL, /* 0x95 */
- NULL, /* 0x96 */
+ "VK_OEM_NEC_EQUAL", /* 0x92 aka. VK_OEM_FJ_JISHO */
+ "VK_OEM_FJ_MASSHOU", /* 0x93 */
+ "VK_OEM_FJ_TOUROKU", /* 0x94 */
+ "VK_OEM_FJ_LOYA", /* 0x95 */
+ "VK_OEM_FJ_ROYA", /* 0x96 */
NULL, /* 0x97 */
NULL, /* 0x98 */
NULL, /* 0x99 */
Modified: branches/arwinss/reactos/dll/win32/user32/win.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/win.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/win.c [iso-8859-1] Sat Mar 6 16:00:23 2010
@@ -3393,29 +3393,33 @@
cy = info->psize->cy;
flags &= ~SWP_NOSIZE;
}
- TRACE( "moving window %p pos %d,%d %dx%x\n", hwnd, x, y, cx, cy );
+ TRACE( "moving window %p pos %d,%d %dx%d\n", hwnd, x, y, cx, cy );
SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
}
if (info->hdcSrc)
{
- RECT rect;
- HDC hdc = GetDCEx( hwnd, 0, DCX_CACHE );
+ HDC hdc = GetWindowDC( hwnd );
if (hdc)
{
int x = 0, y = 0;
-
- GetClientRect( hwnd, &rect );
+ RECT rect;
+
+ GetWindowRect( hwnd, &rect );
+ OffsetRect( &rect, -rect.left, -rect.top);
if (info->pptSrc)
{
x = info->pptSrc->x;
y = info->pptSrc->y;
}
- /* FIXME: intersect rect with info->prcDirty */
- TRACE( "copying window %p pos %d,%d\n", hwnd, x, y );
- BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom,
- info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY );
+
+ if (!info->prcDirty || (info->prcDirty &&
IntersectRect(&rect, &rect, info->prcDirty)))
+ {
+ TRACE( "copying window %p pos %d,%d\n", hwnd, x, y );
+ BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom,
+ info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY );
+ }
ReleaseDC( hwnd, hdc );
}
}
Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -239,8 +239,17 @@
const BITMAPINFO *bmi, UINT usage )
{
DIBSECTION dib;
+ LONG height, width;
+ WORD infoBpp, compression;
GetObjectW( hbitmap, sizeof(dib), &dib );
+
+ /* Get parameters to check if it's topdown or not.
+ GetObject doesn't return this info */
+ DIB_GetBitmapInfo(&bmi->bmiHeader, &width, &height, &infoBpp,
&compression);
+
+ // TODO: Should pass as a flag instead
+ if (height < 0) dib.dsBmih.biHeight *= -1;
return RosGdiCreateDIBSection(physDev->hKernelDC, hbitmap, bmi, usage, &dib);
}
Propchange: branches/arwinss/reactos/dll/win32/winex11.drv/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 6 16:00:23 2010
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/winex11.drv:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/winex11.drv:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688
-/vendor/wine/dlls/winex11.drv/current:43149,43398,43708,44151,44715,45044,45206,45455,45646
+/vendor/wine/dlls/winex11.drv/current:43149,43398,43708,44151,44715,45044,45206,45455,45646,45910
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/bitblt.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/bitblt.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -1308,7 +1308,7 @@
bytesToCopy = width * bytesPerPixel;
- if (srcDib.dsBmih.biHeight < 0)
+ if (physDevSrc->bitmap->topdown)
{
srcPtr = &physDevSrc->bitmap->base[ySrc*srcDib.dsBm.bmWidthBytes +
xSrc*bytesPerPixel];
srcRowOffset = srcDib.dsBm.bmWidthBytes;
@@ -1319,7 +1319,7 @@
+ xSrc*bytesPerPixel];
srcRowOffset = -srcDib.dsBm.bmWidthBytes;
}
- if (dstDib.dsBmih.biHeight < 0)
+ if (physDevDst->bitmap->topdown)
{
dstPtr = &physDevDst->bitmap->base[yDst*dstDib.dsBm.bmWidthBytes +
xDst*bytesPerPixel];
dstRowOffset = dstDib.dsBm.bmWidthBytes;
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/dib.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/dib.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/dib.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -4054,7 +4054,7 @@
UINT y;
TRACE("syncing compatible set bits to app bits\n");
- if ((tmpheight < 0) ^ (ds.dsBmih.biHeight < 0))
+ if ((tmpheight < 0) ^ physBitmap->topdown)
{
dbits += dstwidthb * (lines-1);
dstwidthb = -dstwidthb;
@@ -4249,7 +4249,7 @@
descr.palentry = NULL;
descr.infoWidth = dibSection.dsBmih.biWidth;
descr.infoBpp = dibSection.dsBmih.biBitCount;
- descr.lines = dibSection.dsBmih.biHeight;
+ descr.lines = physBitmap->topdown ? -dibSection.dsBmih.biHeight :
dibSection.dsBmih.biHeight;
descr.image = physBitmap->image;
descr.colorMap = colorMap;
descr.nColorMap = nColorMap;
@@ -4726,12 +4726,17 @@
{
X_PHYSBITMAP *physBitmap;
DIBSECTION dib;
+ WORD bpp, compr;
+ LONG w, h;
#ifdef HAVE_LIBXXSHM
int major, minor;
Bool pixmaps;
#endif
+ DIB_GetBitmapInfo( &bmi->bmiHeader, &w, &h, &bpp, &compr );
+
if (!(physBitmap = X11DRV_init_phys_bitmap( hbitmap ))) return 0;
+ if (h < 0) physBitmap->topdown = TRUE;
physBitmap->status = DIB_Status_None;
GetObjectW( hbitmap, sizeof(dib), &dib );
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/ime.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/ime.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/ime.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -717,30 +717,36 @@
}
break;
case IMC_SETOPENSTATUS:
- {
- LPIMEPRIVATE myPrivate;
TRACE("IMC_SETOPENSTATUS\n");
- myPrivate = ImmLockIMCC(lpIMC->hPrivate);
- if (lpIMC->fOpen != myPrivate->bInternalState &&
- myPrivate->bInComposition)
+ /* Indirectly called from XIM callbacks */
+ if (ImmGetIMCCLockCount(lpIMC->hPrivate) > 0)
{
- if(lpIMC->fOpen == FALSE)
+ bRet = TRUE;
+ break;
+ }
+
+ bRet = X11DRV_SetPreeditState(lpIMC->hWnd, lpIMC->fOpen);
+ if (bRet)
+ {
+ if (!lpIMC->fOpen)
{
- X11DRV_ForceXIMReset(lpIMC->hWnd);
- GenerateIMEMessage(hIMC,WM_IME_ENDCOMPOSITION,0,0);
- myPrivate->bInComposition = FALSE;
- }
- else
- {
- GenerateIMEMessage(hIMC,WM_IME_STARTCOMPOSITION,0,0);
- GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, 0, 0);
+ LPIMEPRIVATE myPrivate;
+
+ myPrivate = ImmLockIMCC(lpIMC->hPrivate);
+ if (myPrivate->bInComposition)
+ {
+ X11DRV_ForceXIMReset(lpIMC->hWnd);
+ GenerateIMEMessage(hIMC, WM_IME_ENDCOMPOSITION, 0, 0);
+ myPrivate->bInComposition = FALSE;
+ }
+ ImmUnlockIMCC(lpIMC->hPrivate);
}
}
- myPrivate->bInternalState = lpIMC->fOpen;
- bRet = TRUE;
- }
- break;
+ else
+ lpIMC->fOpen = !lpIMC->fOpen;
+
+ break;
default: FIXME("Unknown\n"); break;
}
break;
@@ -951,35 +957,36 @@
/* Interfaces to XIM and other parts of winex11drv */
-void IME_SetOpenStatus(BOOL fOpen)
-{
+void IME_SetOpenStatus(BOOL fOpen, BOOL force)
+{
+ HIMC imc;
LPINPUTCONTEXT lpIMC;
LPIMEPRIVATE myPrivate;
- lpIMC = LockRealIMC(FROM_X11);
+ imc = RealIMC(FROM_X11);
+ lpIMC = ImmLockIMC(imc);
if (lpIMC == NULL)
return;
myPrivate = ImmLockIMCC(lpIMC->hPrivate);
- if (myPrivate->bInternalState && fOpen == FALSE)
+ if (!fOpen && myPrivate->bInComposition)
{
ShowWindow(myPrivate->hwndDefault, SW_HIDE);
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = ImeCreateBlankCompStr();
- }
+ myPrivate->bInComposition = FALSE;
+ GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
+ }
+
+ if (lpIMC->fOpen && fOpen)
+ ImmSetOpenStatus(imc, FALSE);
+
+ if (fOpen || force)
+ ImmSetOpenStatus(imc, fOpen);
ImmUnlockIMCC(lpIMC->hPrivate);
- UnlockRealIMC(FROM_X11);
-
- if (myPrivate->bInComposition && fOpen == FALSE)
- {
- GenerateIMEMessage(FROM_X11, WM_IME_ENDCOMPOSITION, 0, 0);
- myPrivate->bInComposition = FALSE;
- }
-
- if (!myPrivate->bInternalState && fOpen == TRUE)
- ImmSetOpenStatus(RealIMC(FROM_X11), fOpen);
+ ImmUnlockIMC(imc);
}
INT IME_GetCursorPos(void)
@@ -1048,10 +1055,14 @@
void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
{
+ HIMC imc;
LPINPUTCONTEXT lpIMC;
HIMCC newCompStr;
-
- lpIMC = LockRealIMC(FROM_X11);
+ LPIMEPRIVATE myPrivate;
+ BOOL fOpen;
+
+ imc = RealIMC(FROM_X11);
+ lpIMC = ImmLockIMC(imc);
if (lpIMC == NULL)
return;
@@ -1059,9 +1070,19 @@
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = newCompStr;
- GenerateIMEMessage(FROM_X11, WM_IME_COMPOSITION, 0, GCS_RESULTSTR);
-
- UnlockRealIMC(FROM_X11);
+ myPrivate = ImmLockIMCC(lpIMC->hPrivate);
+ fOpen = lpIMC->fOpen;
+ ImmSetOpenStatus(imc, TRUE);
+ if (!myPrivate->bInComposition)
+ GenerateIMEMessage(imc, WM_IME_STARTCOMPOSITION, 0, 0);
+ GenerateIMEMessage(imc, WM_IME_COMPOSITION, 0, GCS_RESULTSTR);
+ if (!myPrivate->bInComposition)
+ GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
+ if (!fOpen)
+ ImmSetOpenStatus(imc, FALSE);
+ ImmUnlockIMCC(lpIMC->hPrivate);
+
+ ImmUnlockIMC(imc);
}
/*****
@@ -1290,7 +1311,7 @@
FIXME("WM_IME_NOTIFY:IMN_SETSENTENCEMODE\n");
break;
case IMN_SETOPENSTATUS:
- FIXME("WM_IME_NOTIFY:IMN_SETOPENSTATUS\n");
+ TRACE("WM_IME_NOTIFY:IMN_SETOPENSTATUS\n");
break;
case IMN_SETCANDIDATEPOS:
FIXME("WM_IME_NOTIFY:IMN_SETCANDIDATEPOS\n");
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -52,6 +52,12 @@
#include "wine/unicode.h"
#include "wine/debug.h"
+/* log format (add 0-padding as appropriate):
+ keycode %u as in output from xev
+ keysym %lx as in X11/keysymdef.h
+ vkey %X as in winuser.h
+ scancode %x
+*/
WINE_DEFAULT_DEBUG_CHANNEL(keyboard);
WINE_DECLARE_DEBUG_CHANNEL(key);
@@ -1146,7 +1152,7 @@
if ((e->state & ControlMask) && (keysym == XK_Break))
return VK_CANCEL;
- TRACE_(key)("e->keycode = %x\n", e->keycode);
+ TRACE_(key)("e->keycode = %u\n", e->keycode);
return keyc2vkey[e->keycode];
}
@@ -1232,7 +1238,7 @@
{
vk_hook = wVk = VK_PACKET;
lParam = MAKELPARAM(1 /* repeat count */, wScan);
- TRACE_(key)(" message=0x%04x wParam=0x%04x lParam=0x%08lx\n",
+ TRACE_(key)("message=0x%04x wParam=0x%04X lParam=0x%08lx\n",
message, wVk, lParam);
}
@@ -1264,7 +1270,7 @@
lParam = MAKELPARAM(1 /* repeat count */, flags);
- TRACE_(key)(" message=0x%04x wParam=0x%04x, lParam=0x%08lx,
InputKeyState=0x%x\n",
+ TRACE_(key)(" message=0x%04x wParam=0x%04X, lParam=0x%08lx,
InputKeyState=0x%x\n",
message, wVk, lParam, key_state_table[wVk]);
}
@@ -1300,7 +1306,7 @@
if (!state) flags |= KEYEVENTF_KEYUP;
- TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n",
+ TRACE("Adjusting state for vkey %#.2X. State before %#.2x\n",
vkey, key_state_table[vkey & 0xff]);
/* Fake key being pressed inside wine */
@@ -1378,7 +1384,7 @@
DWORD event_time = EVENT_x11_time_to_win32_time(event->time);
Status status = 0;
- TRACE_(key)("type %d, window %lx, state 0x%04x, keycode 0x%04x\n",
+ TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n",
event->type, event->window, event->state, event->keycode);
wine_tsx11_lock();
@@ -1403,7 +1409,7 @@
ascii_chars = XLookupString(event, buf, sizeof(buf), &keysym, NULL);
wine_tsx11_unlock();
- TRACE_(key)("nbyte = %d, status 0x%x\n", ascii_chars, status);
+ TRACE_(key)("nbyte = %d, status %d\n", ascii_chars, status);
if (status == XLookupChars)
{
@@ -1433,7 +1439,7 @@
wine_tsx11_unlock();
if (!ksname)
ksname = "No Name";
- TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n",
+ TRACE_(key)("%s : keysym=%lx (%s), # of chars=%d / %s\n",
(event->type == KeyPress) ? "KeyPress" :
"KeyRelease",
keysym, ksname, ascii_chars, debugstr_an(Str, ascii_chars));
}
@@ -1446,7 +1452,7 @@
if (!vkey && ascii_chars) vkey = VK_NONAME;
wine_tsx11_unlock();
- TRACE_(key)("keycode 0x%x converted to vkey 0x%x\n",
+ TRACE_(key)("keycode %u converted to vkey 0x%X\n",
event->keycode, vkey);
if (!vkey) return;
@@ -1526,7 +1532,7 @@
if (!use_xkb || !XkbTranslateKeySym(display, &keysym, 0,
&ckey[keyc][i], 1, NULL))
#endif
{
- TRACE("XKB could not translate keysym %ld\n", keysym);
+ TRACE("XKB could not translate keysym %04lx\n", keysym);
/* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent
* with appropriate ShiftMask and Mode_switch, use XLookupString
* to get character in the local encoding.
@@ -1578,7 +1584,7 @@
char str[5];
for (i = 0; i < 4; i++) str[i] = ckey[keyc][i] ? ckey[keyc][i] : '
';
str[4] = 0;
- TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d, got %s\n",
keysym, keyc, str );
+ TRACE_(key)("mismatch for keycode %u, got %s\n", keyc, str);
mismatch++;
score -= syms;
}
@@ -1823,11 +1829,11 @@
}
}
}
- TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey);
+ TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey);
keyc2vkey[e2.keycode] = vkey;
keyc2scan[e2.keycode] = scan;
if ((vkey & 0xff) && vkey_used[(vkey & 0xff)])
- WARN("vkey %04x is being used by more than one keycode\n", vkey);
+ WARN("vkey %04X is being used by more than one keycode\n", vkey);
vkey_used[(vkey & 0xff)] = 1;
} /* for */
@@ -1875,7 +1881,7 @@
if (vkey)
{
- TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey);
+ TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey);
keyc2vkey[e2.keycode] = vkey;
}
} /* for */
@@ -1913,7 +1919,7 @@
if (TRACE_ON(keyboard))
{
- TRACE("spare virtual key %X assigned to keycode %X:\n",
+ TRACE("spare virtual key %04X assigned to keycode %u:\n",
vkey, e2.keycode);
TRACE("(");
for (i = 0; i < keysyms_per_keycode; i += 1)
@@ -1924,12 +1930,12 @@
ksname = XKeysymToString(keysym);
if (!ksname)
ksname = "NoSymbol";
- TRACE( "%lX (%s) ", keysym, ksname);
+ TRACE( "%lx (%s) ", keysym, ksname);
}
TRACE(")\n");
}
- TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey);
+ TRACE("keycode %u => vkey %04X\n", e2.keycode, vkey);
keyc2vkey[e2.keycode] = vkey;
vkey_used[vkey] = 1;
} /* for */
@@ -1945,7 +1951,7 @@
/* should make sure the scancode is unassigned here, but >=0x60 currently always is
*/
- TRACE_(key)("assigning scancode %02x to unidentified keycode %02x
(%s)\n",scan,keyc,ksname);
+ TRACE_(key)("assigning scancode %02x to unidentified keycode %u
(%s)\n",scan,keyc,ksname);
keyc2scan[keyc]=scan++;
}
@@ -1977,7 +1983,7 @@
retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) |
((key_state_table[key] & 0x80) ? 0x8000 : 0);
key_state_table[key] &= ~0x40;
- TRACE_(key)("(%x) -> %x\n", key, retval);
+ TRACE_(key)("(%X) -> %x\n", key, retval);
return retval;
}
@@ -2128,8 +2134,7 @@
}
wine_tsx11_unlock();
- TRACE("'%c'(%#lx, %lu): got keycode %#.2x (%d)\n",
- cChar, keysym, keysym, keycode, keycode);
+ TRACE("'%c'(%lx): got keycode %u\n", cChar, keysym, keycode);
/* keycode -> (keyc2vkey) vkey */
ret = keyc2vkey[keycode];
@@ -2299,7 +2304,7 @@
wine_tsx11_unlock();
return 0; /* whatever */
}
- TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
+ TRACE("Found keycode %u\n",e.keycode);
len = XLookupString(&e, s, sizeof(s), &keysym, NULL);
wine_tsx11_unlock();
@@ -2358,7 +2363,7 @@
}
ansi = X11DRV_MapVirtualKeyEx(vkey, MAPVK_VK_TO_CHAR, X11DRV_GetKeyboardLayout(0));
- TRACE("scan 0x%04x, vkey 0x%04x, ANSI 0x%04x\n", scanCode, vkey, ansi);
+ TRACE("scan 0x%04x, vkey 0x%04X, ANSI 0x%04x\n", scanCode, vkey, ansi);
/* first get the name of the "regular" keys which is the Upper case
value of the keycap imprint. */
@@ -2401,7 +2406,7 @@
keys = XKeycodeToKeysym(display, keyc, 0);
name = XKeysymToString(keys);
wine_tsx11_unlock();
- TRACE("found scan=%04x keyc=%04x keysym=%04x string=%s\n",
+ TRACE("found scan=%04x keyc=%u keysym=%04x string=%s\n",
scanCode, keyc, (int)keys, name);
if (lpBuffer && nSize && name)
return MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize);
@@ -2409,7 +2414,7 @@
/* Finally issue WARN for unknown keys */
- WARN("(%08x,%p,%d): unsupported key, vkey=%04x,
ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi);
+ WARN("(%08x,%p,%d): unsupported key, vkey=%04X,
ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi);
if (lpBuffer && nSize)
*lpBuffer = 0;
return 0;
@@ -2610,9 +2615,9 @@
wine_tsx11_unlock();
return 0;
}
- else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
-
- TRACE_(key)("type %d, window %lx, state 0x%04x, keycode 0x%04x\n",
+ else TRACE("Found keycode %u\n",e.keycode);
+
+ TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n",
e.type, e.window, e.state, e.keycode);
/* Clients should pass only KeyPress events to XmbLookupString,
@@ -2648,7 +2653,7 @@
ksname = XKeysymToString(keysym);
wine_tsx11_unlock();
if (!ksname) ksname = "No Name";
- TRACE_(key)("%s : keysym=%lX (%s), # of chars=%d / %s\n",
+ TRACE_(key)("%s : keysym=%lx (%s), # of chars=%d / %s\n",
(e.type == KeyPress) ? "KeyPress" :
"KeyRelease",
keysym, ksname, ret, debugstr_an(lpChar, ret));
}
@@ -2707,9 +2712,9 @@
ksname = "No Name";
if ((keysym >> 8) != 0xff)
{
- WARN("no char for keysym %04lX (%s) :\n",
+ WARN("no char for keysym %04lx (%s) :\n",
keysym, ksname);
- WARN("virtKey=%X, scanCode=%X, keycode=%X, state=%X\n",
+ WARN("virtKey=%X, scanCode=%X, keycode=%u, state=%X\n",
virtKey, scanCode, e.keycode, e.state);
}
}
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/window.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -143,6 +143,31 @@
}
+struct has_popup_result
+{
+ HWND hwnd;
+ BOOL found;
+};
+
+static BOOL CALLBACK has_popup( HWND hwnd, LPARAM lparam )
+{
+ struct has_popup_result *result = (struct has_popup_result *)lparam;
+
+ if (hwnd == result->hwnd) return FALSE; /* popups are always above owner */
+ result->found = (GetWindow( hwnd, GW_OWNER ) == result->hwnd);
+ return !result->found;
+}
+
+static BOOL has_owned_popups( HWND hwnd )
+{
+ struct has_popup_result result;
+
+ result.hwnd = hwnd;
+ result.found = FALSE;
+ EnumWindows( has_popup, (LPARAM)&result );
+ return result.found;
+}
+
/***********************************************************************
* is_window_managed
*
@@ -182,6 +207,8 @@
/* application windows are managed */
ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
if (ex_style & WS_EX_APPWINDOW) return TRUE;
+ /* windows that own popups are managed */
+ if (has_owned_popups( hwnd )) return TRUE;
/* default: not managed */
return FALSE;
}
@@ -918,7 +945,7 @@
{
long i;
Atom protocols[3];
- Atom dndVersion = 4;
+ Atom dndVersion = WINE_XDND_VERSION;
XClassHint *class_hints;
char *process_name = get_process_name();
@@ -967,13 +994,41 @@
/***********************************************************************
+ * get_owner_whole_window
+ *
+ * Retrieve an owner's window, creating it if necessary.
+ */
+static Window get_owner_whole_window( HWND owner )
+{
+ struct x11drv_win_data *data;
+
+ if (!owner) return 0;
+
+ if (!(data = X11DRV_get_win_data( owner )))
+ {
+ if (GetWindowThreadProcessId( owner, NULL ) != GetCurrentThreadId() ||
+ !(data = X11DRV_create_win_data( owner )))
+ return (Window)GetPropA( owner, whole_window_prop );
+ }
+ else if (!data->managed) /* make it managed */
+ {
+ SetWindowPos( owner, 0, 0, 0, 0, 0,
+ SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE |
+ SWP_NOREDRAW | SWP_DEFERERASE | SWP_NOSENDCHANGING |
SWP_STATECHANGED );
+ }
+ return data->whole_window;
+}
+
+
+/***********************************************************************
* set_wm_hints
*
* Set the window manager hints for a newly-created window
*/
static void set_wm_hints( Display *display, struct x11drv_win_data *data )
{
- Window group_leader;
+ Window group_leader = data->whole_window;
+ Window owner_win = 0;
Atom window_type;
MwmHints mwm_hints;
DWORD style, ex_style;
@@ -991,20 +1046,12 @@
style = GetWindowLongW( data->hwnd, GWL_STYLE );
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
owner = get_window_owner( data->hwnd );
- }
-
- /* transient for hint */
- if (owner)
- {
- Window owner_win = X11DRV_get_whole_window( owner );
- wine_tsx11_lock();
- XSetTransientForHint( display, data->whole_window, owner_win );
- wine_tsx11_unlock();
- group_leader = owner_win;
- }
- else group_leader = data->whole_window;
+ if ((owner_win = get_owner_whole_window( owner ))) group_leader = owner_win;
+ }
wine_tsx11_lock();
+
+ if (owner_win) XSetTransientForHint( display, data->whole_window, owner_win );
/* size hints */
set_size_hints( display, data, style );
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/x11drv.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/x11drv.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/x11drv.h [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -64,6 +64,8 @@
#define MAX_PIXELFORMATS 8
#define MAX_DASHLEN 16
+#define WINE_XDND_VERSION 4
+
struct tagCURSORICONINFO;
extern void CDECL wine_tsx11_lock(void);
@@ -125,6 +127,7 @@
int *colorMap; /* color map info */
int nColorMap;
BOOL trueColor;
+ BOOL topdown;
CRITICAL_SECTION lock; /* GDI access lock */
enum x11drv_shm_mode shm_mode;
#ifdef HAVE_LIBXXSHM
@@ -300,7 +303,7 @@
/* IME support */
extern void IME_UnregisterClasses(void);
-extern void IME_SetOpenStatus(BOOL fOpen);
+extern void IME_SetOpenStatus(BOOL fOpen, BOOL force);
extern INT IME_GetCursorPos(void);
extern void IME_SetCursorPos(DWORD pos);
extern void IME_UpdateAssociation(HWND focus);
@@ -809,6 +812,7 @@
extern void X11DRV_SetupXIM(void) DECLSPEC_HIDDEN;
extern void X11DRV_XIMLookupChars( const char *str, DWORD count ) DECLSPEC_HIDDEN;
extern void X11DRV_ForceXIMReset(HWND hwnd) DECLSPEC_HIDDEN;
+extern BOOL X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen);
/* FIXME: private functions imported from user32 */
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL
unicode );
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/xdnd.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/xdnd.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/xdnd.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -87,13 +87,21 @@
*/
void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event )
{
+ int version;
Atom *xdndtypes;
unsigned long count = 0;
- TRACE("ver(%ld) check-XdndTypeList(%ld) data=%ld,%ld,%ld,%ld,%ld\n",
- (event->data.l[1] & 0xFF000000) >> 24, (event->data.l[1] &
1),
+ version = (event->data.l[1] & 0xFF000000) >> 24;
+ TRACE("ver(%d) check-XdndTypeList(%ld) data=%ld,%ld,%ld,%ld,%ld\n",
+ version, (event->data.l[1] & 1),
event->data.l[0], event->data.l[1], event->data.l[2],
event->data.l[3], event->data.l[4]);
+
+ if (version > WINE_XDND_VERSION)
+ {
+ TRACE("Ignores unsupported version\n");
+ return;
+ }
/* If the source supports more than 3 data types we retrieve
* the entire list. */
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/xim.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/xim.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/xim.c [iso-8859-1] Sat Mar 6 16:00:23
2010
@@ -32,7 +32,7 @@
#include "imm.h"
#include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
+WINE_DEFAULT_DEBUG_CHANNEL(xim);
#ifndef HAVE_XICCALLBACK_CALLBACK
#define XICCallback XIMCallback
@@ -120,10 +120,30 @@
HeapFree(GetProcessHeap(), 0, wcOutput);
}
+static BOOL XIMPreEditStateNotifyCallback(XIC xic, XPointer p, XPointer data)
+{
+ const struct x11drv_win_data * const win_data = (struct x11drv_win_data *)p;
+ const XIMPreeditState state = ((XIMPreeditStateNotifyCallbackStruct
*)data)->state;
+
+ TRACE("xic = %p, win = %lx, state = %lu\n", xic, win_data->whole_window,
state);
+ switch (state)
+ {
+ case XIMPreeditEnable:
+ IME_SetOpenStatus(TRUE, TRUE);
+ break;
+ case XIMPreeditDisable:
+ IME_SetOpenStatus(FALSE, TRUE);
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
static int XIMPreEditStartCallback(XIC ic, XPointer client_data, XPointer call_data)
{
TRACE("PreEditStartCallback %p\n",ic);
- IME_SetOpenStatus(TRUE);
+ IME_SetOpenStatus(TRUE, FALSE);
ximInComposeMode = TRUE;
return -1;
}
@@ -137,7 +157,7 @@
dwCompStringSize = 0;
dwCompStringLength = 0;
CompositionString = NULL;
- IME_SetOpenStatus(FALSE);
+ IME_SetOpenStatus(FALSE, FALSE);
}
static void XIMPreEditDrawCallback(XIM ic, XPointer client_data,
@@ -243,6 +263,51 @@
wine_tsx11_unlock();
}
}
+
+BOOL X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen)
+{
+ XIC ic;
+ XIMPreeditState state;
+ XVaNestedList attr_set, attr_get;
+ BOOL ret;
+
+ ic = X11DRV_get_ic(hwnd);
+ if (!ic)
+ return FALSE;
+
+ if (fOpen)
+ state = XIMPreeditEnable;
+ else
+ state = XIMPreeditDisable;
+
+ ret = FALSE;
+ wine_tsx11_lock();
+
+ attr_set = XVaCreateNestedList(0, XNPreeditState, state, NULL);
+ if (attr_set == NULL)
+ goto error1;
+
+ attr_get = XVaCreateNestedList(0, XNPreeditState, &state, NULL);
+ if (attr_get == NULL)
+ goto error2;
+
+ if (XSetICValues(ic, XNPreeditAttributes, attr_set, NULL) != NULL)
+ goto error3;
+
+ /* SCIM claims it supports XNPreeditState, but seems to ignore */
+ state = XIMPreeditUnKnown;
+ ret = XGetICValues(ic, XNPreeditAttributes, attr_get, NULL) == NULL &&
+ ((fOpen && state == XIMPreeditEnable) ||
+ (!fOpen && state == XIMPreeditDisable));
+error3:
+ XFree(attr_get);
+error2:
+ XFree(attr_set);
+error1:
+ wine_tsx11_unlock();
+ return ret;
+}
+
/***********************************************************************
* X11DRV_InitXIM
@@ -446,7 +511,7 @@
XVaNestedList status = NULL;
XIC xic;
XICCallback destroy = {(XPointer)data, (XICProc)X11DRV_DestroyIC};
- XICCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
+ XICCallback P_StateNotifyCB, P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale()));
Window win = data->whole_window;
XFontSet fontSet = x11drv_thread_data()->font_set;
@@ -472,10 +537,12 @@
}
/* create callbacks */
+ P_StateNotifyCB.client_data = (XPointer)data;
P_StartCB.client_data = NULL;
P_DoneCB.client_data = NULL;
P_DrawCB.client_data = NULL;
P_CaretCB.client_data = NULL;
+ P_StateNotifyCB.callback = (XICProc)XIMPreEditStateNotifyCallback;
P_StartCB.callback = (XICProc)XIMPreEditStartCallback;
P_DoneCB.callback = (XICProc)XIMPreEditDoneCallback;
P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback;
@@ -486,6 +553,7 @@
preedit = XVaCreateNestedList(0,
XNFontSet, fontSet,
XNSpotLocation, &spot,
+ XNPreeditStateNotifyCallback, &P_StateNotifyCB,
XNPreeditStartCallback, &P_StartCB,
XNPreeditDoneCallback, &P_DoneCB,
XNPreeditDrawCallback, &P_DrawCB,
@@ -496,6 +564,7 @@
else
{
preedit = XVaCreateNestedList(0,
+ XNPreeditStateNotifyCallback, &P_StateNotifyCB,
XNPreeditStartCallback, &P_StartCB,
XNPreeditDoneCallback, &P_DoneCB,
XNPreeditDrawCallback, &P_DrawCB,
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -1862,7 +1862,7 @@
if(xscale != 1.0 || yscale != 1.0)
{
if(mask_pict)
- set_xrender_transformation(mask_pict, xscale, yscale, x_offset, y_offset);
+ set_xrender_transformation(mask_pict, xscale, yscale, x_src + x_offset, y_src
+ y_offset);
else
set_xrender_transformation(src_pict, xscale, yscale, x_src + x_offset, y_src
+ y_offset);
@@ -1871,11 +1871,16 @@
else
{
if(mask_pict)
+ {
set_xrender_transformation(mask_pict, 1, 1, 0, 0);
+ /* Note since the 'source data' is in the mask picture, we have to
pass x_src / y_src using mask_x / mask_y */
+ pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, 0, 0,
x_src, y_src, 0, 0, width, height);
+ }
else
+ {
set_xrender_transformation(src_pict, 1, 1, 0, 0);
-
- pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, x_src, y_src,
0, 0, 0, 0, width, height);
+ pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, x_src,
y_src, 0, 0, 0, 0, width, height);
+ }
}
}
@@ -1948,10 +1953,10 @@
/* If the source is a 1x1 bitmap, tiling is equivalent to stretching, but
tiling is much faster. Therefore, we do no stretching in this case. */
- repeat_src = dib.dsBmih.biWidth == 1 && abs(dib.dsBmih.biHeight) == 1;
+ repeat_src = dib.dsBmih.biWidth == 1 && dib.dsBmih.biHeight == 1;
if (xSrc < 0 || ySrc < 0 || widthSrc < 0 || heightSrc < 0 || xSrc +
widthSrc > dib.dsBmih.biWidth
- || ySrc + heightSrc > abs(dib.dsBmih.biHeight))
+ || ySrc + heightSrc > dib.dsBmih.biHeight)
{
WARN("Invalid src coords: (%d,%d), size %dx%d\n", xSrc, ySrc, widthSrc,
heightSrc);
SetLastError(ERROR_INVALID_PARAMETER);
@@ -1964,7 +1969,7 @@
}
dstbits = data = HeapAlloc(GetProcessHeap(), 0, heightSrc * widthSrc * 4);
- if(dib.dsBmih.biHeight < 0) { /* top-down dib */
+ if (devSrc->bitmap->topdown) { /* top-down dib */
top_down = TRUE;
dstbits += widthSrc * (heightSrc - 1);
y2 = ySrc;
Propchange: branches/arwinss/reactos/subsystems/win32/win32k/wine/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 6 16:00:23 2010
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/wine:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/subsystems/win32/win32k/wine:42000-43126,43669-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688
-/vendor/wine/server/current:43708,44715,45044,45206,45646
+/vendor/wine/server/current:43708,44715,45044,45206,45646,45910
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/queue.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/queue.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/queue.c [iso-8859-1] Sat Mar 6
16:00:23 2010
@@ -659,7 +659,7 @@
static int match_window( user_handle_t win, user_handle_t msg_win )
{
if (!win) return 1;
- if (win == (user_handle_t)-1) return !msg_win;
+ if (win == -1 || win == 1) return !msg_win;
if (msg_win == win) return 1;
return is_child_window( win, msg_win );
}
@@ -1912,6 +1912,7 @@
return;
}
+ if (get_win == -1 && process->idle_event) set_event(
process->idle_event );
queue->wake_mask = req->wake_mask;
queue->changed_mask = req->changed_mask;
set_error( STATUS_PENDING ); /* FIXME */