Author: fireball Date: Sat Jun 5 17:03:58 2010 New Revision: 47590
URL: http://svn.reactos.org/svn/reactos?rev=47590&view=rev Log: - Sync up to Wine-1.2-rc2.
Modified: branches/arwinss/reactos/dll/win32/gdi32/ (props changed) branches/arwinss/reactos/dll/win32/gdi32/bidi.c branches/arwinss/reactos/dll/win32/gdi32/dib.c branches/arwinss/reactos/dll/win32/gdi32/font.c branches/arwinss/reactos/dll/win32/gdi32/freetype.c branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h branches/arwinss/reactos/dll/win32/user32/ (props changed) branches/arwinss/reactos/dll/win32/user32/caret.c branches/arwinss/reactos/dll/win32/user32/cursoricon.c branches/arwinss/reactos/dll/win32/user32/exticon.c branches/arwinss/reactos/dll/win32/user32/nonclient.c branches/arwinss/reactos/dll/win32/user32/win.c branches/arwinss/reactos/dll/win32/winex11.drv/brush.c branches/arwinss/reactos/dll/win32/winex11.drv/event.c branches/arwinss/reactos/dll/win32/winex11.drv/graphics.c branches/arwinss/reactos/dll/win32/winex11.drv/ime.c branches/arwinss/reactos/dll/win32/winex11.drv/settings.c branches/arwinss/reactos/dll/win32/winex11.drv/window.c branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c
Propchange: branches/arwinss/reactos/dll/win32/gdi32/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Jun 5 17:03:58 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,45910,46314,46696,46915,47274,47321 +/vendor/wine/dlls/gdi32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585
Modified: branches/arwinss/reactos/dll/win32/gdi32/bidi.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/... ============================================================================== --- branches/arwinss/reactos/dll/win32/gdi32/bidi.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/gdi32/bidi.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -361,7 +361,8 @@ LPWSTR lpOutString, /* [out] Reordered string */ INT uCountOut, /* [in] Size of output buffer */ UINT *lpOrder, /* [out] Logical -> Visual order map */ - WORD **lpGlyphs /* [out] reordered, mirrored, shaped glyphs to display */ + WORD **lpGlyphs, /* [out] reordered, mirrored, shaped glyphs to display */ + INT *cGlyphs /* [out] number of glyphs generated */ ) { WORD *chartype; @@ -646,6 +647,8 @@
done += i; } + if (cGlyphs) + *cGlyphs = glyph_i;
HeapFree(GetProcessHeap(), 0, chartype); HeapFree(GetProcessHeap(), 0, levels);
Modified: branches/arwinss/reactos/dll/win32/gdi32/dib.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/... ============================================================================== --- branches/arwinss/reactos/dll/win32/gdi32/dib.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/gdi32/dib.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -647,18 +647,24 @@ DIB_GetDIBImageBytes( bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel ); - info->bmiHeader.biCompression = (bmp->bitmap.bmBitsPixel > 8) ? BI_BITFIELDS : BI_RGB; - switch(bmp->bitmap.bmBitsPixel) + if (bmp->dib) { - case 15: - info->bmiHeader.biBitCount = 16; - break; - case 24: - info->bmiHeader.biBitCount = 32; - break; - default: + info->bmiHeader.biBitCount = bmp->dib->dsBm.bmBitsPixel; + switch (bmp->dib->dsBm.bmBitsPixel) + { + case 16: + case 32: + info->bmiHeader.biCompression = BI_BITFIELDS; + break; + default: + info->bmiHeader.biCompression = BI_RGB; + break; + } + } + else + { + info->bmiHeader.biCompression = (bmp->bitmap.bmBitsPixel > 8) ? BI_BITFIELDS : BI_RGB; info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; - break; } info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; @@ -827,9 +833,13 @@ case 16: if (info->bmiHeader.biCompression == BI_BITFIELDS) { - ((PDWORD)info->bmiColors)[0] = 0xf800; - ((PDWORD)info->bmiColors)[1] = 0x07e0; - ((PDWORD)info->bmiColors)[2] = 0x001f; + if (bmp->dib) memcpy( info->bmiColors, bmp->dib->dsBitfields, 3 * sizeof(DWORD) ); + else + { + ((PDWORD)info->bmiColors)[0] = 0xf800; + ((PDWORD)info->bmiColors)[1] = 0x07e0; + ((PDWORD)info->bmiColors)[2] = 0x001f; + } } break;
@@ -837,9 +847,13 @@ case 32: if (info->bmiHeader.biCompression == BI_BITFIELDS) { - ((PDWORD)info->bmiColors)[0] = 0xff0000; - ((PDWORD)info->bmiColors)[1] = 0x00ff00; - ((PDWORD)info->bmiColors)[2] = 0x0000ff; + if (bmp->dib) memcpy( info->bmiColors, bmp->dib->dsBitfields, 3 * sizeof(DWORD) ); + else + { + ((PDWORD)info->bmiColors)[0] = 0xff0000; + ((PDWORD)info->bmiColors)[1] = 0x00ff00; + ((PDWORD)info->bmiColors)[2] = 0x0000ff; + } } break; } @@ -1236,10 +1250,22 @@ &planes, &bpp, &compression, &sizeImage )) == -1)) return 0;
- if (compression != BI_RGB && compression != BI_BITFIELDS) - { - TRACE("can't create a compressed (%u) dibsection\n", compression); + switch (bpp) + { + case 16: + case 32: + if (compression == BI_BITFIELDS) break; + /* fall through */ + case 1: + case 4: + case 8: + case 24: + if (compression == BI_RGB) break; + WARN( "invalid %u bpp compression %u\n", bpp, compression ); return 0; + default: + FIXME( "should fail %u bpp compression %u\n", bpp, compression ); + break; }
if (!(dib = HeapAlloc( GetProcessHeap(), 0, sizeof(*dib) ))) return 0;
Modified: branches/arwinss/reactos/dll/win32/gdi32/font.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/... ============================================================================== --- branches/arwinss/reactos/dll/win32/gdi32/font.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/gdi32/font.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -1702,16 +1702,21 @@
if( !(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)) && count > 0 ) { + INT cGlyphs; reordered_str = HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR));
BIDI_Reorder( hdc, str, count, GCP_REORDER, ((flags&ETO_RTLREADING)!=0 || (GetTextAlign(hdc)&TA_RTLREADING)!=0)? WINE_GCPW_FORCE_RTL:WINE_GCPW_FORCE_LTR, - reordered_str, count, NULL, &glyphs ); + reordered_str, count, NULL, &glyphs, &cGlyphs);
flags |= ETO_IGNORELANGUAGE; if (glyphs) + { flags |= ETO_GLYPH_INDEX; + if (cGlyphs != count) + count = cGlyphs; + } } else if(flags & ETO_GLYPH_INDEX) glyphs = reordered_str; @@ -2874,7 +2879,7 @@ } else { BIDI_Reorder(NULL, lpString, uCount, dwFlags, WINE_GCPW_FORCE_LTR, lpResults->lpOutString, - nSet, lpResults->lpOrder, NULL ); + nSet, lpResults->lpOrder, NULL, NULL ); }
/* FIXME: Will use the placement chars */
Modified: branches/arwinss/reactos/dll/win32/gdi32/freetype.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/... ============================================================================== --- branches/arwinss/reactos/dll/win32/gdi32/freetype.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/gdi32/freetype.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -5107,22 +5107,19 @@ { for ( x = 0; x < src_width / hmul; x++ ) { - unsigned int alpha = (src[hmul * x + rgb_interval * 0] + - src[hmul * x + rgb_interval * 1] + - src[hmul * x + rgb_interval * 2]) / 3; if ( rgb ) { - dst[x] = ((src[hmul * x + rgb_interval * 0] * alpha / 255) << 16) | - ((src[hmul * x + rgb_interval * 1] * alpha / 255) << 8) | - ((src[hmul * x + rgb_interval * 2] * alpha / 255) << 0) | - (alpha << 24); + dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 0] << 16) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | + ((unsigned int)src[hmul * x + rgb_interval * 2] << 0) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; } else { - dst[x] = ((src[hmul * x + rgb_interval * 2] * alpha / 255) << 16) | - ((src[hmul * x + rgb_interval * 1] * alpha / 255) << 8) | - ((src[hmul * x + rgb_interval * 0] * alpha / 255) << 0) | - (alpha << 24); + dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 2] << 16) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | + ((unsigned int)src[hmul * x + rgb_interval * 0] << 0) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; } } src += src_pitch * vmul;
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/... ============================================================================== --- branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -356,7 +356,7 @@ #define WINE_GCPW_LOOSE_MASK 2
extern BOOL BIDI_Reorder( HDC hDC, LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags, - LPWSTR lpOutString, INT uCountOut, UINT *lpOrder, WORD **lpGlyphs ) DECLSPEC_HIDDEN; + LPWSTR lpOutString, INT uCountOut, UINT *lpOrder, WORD **lpGlyphs, INT* cGlyphs ) DECLSPEC_HIDDEN;
/* bitmap.c */ extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap ) DECLSPEC_HIDDEN;
Propchange: branches/arwinss/reactos/dll/win32/user32/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Jun 5 17:03:58 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,45910,46314,46696,46915,47274,47321 +/vendor/wine/dlls/user32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585
Modified: branches/arwinss/reactos/dll/win32/user32/caret.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/caret.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/caret.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -270,7 +270,7 @@ } } SERVER_END_REQ; - if (ret && !hidden) + if (ret && !hidden && (x != r.left || y != r.top)) { if (old_state) CARET_DisplayCaret( hwnd, &r ); r.right += x - r.left;
Modified: branches/arwinss/reactos/dll/win32/user32/cursoricon.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -1830,6 +1830,43 @@ return TRUE; }
+/* copy an icon bitmap, even when it can't be selected into a DC */ +/* helper for CreateIconIndirect */ +static void stretch_blt_icon( HDC hdc_dst, int dst_x, int dst_y, int dst_width, int dst_height, + HBITMAP src, int width, int height ) +{ + HDC hdc = CreateCompatibleDC( 0 ); + + if (!SelectObject( hdc, src )) /* do it the hard way */ + { + BITMAPINFO *info; + void *bits; + + if (!(info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )))) return; + info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + info->bmiHeader.biWidth = width; + info->bmiHeader.biHeight = height; + info->bmiHeader.biPlanes = GetDeviceCaps( hdc_dst, PLANES ); + info->bmiHeader.biBitCount = GetDeviceCaps( hdc_dst, BITSPIXEL ); + info->bmiHeader.biCompression = BI_RGB; + info->bmiHeader.biSizeImage = height * get_dib_width_bytes( width, info->bmiHeader.biBitCount ); + info->bmiHeader.biXPelsPerMeter = 0; + info->bmiHeader.biYPelsPerMeter = 0; + info->bmiHeader.biClrUsed = 0; + info->bmiHeader.biClrImportant = 0; + bits = HeapAlloc( GetProcessHeap(), 0, info->bmiHeader.biSizeImage ); + if (bits && GetDIBits( hdc, src, 0, height, bits, info, DIB_RGB_COLORS )) + StretchDIBits( hdc_dst, dst_x, dst_y, dst_width, dst_height, + 0, 0, width, height, bits, info, DIB_RGB_COLORS, SRCCOPY ); + + HeapFree( GetProcessHeap(), 0, bits ); + HeapFree( GetProcessHeap(), 0, info ); + } + else StretchBlt( hdc_dst, dst_x, dst_y, dst_width, dst_height, hdc, 0, 0, width, height, SRCCOPY ); + + DeleteDC( hdc ); +} + /********************************************************************** * CreateIconIndirect (USER32.@) */ @@ -1839,7 +1876,7 @@ HICON hObj; HBITMAP color = 0, mask; int width, height; - HDC src, dst; + HDC hdc;
TRACE("color %p, mask %p, hotspot %ux%u, fIcon %d\n", iconinfo->hbmColor, iconinfo->hbmMask, @@ -1875,28 +1912,22 @@ mask = CreateBitmap( width, height, 1, 1, NULL ); }
- src = CreateCompatibleDC( 0 ); - dst = CreateCompatibleDC( 0 ); - - SelectObject( src, iconinfo->hbmMask ); - SelectObject( dst, mask ); - StretchBlt( dst, 0, 0, width, height, src, 0, 0, bmpAnd.bmWidth, bmpAnd.bmHeight, SRCCOPY ); + hdc = CreateCompatibleDC( 0 ); + SelectObject( hdc, mask ); + stretch_blt_icon( hdc, 0, 0, width, height, iconinfo->hbmMask, bmpAnd.bmWidth, bmpAnd.bmHeight );
if (color) { - SelectObject( src, iconinfo->hbmColor ); - SelectObject( dst, color ); - BitBlt( dst, 0, 0, width, height, src, 0, 0, SRCCOPY ); + SelectObject( hdc, color ); + stretch_blt_icon( hdc, 0, 0, width, height, iconinfo->hbmColor, width, height ); } else if (iconinfo->hbmColor) { - SelectObject( src, iconinfo->hbmColor ); - BitBlt( dst, 0, height, width, height, src, 0, 0, SRCCOPY ); + stretch_blt_icon( hdc, 0, height, width, height, iconinfo->hbmColor, width, height ); } else height /= 2;
- DeleteDC( src ); - DeleteDC( dst ); + DeleteDC( hdc );
hObj = alloc_icon_handle(); if (hObj)
Modified: branches/arwinss/reactos/dll/win32/user32/exticon.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/exticon.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/exticon.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -37,7 +37,7 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" -#include "wine/winbase16.h" +#include "winnls.h" #include "user_private.h" #include "wine/debug.h"
@@ -64,6 +64,26 @@ WORD idCount; /* How many images */ icoICONDIRENTRY idEntries[1]; /* An entry for each image (idCount of 'em) */ } icoICONDIR, *LPicoICONDIR; + +typedef struct +{ + WORD offset; + WORD length; + WORD flags; + WORD id; + WORD handle; + WORD usage; +} NE_NAMEINFO; + +typedef struct +{ + WORD type_id; + WORD count; + DWORD resloader; +} NE_TYPEINFO; + +#define NE_RSCTYPE_ICON 0x8003 +#define NE_RSCTYPE_GROUP_ICON 0x800e
#include "poppack.h"
Modified: branches/arwinss/reactos/dll/win32/user32/nonclient.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/nonclient.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/nonclient.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -1548,19 +1548,19 @@ break;
case SC_MINIMIZE: - if (hwnd == GetForegroundWindow()) + if (hwnd == GetActiveWindow()) ShowOwnedPopups(hwnd,FALSE); ShowWindow( hwnd, SW_MINIMIZE ); break;
case SC_MAXIMIZE: - if (IsIconic(hwnd) && hwnd == GetForegroundWindow()) + if (IsIconic(hwnd) && hwnd == GetActiveWindow()) ShowOwnedPopups(hwnd,TRUE); ShowWindow( hwnd, SW_MAXIMIZE ); break;
case SC_RESTORE: - if (IsIconic(hwnd) && hwnd == GetForegroundWindow()) + if (IsIconic(hwnd) && hwnd == GetActiveWindow()) ShowOwnedPopups(hwnd,TRUE); ShowWindow( hwnd, SW_RESTORE ); break;
Modified: branches/arwinss/reactos/dll/win32/user32/win.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/win.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/win.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -1149,9 +1149,14 @@ if((cs->style & WS_VISIBLE) && IsZoomed(top_child)) { TRACE("Restoring current maximized child %p\n", top_child); - SendMessageW( top_child, WM_SETREDRAW, FALSE, 0 ); - ShowWindow( top_child, SW_SHOWNORMAL ); - SendMessageW( top_child, WM_SETREDRAW, TRUE, 0 ); + if (cs->style & WS_MAXIMIZE) + { + /* if the new window is maximized don't bother repainting */ + SendMessageW( top_child, WM_SETREDRAW, FALSE, 0 ); + ShowWindow( top_child, SW_SHOWNORMAL ); + SendMessageW( top_child, WM_SETREDRAW, TRUE, 0 ); + } + else ShowWindow( top_child, SW_SHOWNORMAL ); } } }
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/brush.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/brush.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/brush.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -309,6 +309,7 @@ DeleteObject( hBitmap ); GlobalUnlock( (HGLOBAL)logbrush.lbHatch ); } + break; } return hbrush;
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/event.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/event.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/event.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -523,7 +523,6 @@ if (IsWindowEnabled(hwnd)) { HMENU hSysMenu; - POINT pt;
if (GetClassLongW(hwnd, GCL_STYLE) & CS_NOCLOSE) return; hSysMenu = GetSystemMenu(hwnd, FALSE); @@ -554,10 +553,12 @@ break; } } - /* Simulate clicking the caption Close button */ - GetCursorPos( &pt ); - PostMessageW( hwnd, WM_NCLBUTTONDOWN, HTCLOSE, MAKELPARAM( pt.x, pt.y ) ); - PostMessageW( hwnd, WM_LBUTTONUP, HTCLOSE, MAKELPARAM( pt.x, pt.y ) ); + + /* Simulate pressing Alt+F4 */ + keybd_event(VK_MENU, 0, 0, 0); + keybd_event(VK_F4, 0, 0, 0); + keybd_event(VK_F4, 0, KEYEVENTF_KEYUP, 0); + keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0); } } else if (protocol == x11drv_atom(WM_TAKE_FOCUS)) @@ -942,6 +943,8 @@ static void handle_wm_state_notify( struct x11drv_win_data *data, XPropertyEvent *event, BOOL update_window ) { + DWORD style; + switch(event->state) { case PropertyDelete: @@ -967,25 +970,37 @@
if (!update_window || !data->managed || !data->mapped) return;
+ style = GetWindowLongW( data->hwnd, GWL_STYLE ); + if (data->iconic && data->wm_state == NormalState) /* restore window */ { data->iconic = FALSE; if (is_net_wm_state_maximized( event->display, data )) { - TRACE( "restoring to max %p/%lx\n", data->hwnd, data->whole_window ); - SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 ); - } - else + if ((style & WS_MAXIMIZEBOX) && !(style & WS_DISABLED)) + { + TRACE( "restoring to max %p/%lx\n", data->hwnd, data->whole_window ); + SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 ); + } + else TRACE( "not restoring to max win %p/%lx style %08x\n", + data->hwnd, data->whole_window, style ); + } + else if (style & (WS_MINIMIZE | WS_MAXIMIZE)) { TRACE( "restoring win %p/%lx\n", data->hwnd, data->whole_window ); SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0 ); } + else TRACE( "not restoring win %p/%lx style %08x\n", data->hwnd, data->whole_window, style ); } else if (!data->iconic && data->wm_state == IconicState) { - TRACE( "minimizing win %p/%lx\n", data->hwnd, data->whole_window ); data->iconic = TRUE; - SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0 ); + if ((style & WS_MINIMIZEBOX) && !(style & WS_DISABLED)) + { + TRACE( "minimizing win %p/%lx\n", data->hwnd, data->whole_window ); + SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0 ); + } + else TRACE( "not minimizing win %p/%lx style %08x\n", data->hwnd, data->whole_window, style ); } }
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/graphics.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/graphics.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/graphics.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -36,6 +36,7 @@ #define PI M_PI #endif #include <string.h> +#include <limits.h>
#include "windef.h" #include "winbase.h" @@ -131,10 +132,10 @@ for (j = data->rdh.nCount-1; j >= 0; j--) { tmp = rect[j]; - xrect[j].x = tmp.left; - xrect[j].y = tmp.top; - xrect[j].width = tmp.right - tmp.left; - xrect[j].height = tmp.bottom - tmp.top; + xrect[j].x = max( min( tmp.left, SHRT_MAX), SHRT_MIN); + xrect[j].y = max( min( tmp.top, SHRT_MAX), SHRT_MIN); + xrect[j].width = max( min( tmp.right - xrect[j].x, USHRT_MAX), 0); + xrect[j].height = max( min( tmp.bottom - xrect[j].y, USHRT_MAX), 0); } } else @@ -142,10 +143,10 @@ for (i = 0; i < data->rdh.nCount; i++) { tmp = rect[i]; - xrect[i].x = tmp.left; - xrect[i].y = tmp.top; - xrect[i].width = tmp.right - tmp.left; - xrect[i].height = tmp.bottom - tmp.top; + xrect[i].x = max( min( tmp.left, SHRT_MAX), SHRT_MIN); + xrect[i].y = max( min( tmp.top, SHRT_MAX), SHRT_MIN); + xrect[i].width = max( min( tmp.right - xrect[i].x, USHRT_MAX), 0); + xrect[i].height = max( min( tmp.bottom - xrect[i].y, USHRT_MAX), 0); } } return data;
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/ime.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- 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 Jun 5 17:03:58 2010 @@ -189,7 +189,7 @@ return currentOffset; }
-static HIMCC updateCompStr(HIMCC old, LPWSTR compstr, DWORD len) +static HIMCC updateCompStr(HIMCC old, LPCWSTR compstr, DWORD len) { /* we need to make sure the CompStr, CompClaus and CompAttr fields are all * set and correct */ @@ -923,7 +923,7 @@
if (dwCompLen && lpComp) { - newCompStr = updateCompStr(lpIMC->hCompStr, (LPWSTR)lpComp, dwCompLen / sizeof(WCHAR)); + newCompStr = updateCompStr(lpIMC->hCompStr, (LPCWSTR)lpComp, dwCompLen / sizeof(WCHAR)); ImmDestroyIMCC(lpIMC->hCompStr); lpIMC->hCompStr = newCompStr;
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/settings.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/settings.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/settings.c [iso-8859-1] Sat Jun 5 17:03:58 2010 @@ -245,7 +245,7 @@ return FALSE;
#define set_value(name, data) \ - if (RegSetValueExA(hkey, name, 0, REG_DWORD, (LPBYTE)(data), sizeof(DWORD))) \ + if (RegSetValueExA(hkey, name, 0, REG_DWORD, (const BYTE*)(data), sizeof(DWORD))) \ ret = FALSE
set_value("DefaultSettings.BitsPerPel", &dm->dmBitsPerPel);
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/window.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- 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 Jun 5 17:03:58 2010 @@ -215,15 +215,12 @@
/*********************************************************************** - * X11DRV_is_window_rect_mapped + * is_window_rect_mapped * * Check if the X whole window should be mapped based on its rectangle */ static BOOL is_window_rect_mapped( const RECT *rect ) { - /* don't map if rect is empty */ - if (IsRectEmpty( rect )) return FALSE; - /* don't map if rect is off-screen */ if (rect->left >= virtual_screen_rect.right || rect->top >= virtual_screen_rect.bottom || @@ -246,19 +243,6 @@ /* Metacity needs the window to be resizable to make it fullscreen */ return (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width && data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height); -} - - -/*********************************************************************** - * get_window_owner - */ -static HWND get_window_owner( HWND hwnd ) -{ - RECT rect; - HWND owner = GetWindow( hwnd, GW_OWNER ); - /* ignore the zero-size owners used by Delphi apps */ - if (owner && GetWindowRect( owner, &rect ) && IsRectEmpty( &rect )) owner = 0; - return owner; }
@@ -456,6 +440,16 @@
if (!data->whole_window) return; data->shaped = FALSE; + + if (IsRectEmpty( &data->window_rect )) /* set an empty shape */ + { + static XRectangle empty_rect; + wine_tsx11_lock(); + XShapeCombineRectangles( display, data->whole_window, ShapeBounding, 0, 0, + &empty_rect, 1, ShapeSet, YXBanded ); + wine_tsx11_unlock(); + return; + }
if (hrgn == (HRGN)1) /* hack: win_region == 1 means retrieve region from server */ { @@ -1019,6 +1013,8 @@ { size_hints->max_width = data->whole_rect.right - data->whole_rect.left; size_hints->max_height = data->whole_rect.bottom - data->whole_rect.top; + if (size_hints->max_width <= 0 ||size_hints->max_height <= 0) + size_hints->max_width = size_hints->max_height = 1; size_hints->min_width = size_hints->max_width; size_hints->min_height = size_hints->max_height; size_hints->flags |= PMinSize | PMaxSize; @@ -1121,7 +1117,7 @@ * * Retrieve an owner's window, creating it if necessary. */ -static Window get_owner_whole_window( HWND owner ) +static Window get_owner_whole_window( HWND owner, BOOL force_managed ) { struct x11drv_win_data *data;
@@ -1133,7 +1129,7 @@ !(data = X11DRV_create_win_data( owner ))) return (Window)GetPropA( owner, whole_window_prop ); } - else if (!data->managed) /* make it managed */ + else if (!data->managed && force_managed) /* make it managed */ { SetWindowPos( owner, 0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | @@ -1168,8 +1164,8 @@ { style = GetWindowLongW( data->hwnd, GWL_STYLE ); ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE ); - owner = get_window_owner( data->hwnd ); - if ((owner_win = get_owner_whole_window( owner ))) group_leader = owner_win; + owner = GetWindow( data->hwnd, GW_OWNER ); + if ((owner_win = get_owner_whole_window( owner, data->managed ))) group_leader = owner_win; }
wine_tsx11_lock(); @@ -1182,6 +1178,7 @@ /* set the WM_WINDOW_TYPE */ if (style & WS_THICKFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL); else if (ex_style & WS_EX_APPWINDOW) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL); + else if (style & WS_MINIMIZEBOX) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL); else if (style & WS_DLGFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); else if (ex_style & WS_EX_DLGMODALFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); else if ((style & WS_POPUP) && owner) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG); @@ -1258,7 +1255,7 @@ new_state |= (1 << NET_WM_STATE_ABOVE); if (ex_style & WS_EX_TOOLWINDOW) new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR) | (1 << NET_WM_STATE_SKIP_PAGER); - if (!(ex_style & WS_EX_APPWINDOW) && get_window_owner( data->hwnd )) + if (!(ex_style & WS_EX_APPWINDOW) && GetWindow( data->hwnd, GW_OWNER )) new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR);
if (!data->mapped) /* set the _NET_WM_STATE atom directly */ @@ -1501,6 +1498,8 @@ XReconfigureWMWindow( display, data->whole_window, DefaultScreen(display), mask, &changes ); #ifdef HAVE_LIBXSHAPE + if (IsRectEmpty( old_window_rect ) != IsRectEmpty( &data->window_rect )) + sync_window_region( display, data, (HRGN)1 ); if (data->shaped) { int old_x_offset = old_window_rect->left - old_whole_rect->left; @@ -1688,7 +1687,7 @@ sync_window_text( display, data->whole_window, text );
/* set the window region */ - if (win_rgn) sync_window_region( display, data, win_rgn ); + if (win_rgn || IsRectEmpty( &data->window_rect )) sync_window_region( display, data, win_rgn );
/* set the window opacity */ if (!GetLayeredWindowAttributes( data->hwnd, &key, &alpha, &layered_flags )) layered_flags = 0; @@ -2331,7 +2330,8 @@ if (data->mapped) { if (((swp_flags & SWP_HIDEWINDOW) && !(new_style & WS_VISIBLE)) || - (!event_type && !is_window_rect_mapped( rectWindow ))) + (event_type != ConfigureNotify && + !is_window_rect_mapped( rectWindow ) && is_window_rect_mapped( &old_window_rect ))) unmap_window( display, data ); }
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/xrender.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- 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 Jun 5 17:03:58 2010 @@ -193,6 +193,7 @@ MAKE_FUNCPTR(FcPatternDestroy) MAKE_FUNCPTR(FcPatternAddInteger) MAKE_FUNCPTR(FcPatternAddString) +MAKE_FUNCPTR(FcPatternGetBool) MAKE_FUNCPTR(FcPatternGetInteger) MAKE_FUNCPTR(FcPatternGetString) static void *fontconfig_handle; @@ -408,6 +409,7 @@ LOAD_FUNCPTR(FcPatternDestroy); LOAD_FUNCPTR(FcPatternAddInteger); LOAD_FUNCPTR(FcPatternAddString); + LOAD_FUNCPTR(FcPatternGetBool); LOAD_FUNCPTR(FcPatternGetInteger); LOAD_FUNCPTR(FcPatternGetString); #undef LOAD_FUNCPTR @@ -936,14 +938,17 @@ if ((match = pFcFontMatch( NULL, pattern, &result ))) { int rgba; - + FcBool antialias; + + if (pFcPatternGetBool( match, FC_ANTIALIAS, 0, &antialias ) != FcResultMatch) + antialias = TRUE; if (pFcPatternGetInteger( match, FC_RGBA, 0, &rgba ) == FcResultMatch) { FcChar8 *file; if (pFcPatternGetString( match, FC_FILE, 0, &file ) != FcResultMatch) file = NULL;
- TRACE( "fontconfig returned rgba %u for font %s file %s\n", - rgba, debugstr_w(plfsz->lf.lfFaceName), debugstr_a((char *)file) ); + TRACE( "fontconfig returned rgba %u antialias %u for font %s file %s\n", + rgba, antialias, debugstr_w(plfsz->lf.lfFaceName), debugstr_a((char *)file) );
switch (rgba) { @@ -951,7 +956,7 @@ case FC_RGBA_BGR: entry->aa_default = AA_BGR; break; case FC_RGBA_VRGB: entry->aa_default = AA_VRGB; break; case FC_RGBA_VBGR: entry->aa_default = AA_VBGR; break; - case FC_RGBA_NONE: entry->aa_default = AA_None; break; + case FC_RGBA_NONE: entry->aa_default = antialias ? AA_Grey : AA_None; break; } } pFcPatternDestroy( match ); @@ -959,6 +964,30 @@ pFcPatternDestroy( pattern ); } #endif /* SONAME_LIBFONTCONFIG */ + + /* now check Xft resources */ + { + char *value; + BOOL antialias = TRUE; + + wine_tsx11_lock(); + if ((value = XGetDefault( gdi_display, "Xft", "antialias" ))) + { + if (tolower(value[0]) == 'f' || tolower(value[0]) == 'n' || + value[0] == '0' || !strcasecmp( value, "off" )) + antialias = FALSE; + } + if ((value = XGetDefault( gdi_display, "Xft", "rgba" ))) + { + TRACE( "Xft resource returned rgba '%s' antialias %u\n", value, antialias ); + if (!strcmp( value, "rgb" )) entry->aa_default = AA_RGB; + else if (!strcmp( value, "bgr" )) entry->aa_default = AA_BGR; + else if (!strcmp( value, "vrgb" )) entry->aa_default = AA_VRGB; + else if (!strcmp( value, "vbgr" )) entry->aa_default = AA_VBGR; + else if (!strcmp( value, "none" )) entry->aa_default = antialias ? AA_Grey : AA_None; + } + wine_tsx11_unlock(); + } } else entry->aa_default = AA_None;