winemac: Convert the QUERY_RESIZE_END query to an event, WINDOW_RESIZE_ENDED.

Queries can be run out of order because the main thread is waiting on the
response.  The main thread didn't really need a response from QUERY_RESIZE_END.
It was only a query for symmetry with QUERY_RESIZE_START.
This commit is contained in:
Ken Thomases 2013-10-31 19:16:42 -05:00 committed by Alexandre Julliard
parent de3fb34af7
commit 83f6470c0e
5 changed files with 22 additions and 25 deletions

View File

@ -1639,12 +1639,9 @@ - (void)windowDidDeminiaturize:(NSNotification *)notification
- (void) windowDidEndLiveResize:(NSNotification *)notification
{
macdrv_query* query = macdrv_create_query();
query->type = QUERY_RESIZE_END;
query->window = (macdrv_window)[self retain];
[self.queue query:query timeout:0.3];
macdrv_release_query(query);
macdrv_event* event = macdrv_create_event(WINDOW_RESIZE_ENDED, self);
[queue postEvent:event];
macdrv_release_event(event);
self.liveResizeDisplayTimer = nil;
}

View File

@ -55,6 +55,7 @@ static const char *dbgstr_event(int type)
"WINDOW_GOT_FOCUS",
"WINDOW_LOST_FOCUS",
"WINDOW_MINIMIZE_REQUESTED",
"WINDOW_RESIZE_ENDED",
};
if (0 <= type && type < NUM_EVENT_TYPES) return event_names[type];
@ -114,6 +115,7 @@ static macdrv_event_mask get_event_mask(DWORD mask)
event_mask |= event_mask_for_type(RELEASE_CAPTURE);
event_mask |= event_mask_for_type(WINDOW_BROUGHT_FORWARD);
event_mask |= event_mask_for_type(WINDOW_MINIMIZE_REQUESTED);
event_mask |= event_mask_for_type(WINDOW_RESIZE_ENDED);
}
return event_mask;
@ -152,10 +154,6 @@ static void macdrv_query_event(HWND hwnd, const macdrv_event *event)
TRACE("QUERY_PASTEBOARD_DATA\n");
success = query_pasteboard_data(hwnd, query->pasteboard_data.type);
break;
case QUERY_RESIZE_END:
TRACE("QUERY_RESIZE_END\n");
success = query_resize_end(hwnd);
break;
case QUERY_RESIZE_START:
TRACE("QUERY_RESIZE_START\n");
success = query_resize_start(hwnd);
@ -257,6 +255,9 @@ void macdrv_handle_event(const macdrv_event *event)
case WINDOW_MINIMIZE_REQUESTED:
macdrv_window_minimize_requested(hwnd);
break;
case WINDOW_RESIZE_ENDED:
macdrv_window_resize_ended(hwnd);
break;
default:
TRACE(" ignoring\n");
break;

View File

@ -165,7 +165,7 @@ static inline RECT rect_from_cgrect(CGRect cgrect)
extern void macdrv_window_minimize_requested(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_did_unminimize(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_brought_forward(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL query_resize_end(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_resize_ended(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN;

View File

@ -194,6 +194,7 @@ extern int macdrv_set_display_mode(const struct macdrv_display* display,
WINDOW_GOT_FOCUS,
WINDOW_LOST_FOCUS,
WINDOW_MINIMIZE_REQUESTED,
WINDOW_RESIZE_ENDED,
NUM_EVENT_TYPES
};
@ -290,7 +291,6 @@ extern int macdrv_set_display_mode(const struct macdrv_display* display,
QUERY_DRAG_OPERATION,
QUERY_IME_CHAR_RECT,
QUERY_PASTEBOARD_DATA,
QUERY_RESIZE_END,
QUERY_RESIZE_START,
QUERY_MIN_MAX_INFO,
NUM_QUERY_TYPES

View File

@ -1898,6 +1898,18 @@ void macdrv_window_brought_forward(HWND hwnd)
}
/***********************************************************************
* macdrv_window_resize_ended
*
* Handler for WINDOW_RESIZE_ENDED events.
*/
void macdrv_window_resize_ended(HWND hwnd)
{
TRACE("hwnd %p\n", hwnd);
SendMessageW(hwnd, WM_EXITSIZEMOVE, 0, 0);
}
struct quit_info {
HWND *wins;
UINT capacity;
@ -2081,19 +2093,6 @@ BOOL query_resize_start(HWND hwnd)
}
/***********************************************************************
* query_resize_end
*
* Handler for QUERY_RESIZE_END query.
*/
BOOL query_resize_end(HWND hwnd)
{
TRACE("hwnd %p\n", hwnd);
SendMessageW(hwnd, WM_EXITSIZEMOVE, 0, 0);
return TRUE;
}
/***********************************************************************
* query_min_max_info
*