Ken Thomases : winemac: Convert the QUERY_RESIZE_END query to an event, WINDOW_RESIZE_ENDED.
Alexandre Julliard
julliard at winehq.org
Fri Jan 10 14:44:53 CST 2014
Module: wine
Branch: stable
Commit: 53adc25ed90b8da9b3ec669d477ab4b66289fd35
URL: http://source.winehq.org/git/wine.git/?a=commit;h=53adc25ed90b8da9b3ec669d477ab4b66289fd35
Author: Ken Thomases <ken at codeweavers.com>
Date: Thu Oct 31 19:16:42 2013 -0500
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.
(cherry picked from commit 83f6470c0e325f8e25062eeb21fa2ffc0dbaa50f)
---
dlls/winemac.drv/cocoa_window.m | 9 +++------
dlls/winemac.drv/event.c | 9 +++++----
dlls/winemac.drv/macdrv.h | 2 +-
dlls/winemac.drv/macdrv_cocoa.h | 2 +-
dlls/winemac.drv/window.c | 25 ++++++++++++-------------
5 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 48d3e86..713f45c 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -1630,12 +1630,9 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
- (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;
}
diff --git a/dlls/winemac.drv/event.c b/dlls/winemac.drv/event.c
index 5491cdd..adb2900 100644
--- a/dlls/winemac.drv/event.c
+++ b/dlls/winemac.drv/event.c
@@ -54,6 +54,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];
@@ -110,6 +111,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;
@@ -148,10 +150,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);
@@ -250,6 +248,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;
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 992a7cd..2d3b4d0 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -164,7 +164,7 @@ extern void macdrv_app_quit_requested(const macdrv_event *event) DECLSPEC_HIDDEN
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;
diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h
index 3f6c8f4..76248bd 100644
--- a/dlls/winemac.drv/macdrv_cocoa.h
+++ b/dlls/winemac.drv/macdrv_cocoa.h
@@ -187,6 +187,7 @@ enum {
WINDOW_GOT_FOCUS,
WINDOW_LOST_FOCUS,
WINDOW_MINIMIZE_REQUESTED,
+ WINDOW_RESIZE_ENDED,
NUM_EVENT_TYPES
};
@@ -277,7 +278,6 @@ enum {
QUERY_DRAG_OPERATION,
QUERY_IME_CHAR_RECT,
QUERY_PASTEBOARD_DATA,
- QUERY_RESIZE_END,
QUERY_RESIZE_START,
QUERY_MIN_MAX_INFO,
NUM_QUERY_TYPES
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 3d436ac..273b70e 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -1867,6 +1867,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;
@@ -2051,19 +2063,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
*
* Handler for QUERY_MIN_MAX_INFO query.
More information about the wine-cvs
mailing list