Commit e78ae0f8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 12.1.0 upon wine-1.5.15

parent 2dc58ec3
......@@ -6125,8 +6125,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
{
FT_Matrix worldMat;
worldMat.xx = FT_FixedFromFloat(font->font_desc.matrix.eM11);
worldMat.xy = FT_FixedFromFloat(font->font_desc.matrix.eM12);
worldMat.yx = FT_FixedFromFloat(font->font_desc.matrix.eM21);
worldMat.xy = -FT_FixedFromFloat(font->font_desc.matrix.eM21);
worldMat.yx = -FT_FixedFromFloat(font->font_desc.matrix.eM12);
worldMat.yy = FT_FixedFromFloat(font->font_desc.matrix.eM22);
pFT_Matrix_Multiply(&worldMat, &transMat);
pFT_Matrix_Multiply(&worldMat, &transMatUnrotated);
......@@ -6138,8 +6138,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
{
FT_Matrix extraMat;
extraMat.xx = FT_FixedFromFIXED(lpmat->eM11);
extraMat.xy = FT_FixedFromFIXED(lpmat->eM12);
extraMat.yx = FT_FixedFromFIXED(lpmat->eM21);
extraMat.xy = FT_FixedFromFIXED(lpmat->eM21);
extraMat.yx = FT_FixedFromFIXED(lpmat->eM12);
extraMat.yy = FT_FixedFromFIXED(lpmat->eM22);
pFT_Matrix_Multiply(&extraMat, &transMat);
pFT_Matrix_Multiply(&extraMat, &transMatUnrotated);
......
......@@ -1497,15 +1497,13 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForw
continue;
}
/* Ignore all entries except for gateway routes which aren't
multicast */
if (!(rtm->rtm_flags & RTF_GATEWAY) ||
(rtm->rtm_flags & RTF_MULTICAST))
/* Ignore gateway routes which are multicast */
if ((rtm->rtm_flags & RTF_GATEWAY) && (rtm->rtm_flags & RTF_MULTICAST))
continue;
memset( &row, 0, sizeof(row) );
row.dwForwardIfIndex = rtm->rtm_index;
row.u1.ForwardType = MIB_IPROUTE_TYPE_INDIRECT;
row.u1.ForwardType = (rtm->rtm_flags & RTF_GATEWAY) ? MIB_IPROUTE_TYPE_INDIRECT : MIB_IPROUTE_TYPE_DIRECT;
row.dwForwardMetric1 = rtm->rtm_rmx.rmx_hopcount;
row.u2.ForwardProto = MIB_IPPROTO_LOCAL;
......@@ -1523,19 +1521,29 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForw
ADVANCE (addrPtr, sa);
/* default routes are encoded by length-zero sockaddr */
if (sa->sa_len == 0)
if (sa->sa_len == 0) {
addr = 0;
else if (sa->sa_family != AF_INET)
{
WARN ("Received unsupported sockaddr family 0x%x\n",
sa->sa_family);
addr = 0;
}
else
{
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
addr = sin->sin_addr.s_addr;
}else {
switch(sa->sa_family) {
case AF_INET: {
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
addr = sin->sin_addr.s_addr;
break;
}
#ifdef AF_LINK
case AF_LINK:
if(i == RTA_GATEWAY && row.u1.ForwardType == MIB_IPROUTE_TYPE_DIRECT) {
/* For direct route we may simply use dest addr as next hop */
C_ASSERT(RTA_DST < RTA_GATEWAY);
addr = row.dwForwardDest;
break;
}
/* fallthrough */
#endif
default:
WARN ("Received unsupported sockaddr family 0x%x\n", sa->sa_family);
addr = 0;
}
}
switch (i)
......
......@@ -303,6 +303,22 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
qsort(data->funcs, data->func_cnt, sizeof(func_info_t), dispid_cmp);
for(i = 1; i < data->func_cnt && data->funcs[i-1].id != data->funcs[i].id; i++);
if(i < data->func_cnt) {
unsigned j = i--;
/* We have at least one duplicated property. This may happen if more than one
* interface implements the same property. We have to remove these duplicated
* entries. */
while(j < data->func_cnt) {
while(j+1 < data->func_cnt && data->funcs[j+1].id == data->funcs[j].id)
j++;
data->funcs[i++] = data->funcs[j++];
}
data->func_cnt = i;
}
data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*));
for(i=0; i < data->func_cnt; i++)
data->name_table[i] = data->funcs+i;
......
......@@ -158,6 +158,18 @@ function test_override_functions() {
ok(tmp === "test", "div.addBehavior() = " + tmp);
}
function test_forin() {
var cnt=0;
document.body.innerHTML = '<a id="aid"></a>';
for(var x in document.getElementById("aid")) {
cnt++;
}
ok(cnt > 100, "cnt = " + cnt);
}
var globalVar = false;
function runTests() {
......@@ -177,6 +189,7 @@ function runTests() {
test_setAttribute();
test_attribute_collection();
test_override_functions();
test_forin();
var r = window.execScript("globalVar = true;");
ok(r === undefined, "execScript returned " + r);
......
......@@ -3761,6 +3761,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
if (res == WAIT_OBJECT_0 + cHandles) /* messages available */
{
MSG msg;
int count = 0;
/* call message filter */
......@@ -3790,7 +3791,9 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
}
}
while (COM_PeekMessage(apt, &msg))
/* some apps (e.g. Visio 2010) don't handle WM_PAINT properly and loop forever,
* so after processing 100 messages we go back to checking the wait handles */
while (count++ < 100 && COM_PeekMessage(apt, &msg))
{
TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message);
TranslateMessage(&msg);
......
......@@ -3677,6 +3677,16 @@ void WINAPI PostQuitMessage( INT exit_code )
SERVER_END_REQ;
}
/* check for driver events if we detect that the app is not properly consuming messages */
static inline void check_for_driver_events(void)
{
if (get_user_thread_info()->message_count > 200)
{
flush_window_surfaces( FALSE );
USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_ALLINPUT, 0 );
}
else get_user_thread_info()->message_count++;
}
/***********************************************************************
* PeekMessageW (USER32.@)
......@@ -3686,18 +3696,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW( MSG *msg_out, HWND hwnd, UINT first,
MSG msg;
USER_CheckNotLock();
check_for_driver_events();
if (!peek_message( &msg, hwnd, first, last, flags, 0 ))
{
DWORD ret;
flush_window_surfaces( !(flags & PM_NOYIELD) );
if (flags & PM_NOYIELD)
ret = USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_ALLINPUT, 0 );
else
ret = wow_handlers.wait_message( 0, NULL, 0, QS_ALLINPUT, 0 );
flush_window_surfaces( TRUE );
ret = wow_handlers.wait_message( 0, NULL, 0, QS_ALLINPUT, 0 );
/* if we received driver events, check again for a pending message */
if (ret == WAIT_TIMEOUT || !peek_message( &msg, hwnd, first, last, flags, 0 )) return FALSE;
}
......@@ -3737,6 +3743,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetMessageW( MSG *msg, HWND hwnd, UINT first, UINT
unsigned int mask = QS_POSTMESSAGE | QS_SENDMESSAGE; /* Always selected */
USER_CheckNotLock();
check_for_driver_events();
if (first || last)
{
......
......@@ -173,7 +173,8 @@ struct wm_char_mapping_data
struct user_thread_info
{
HANDLE server_queue; /* Handle to server-side queue */
DWORD recursion_count; /* SendMessage recursion counter */
WORD recursion_count; /* SendMessage recursion counter */
WORD message_count; /* Get/PeekMessage loop counter */
BOOL hook_unicode; /* Is current hook unicode? */
HHOOK hook; /* Current hook */
struct received_message_info *receive_info; /* Message being currently received */
......
......@@ -1126,6 +1126,7 @@ static DWORD wait_message( DWORD count, CONST HANDLE *handles, DWORD timeout, DW
{
DWORD ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
if (ret == WAIT_TIMEOUT && !count && !timeout) NtYieldExecution();
if ((mask & QS_INPUT) == QS_INPUT) get_user_thread_info()->message_count = 0;
return ret;
}
......
......@@ -1123,15 +1123,17 @@ void context_invalidate_state(struct wined3d_context *context, DWORD state)
}
/* This function takes care of wined3d pixel format selection. */
static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc,
const struct wined3d_format *color_format, const struct wined3d_format *ds_format,
static int context_choose_pixel_format(const struct wined3d_device *device, const struct wined3d_swapchain *swapchain,
HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format,
BOOL auxBuffers, BOOL findCompatible)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
int iPixelFormat=0;
BYTE redBits, greenBits, blueBits, alphaBits, colorBits;
BYTE depthBits=0, stencilBits=0;
unsigned int current_value;
unsigned int cfg_count = device->adapter->cfg_count;
BOOL double_buffer = TRUE;
unsigned int i;
TRACE("device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x, find_compatible %#x.\n",
......@@ -1145,6 +1147,12 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
return 0;
}
/* CrossOver hack for bug 9330. */
if ((gl_info->quirks & WINED3D_CX_QUIRK_APPLE_DOUBLE_BUFFER)
&& wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& !swapchain->desc.backbuffer_count)
double_buffer = FALSE;
getDepthStencilBits(ds_format, &depthBits, &stencilBits);
current_value = 0;
......@@ -1158,7 +1166,7 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
if (cfg->iPixelType != WGL_TYPE_RGBA_ARB)
continue;
/* In window mode we need a window drawable format and double buffering. */
if (!(cfg->windowDrawable && cfg->doubleBuffer))
if (!cfg->windowDrawable || (double_buffer && !cfg->doubleBuffer))
continue;
if (cfg->redSize < redBits)
continue;
......@@ -1181,17 +1189,19 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
* depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */
if (cfg->depthSize == depthBits)
value += 1;
if (cfg->stencilSize == stencilBits)
if (!cfg->doubleBuffer == !double_buffer)
value += 2;
if (cfg->alphaSize == alphaBits)
if (cfg->stencilSize == stencilBits)
value += 4;
if (cfg->alphaSize == alphaBits)
value += 8;
/* We like to have aux buffers in backbuffer mode */
if (auxBuffers && cfg->auxBuffers)
value += 8;
value += 16;
if (cfg->redSize == redBits
&& cfg->greenSize == greenBits
&& cfg->blueSize == blueBits)
value += 16;
value += 32;
if (value > current_value)
{
......@@ -1212,7 +1222,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/
if (double_buffer)
pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cAlphaBits = alphaBits;
pfd.cColorBits = colorBits;
......@@ -1355,13 +1367,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
/* Try to find a pixel format which matches our requirements. */
pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, FALSE);
pixel_format = context_choose_pixel_format(device, swapchain, hdc, color_format, ds_format, auxBuffers, FALSE);
/* Try to locate a compatible format if we weren't able to find anything. */
if (!pixel_format)
{
TRACE("Trying to locate a compatible pixel format because an exact match failed.\n");
pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, TRUE);
pixel_format = context_choose_pixel_format(device, swapchain, hdc, color_format, ds_format, auxBuffers, TRUE);
}
/* If we still don't have a pixel format, something is very wrong as ChoosePixelFormat barely fails */
......
......@@ -565,7 +565,9 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if (swapchain->num_contexts > 1)
gl_info->gl_ops.gl.p_glFinish();
SwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
TRACE("SwapBuffers called, Starting new frame\n");
/* FPS support */
......
......@@ -62,6 +62,7 @@
#define WINED3D_QUIRK_INFO_LOG_SPAM 0x00000080
#define WINED3D_QUIRK_LIMITED_TEX_FILTERING 0x00000100
#define WINED3D_CX_QUIRK_APPLE_DOUBLE_BUFFER 0x00010000
#define WINED3D_CX_QUIRK_COMPRESSED_CUBE_MIP 0x00020000
#define WINED3D_CX_QUIRK_GLSL_CLIP_BROKEN 0x00040000
#define WINED3D_CX_QUIRK_TEXCOORD_FOG 0x00080000
......@@ -1452,6 +1453,7 @@ enum wined3d_pci_device
CARD_NVIDIA_GEFORCE_GTX465 = 0x06c4,
CARD_NVIDIA_GEFORCE_GTX470 = 0x06cd,
CARD_NVIDIA_GEFORCE_GTX480 = 0x06c0,
CARD_NVIDIA_GEFORCE_GT520 = 0x1040,
CARD_NVIDIA_GEFORCE_GT540M = 0x0df4,
CARD_NVIDIA_GEFORCE_GTX550 = 0x1244,
CARD_NVIDIA_GEFORCE_GT555M = 0x04b8,
......@@ -1459,9 +1461,14 @@ enum wined3d_pci_device
CARD_NVIDIA_GEFORCE_GTX560 = 0x1201,
CARD_NVIDIA_GEFORCE_GTX570 = 0x1081,
CARD_NVIDIA_GEFORCE_GTX580 = 0x1080,
CARD_NVIDIA_GEFORCE_GT610 = 0x104a,
CARD_NVIDIA_GEFORCE_GT630M = 0x0de9,
CARD_NVIDIA_GEFORCE_GT640M = 0x0fd2,
CARD_NVIDIA_GEFORCE_GT650M = 0x0fd1,
CARD_NVIDIA_GEFORCE_GTX650 = 0x0fc6,
CARD_NVIDIA_GEFORCE_GTX650TI = 0x11c6,
CARD_NVIDIA_GEFORCE_GTX660 = 0x11c0,
CARD_NVIDIA_GEFORCE_GTX660TI = 0x1183,
CARD_NVIDIA_GEFORCE_GTX670 = 0x1189,
CARD_NVIDIA_GEFORCE_GTX680 = 0x1180,
......
......@@ -62,9 +62,9 @@
CGRect cursorClipRect;
CFMachPortRef cursorClippingEventTap;
NSMutableArray* warpRecords;
NSUInteger indexOfLastWarpForSetPos;
CGPoint synthesizedLocation;
NSTimeInterval lastSetCursorPositionTime;
NSTimeInterval lastEventTapEventTime;
NSMutableArray* orderedRunningApplications;
......@@ -84,7 +84,7 @@
- (BOOL) registerEventQueue:(WineEventQueue*)queue;
- (void) unregisterEventQueue:(WineEventQueue*)queue;
- (void) computeEventTimeAdjustment:(unsigned long long)tickcount;
- (void) computeEventTimeAdjustmentFromTicks:(unsigned long long)tickcount uptime:(uint64_t)uptime_ns;
- (void) invalidateGotFocusEvents;
- (void) windowGotFocus:(WineWindow*)window;
......
......@@ -174,7 +174,6 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
originalModes = [[NSMutableDictionary alloc] init];
warpRecords = [[NSMutableArray alloc] init];
indexOfLastWarpForSetPos = NSNotFound;
orderedRunningApplications = [[NSMutableArray alloc] init];
......@@ -380,10 +379,9 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
[eventQueuesLock unlock];
}
- (void) computeEventTimeAdjustment:(unsigned long long)tickcount
- (void) computeEventTimeAdjustmentFromTicks:(unsigned long long)tickcount uptime:(uint64_t)uptime_ns;
{
NSTimeInterval eventTimeBase = [[NSProcessInfo processInfo] systemUptime];
eventTimeAdjustment = (tickcount / 1000.0) - eventTimeBase;
eventTimeAdjustment = (tickcount / 1000.0) - (uptime_ns / (double)NSEC_PER_SEC);
}
/* Invalidate old focus offers across all queues. */
......@@ -824,7 +822,7 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
location->y = CGRectGetMaxY(cursorClipRect) - 1;
}
- (BOOL) warpCursorTo:(CGPoint*)newLocation from:(const CGPoint*)currentLocation forSetPos:(BOOL)forSetPos
- (BOOL) warpCursorTo:(CGPoint*)newLocation from:(const CGPoint*)currentLocation
{
CGPoint oldLocation;
......@@ -833,7 +831,7 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
else
oldLocation = NSPointToCGPoint([self flippedMouseLocation:[NSEvent mouseLocation]]);
if (forSetPos || !CGPointEqualToPoint(oldLocation, *newLocation))
if (!CGPointEqualToPoint(oldLocation, *newLocation))
{
WarpRecord* warpRecord = [[[WarpRecord alloc] init] autorelease];
CGError err;
......@@ -849,12 +847,10 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
warpRecord.timeAfter = [[NSProcessInfo processInfo] systemUptime] * NSEC_PER_SEC;
*newLocation = NSPointToCGPoint([self flippedMouseLocation:[NSEvent mouseLocation]]);
if (forSetPos || !CGPointEqualToPoint(oldLocation, *newLocation))
if (!CGPointEqualToPoint(oldLocation, *newLocation))
{
warpRecord.to = *newLocation;
[warpRecords addObject:warpRecord];
if (forSetPos)
indexOfLastWarpForSetPos = [warpRecords count] - 1;
}
}
......@@ -909,30 +905,18 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
return event;
eventTime = CGEventGetTimestamp(event);
lastEventTapEventTime = eventTime / (double)NSEC_PER_SEC;
eventLocation = CGEventGetLocation(event);
cursorLocation = NSPointToCGPoint([self flippedMouseLocation:[NSEvent mouseLocation]]);
if (![warpRecords count]) // No outstanding warps.
synthesizedLocation = eventLocation;
if ([self isMouseMoveEventType:type])
{
double deltaX, deltaY;
int warpsFinished = [self warpsFinishedByEventTime:eventTime location:eventLocation];
int i;
if (indexOfLastWarpForSetPos != NSNotFound && warpsFinished <= indexOfLastWarpForSetPos)
{
if (warpsFinished)
{
[warpRecords removeObjectsInRange:NSMakeRange(0, warpsFinished)];
indexOfLastWarpForSetPos -= warpsFinished;
}
return NULL;
}
deltaX = CGEventGetDoubleValueField(event, kCGMouseEventDeltaX);
deltaY = CGEventGetDoubleValueField(event, kCGMouseEventDeltaY);
......@@ -942,10 +926,6 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
deltaX -= warpRecord.to.x - warpRecord.from.x;
deltaY -= warpRecord.to.y - warpRecord.from.y;
[warpRecords removeObjectAtIndex:0];
if (indexOfLastWarpForSetPos == 0)
indexOfLastWarpForSetPos = NSNotFound;
else if (indexOfLastWarpForSetPos != NSNotFound)
indexOfLastWarpForSetPos--;
}
if (warpsFinished)
......@@ -965,7 +945,7 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
if (CGEventGetIntegerValueField(event, kCGEventTargetUnixProcessID) == getpid())
[self clipCursorLocation:&synthesizedLocation];
[self warpCursorTo:&synthesizedLocation from:&cursorLocation forSetPos:FALSE];
[self warpCursorTo:&synthesizedLocation from:&cursorLocation];
if (!CGPointEqualToPoint(eventLocation, synthesizedLocation))
CGEventSetLocation(event, synthesizedLocation);
......@@ -1047,16 +1027,33 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
BOOL ret;
if (clippingCursor)
{
[self clipCursorLocation:&pos];
synthesizedLocation = pos;
ret = [self warpCursorTo:&synthesizedLocation from:NULL forSetPos:TRUE];
synthesizedLocation = pos;
ret = [self warpCursorTo:&synthesizedLocation from:NULL];
if (ret)
{
// We want to discard mouse-move events that have already been
// through the event tap, because it's too late to account for
// the setting of the cursor position with them. However, the
// events that may be queued with times after that but before
// the above warp can still be used. So, use the last event
// tap event time so that -sendEvent: doesn't discard them.
lastSetCursorPositionTime = lastEventTapEventTime;
}
}
else
{
ret = (CGWarpMouseCursorPosition(pos) == kCGErrorSuccess);
if (ret)
lastSetCursorPositionTime = [[NSProcessInfo processInfo] systemUptime];
}
if (ret)
{
WineEventQueue* queue;
lastSetCursorPositionTime = [[NSProcessInfo processInfo] systemUptime];
// Discard all pending mouse move events.
[eventQueuesLock lock];
for (queue in eventQueues)
......@@ -1086,7 +1083,6 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
{
CGEventTapEnable(cursorClippingEventTap, FALSE);
[warpRecords removeAllObjects];
indexOfLastWarpForSetPos = NSNotFound;
lastSetCursorPositionTime = [[NSProcessInfo processInfo] systemUptime];
}
}
......@@ -1171,12 +1167,11 @@ static NSString* const WineAppWaitQueryResponseMode = @"WineAppWaitQueryResponse
// later than that time.
if (lastSetCursorPositionTime)
{
if ([anEvent timestamp] > lastSetCursorPositionTime)
{
lastSetCursorPositionTime = 0;
lastTargetWindow = nil;
}
return;
if ([anEvent timestamp] <= lastSetCursorPositionTime)
return;
lastSetCursorPositionTime = 0;
absolute = TRUE;
}
if ([targetWindow isKindOfClass:[WineWindow class]])
......
......@@ -19,6 +19,8 @@
*/
#import <AppKit/AppKit.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include "macdrv_cocoa.h"
#import "cocoa_app.h"
......@@ -34,8 +36,9 @@ enum {
struct cocoa_app_startup_info {
NSConditionLock* lock;
unsigned long long tickcount;
NSConditionLock* lock;
unsigned long long tickcount;
uint64_t uptime_ns;
};
......@@ -63,7 +66,7 @@ static void run_cocoa_app(void* info)
[WineApplication sharedApplication];
[NSApp setDelegate:(WineApplication*)NSApp];
[NSApp computeEventTimeAdjustment:startup_info->tickcount];
[NSApp computeEventTimeAdjustmentFromTicks:startup_info->tickcount uptime:startup_info->uptime_ns];
/* Retain the lock while we're using it, so macdrv_start_cocoa_app()
doesn't deallocate it in the middle of us unlocking it. */
......@@ -90,6 +93,8 @@ int macdrv_start_cocoa_app(unsigned long long tickcount)
int ret = -1;
CFRunLoopSourceRef source;
struct cocoa_app_startup_info startup_info;
uint64_t uptime_mach = mach_absolute_time();
mach_timebase_info_data_t mach_timebase;
NSDate* timeLimit;
CFRunLoopSourceContext source_context = { 0 };
......@@ -104,6 +109,9 @@ int macdrv_start_cocoa_app(unsigned long long tickcount)
startup_info.lock = [[NSConditionLock alloc] initWithCondition:COCOA_APP_NOT_RUNNING];
startup_info.tickcount = tickcount;
mach_timebase_info(&mach_timebase);
startup_info.uptime_ns = uptime_mach * mach_timebase.numer / mach_timebase.denom;
timeLimit = [NSDate dateWithTimeIntervalSinceNow:5];
source_context.info = &startup_info;
......
......@@ -391,9 +391,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[self deminiaturize:nil];
}
if (!state->minimized && (!state->zoomed != ![self isZoomed]))
[self zoom:nil];
self.floating = state->floating;
[self adjustForChangedDisplayMode];
......@@ -1117,7 +1114,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
event.type = WINDOW_DID_UNMINIMIZE;
event.window = (macdrv_window)[self retain];
event.window_did_unminimize.to_zoomed = [self isZoomed];
[queue postEvent:&event];
}
......
......@@ -175,7 +175,7 @@ void macdrv_handle_event(macdrv_event *event)
macdrv_window_did_minimize(hwnd);
break;
case WINDOW_DID_UNMINIMIZE:
macdrv_window_did_unminimize(hwnd, event->window_did_unminimize.to_zoomed);
macdrv_window_did_unminimize(hwnd);
break;
case QUERY_EVENT:
macdrv_query_event(hwnd, event);
......
......@@ -804,6 +804,9 @@ void macdrv_compute_keyboard_layout(struct macdrv_thread_data *thread_data)
break;
}
}
if (vkey_used[vkey])
break;
}
}
......
......@@ -158,7 +158,7 @@ extern void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) DECLSP
extern void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_app_deactivated(void) DECLSPEC_HIDDEN;
extern void macdrv_window_did_minimize(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_did_unminimize(HWND hwnd, BOOL to_zoomed) DECLSPEC_HIDDEN;
extern void macdrv_window_did_unminimize(HWND hwnd) DECLSPEC_HIDDEN;
extern CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) DECLSPEC_HIDDEN;
......
......@@ -226,9 +226,6 @@ typedef struct macdrv_event {
int iso_keyboard;
} keyboard_changed;
struct {
int to_zoomed;
} window_did_unminimize;
struct {
macdrv_query *query;
} query_event;
struct {
......@@ -274,7 +271,6 @@ struct macdrv_window_features {
struct macdrv_window_state {
unsigned int minimized:1,
zoomed:1,
floating:1,
excluded_by_expose:1,
excluded_by_cycle:1,
......
......@@ -107,7 +107,6 @@ static void get_cocoa_window_state(struct macdrv_win_data *data,
{
memset(state, 0, sizeof(*state));
state->minimized = (style & WS_MINIMIZE) != 0;
state->zoomed = (style & WS_MAXIMIZE) != 0;
state->floating = (ex_style & WS_EX_TOPMOST) != 0;
state->excluded_by_expose = state->excluded_by_cycle =
!(ex_style & WS_EX_APPWINDOW) &&
......@@ -533,23 +532,18 @@ static void constrain_window_frame(CGRect* frame)
*/
static void sync_window_position(struct macdrv_win_data *data, UINT swp_flags)
{
DWORD style = GetWindowLongW(data->hwnd, GWL_STYLE);
CGRect frame;
if (data->minimized) return;
/* resizing a maximized window is not allowed */
if (!(style & WS_MAXIMIZE))
{
CGRect frame = cgrect_from_rect(data->whole_rect);
frame = cgrect_from_rect(data->whole_rect);
constrain_window_frame(&frame);
constrain_window_frame(&frame);
data->on_screen = macdrv_set_cocoa_window_frame(data->cocoa_window, &frame);
if (data->shaped) sync_window_region(data, (HRGN)1);
data->on_screen = macdrv_set_cocoa_window_frame(data->cocoa_window, &frame);
if (data->shaped) sync_window_region(data, (HRGN)1);
TRACE("win %p/%p pos %s\n", data->hwnd, data->cocoa_window,
wine_dbgstr_rect(&data->whole_rect));
}
TRACE("win %p/%p pos %s\n", data->hwnd, data->cocoa_window,
wine_dbgstr_rect(&data->whole_rect));
if (data->on_screen && (!(swp_flags & SWP_NOZORDER) || (swp_flags & SWP_SHOWWINDOW)))
{
......@@ -1662,12 +1656,12 @@ done:
*
* Handler for WINDOW_DID_UNMINIMIZE events.
*/
void macdrv_window_did_unminimize(HWND hwnd, BOOL to_zoomed)
void macdrv_window_did_unminimize(HWND hwnd)
{
struct macdrv_win_data *data;
DWORD style;
TRACE("win %p to_zoomed %d\n", hwnd, to_zoomed);
TRACE("win %p\n", hwnd);
if (!(data = get_win_data(hwnd))) return;
if (!data->minimized) goto done;
......@@ -1675,29 +1669,16 @@ void macdrv_window_did_unminimize(HWND hwnd, BOOL to_zoomed)
style = GetWindowLongW(hwnd, GWL_STYLE);
data->minimized = FALSE;
if (to_zoomed)
{
if ((style & WS_MAXIMIZEBOX) && !(style & WS_DISABLED))
{
TRACE("restoring to max %p/%p\n", hwnd, data->cocoa_window);
release_win_data(data);
SendMessageW(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
return;
}
TRACE("not restoring to max win %p/%p style %08x\n", hwnd, data->cocoa_window, style);
}
else
if (style & (WS_MINIMIZE | WS_MAXIMIZE))
{
if (style & (WS_MINIMIZE | WS_MAXIMIZE))
{
TRACE("restoring win %p/%p\n", hwnd, data->cocoa_window);
release_win_data(data);
SendMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
return;
}
TRACE("not restoring win %p/%p style %08x\n", hwnd, data->cocoa_window, style);
TRACE("restoring win %p/%p\n", hwnd, data->cocoa_window);
release_win_data(data);
SendMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
return;
}
TRACE("not restoring win %p/%p style %08x\n", hwnd, data->cocoa_window, style);
done:
release_win_data(data);
}
......@@ -1620,6 +1620,8 @@ static void update_surface_region( struct x11drv_window_surface *surface )
int x, y, start, width;
HRGN rgn;
if (!shape_layered_windows) return;
if (!surface->is_argb && surface->color_key == CLR_INVALID)
{
XShapeCombineMask( gdi_display, surface->window, ShapeBounding, 0, 0, None, ShapeSet );
......
......@@ -210,6 +210,7 @@ extern const int X11DRV_XROPfunction[];
extern int client_side_graphics DECLSPEC_HIDDEN;
extern int client_side_with_render DECLSPEC_HIDDEN;
extern int shape_layered_windows DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN;
extern struct opengl_funcs *get_glx_driver(UINT) DECLSPEC_HIDDEN;
......
......@@ -82,6 +82,7 @@ int private_color_map = 0;
int primary_monitor = 0;
int client_side_graphics = 0;
int client_side_with_render = 1;
int shape_layered_windows = 1;
int copy_default_colors = 128;
int alloc_system_colors = 256;
DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES;
......@@ -403,6 +404,9 @@ static void setup_options(void)
if (!get_config_key( hkey, appkey, "UseXIM", buffer, sizeof(buffer) ))
use_xim = IS_OPTION_TRUE( buffer[0] );
if (!get_config_key( hkey, appkey, "ShapeLayeredWindows", buffer, sizeof(buffer) ))
shape_layered_windows = IS_OPTION_TRUE( buffer[0] );
if (!get_config_key( hkey, appkey, "PrivateColorMap", buffer, sizeof(buffer) ))
private_color_map = IS_OPTION_TRUE( buffer[0] );
......
......@@ -170,11 +170,12 @@ static BOOL load_persistent_cookie(LPCWSTR domain, LPCWSTR path)
if(!cookie)
return FALSE;
if(!(str = heap_alloc(size)) || !ReadUrlCacheEntryStream(cookie, 0, str, &size, 0)) {
if(!(str = heap_alloc(size+1)) || !ReadUrlCacheEntryStream(cookie, 0, str, &size, 0)) {
UnlockUrlCacheEntryStream(cookie, 0);
heap_free(str);
return FALSE;
}
str[size] = 0;
UnlockUrlCacheEntryStream(cookie, 0);
LIST_FOR_EACH(iter, &domain_list)
......
......@@ -2901,6 +2901,9 @@ BOOL WINAPI CreateUrlCacheEntryW(
break;
}
}
if(!bFound)
lpszUrlPart++;
if (!lstrcmpW(lpszUrlPart, szWWW))
{
lpszUrlPart += lstrlenW(szWWW);
......
......@@ -4452,6 +4452,15 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
if (setsockopt(fd, level, optname, optval, optlen) == 0)
{
#ifdef __APPLE__
if (level == SOL_SOCKET && optname == SO_REUSEADDR &&
setsockopt(fd, level, SO_REUSEPORT, optval, optlen) != 0)
{
SetLastError(wsaErrno());
release_sock_fd( s, fd );
return SOCKET_ERROR;
}
#endif
release_sock_fd( s, fd );
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment