From: Rémi Bernon rbernon@codeweavers.com
--- server/queue.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 2eb8ece4dbc..cbe402f1fb9 100644 --- a/server/queue.c +++ b/server/queue.c @@ -47,6 +47,8 @@ #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
+#define QS_INTERNAL_HARDWARE 0x80000000 + enum message_kind { SEND_MESSAGE, POST_MESSAGE }; #define NB_MSG_KINDS (POST_MESSAGE+1)
@@ -581,7 +583,8 @@ void set_queue_hooks( struct thread *thread, struct hook_table *hooks ) /* check the queue status */ static inline int is_signaled( struct msg_queue *queue ) { - return ((queue->wake_bits & queue->wake_mask) || (queue->changed_bits & queue->changed_mask)); + return (queue->wake_bits & (queue->wake_mask | QS_INTERNAL_HARDWARE)) || + (queue->changed_bits & (queue->changed_mask | QS_INTERNAL_HARDWARE)); }
/* set some queue bits */ @@ -630,6 +633,12 @@ static inline int filter_contains_hw_range( unsigned int first, unsigned int las return 1; }
+/* is this message an internal driver notification message */ +static inline BOOL is_internal_hardware_message( unsigned int message ) +{ + return (message >= WM_WINE_FIRST_DRIVER_MSG && message <= WM_WINE_LAST_DRIVER_MSG); +} + /* get the QS_* bit corresponding to a given hardware message */ static inline int get_hardware_msg_bit( unsigned int message ) { @@ -637,8 +646,7 @@ static inline int get_hardware_msg_bit( unsigned int message ) if (message == WM_INPUT_DEVICE_CHANGE || message == WM_INPUT) return QS_RAWINPUT; if (message == WM_MOUSEMOVE || message == WM_NCMOUSEMOVE) return QS_MOUSEMOVE; if (message >= WM_KEYFIRST && message <= WM_KEYLAST) return QS_KEY; - if (message == WM_WINE_CLIPCURSOR) return QS_RAWINPUT; - if (message == WM_WINE_SETCURSOR) return QS_RAWINPUT; + if (is_internal_hardware_message( message )) return QS_INTERNAL_HARDWARE; return QS_MOUSEBUTTON; }
@@ -1617,6 +1625,7 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru { case QS_POINTER: case QS_RAWINPUT: + case QS_INTERNAL_HARDWARE: if (!(win = msg->win) && input) win = input->focus; break; case QS_KEY: @@ -2411,12 +2420,6 @@ static int check_hw_message_filter( user_handle_t win, unsigned int msg_code, } }
-/* is this message an internal driver notification message */ -static inline BOOL is_internal_hardware_message( unsigned int message ) -{ - return (message >= WM_WINE_FIRST_DRIVER_MSG && message <= WM_WINE_LAST_DRIVER_MSG); -} - /* find a hardware message for the given queue */ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user_handle_t filter_win, unsigned int first, unsigned int last, unsigned int flags, @@ -2805,8 +2808,8 @@ DECL_HANDLER(set_queue_mask) { queue->wake_mask = req->wake_mask; queue->changed_mask = req->changed_mask; - reply->wake_bits = queue->wake_bits; - reply->changed_bits = queue->changed_bits; + reply->wake_bits = queue->wake_bits & ~QS_INTERNAL_HARDWARE; + reply->changed_bits = queue->changed_bits & ~QS_INTERNAL_HARDWARE; if (is_signaled( queue )) { /* if skip wait is set, do what would have been done in the subsequent wait */ @@ -2823,8 +2826,8 @@ DECL_HANDLER(get_queue_status) struct msg_queue *queue = current->queue; if (queue) { - reply->wake_bits = queue->wake_bits; - reply->changed_bits = queue->changed_bits; + reply->wake_bits = queue->wake_bits & ~QS_INTERNAL_HARDWARE; + reply->changed_bits = queue->changed_bits & ~QS_INTERNAL_HARDWARE; queue->changed_bits &= ~req->clear_bits; } else reply->wake_bits = reply->changed_bits = 0;