Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
761ad810
Commit
761ad810
authored
Mar 13, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Allow for processing Cocoa events while waiting for query results.
parent
bff19b17
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
6 deletions
+43
-6
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+6
-1
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+14
-2
cocoa_event.h
dlls/winemac.drv/cocoa_event.h
+1
-0
cocoa_event.m
dlls/winemac.drv/cocoa_event.m
+20
-2
event.c
dlls/winemac.drv/event.c
+2
-1
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
761ad810
...
...
@@ -26,6 +26,11 @@
#define ERR(...) do { if (macdrv_err_on) LogError(__func__, __VA_ARGS__); } while (false)
enum
{
WineApplicationEventWakeQuery
,
};
@class
WineEventQueue
;
@class
WineWindow
;
...
...
@@ -87,7 +92,7 @@
-
(
void
)
windowGotFocus
:(
WineWindow
*
)
window
;
-
(
BOOL
)
waitUntilQueryDone
:(
int
*
)
done
timeout
:(
NSDate
*
)
timeout
;
-
(
BOOL
)
waitUntilQueryDone
:(
int
*
)
done
timeout
:(
NSDate
*
)
timeout
processEvents
:(
BOOL
)
processEvents
;
-
(
void
)
keyboardSelectionDidChange
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
761ad810
...
...
@@ -172,13 +172,25 @@ int macdrv_err_on;
}
}
-
(
BOOL
)
waitUntilQueryDone
:
(
int
*
)
done
timeout
:
(
NSDate
*
)
timeout
-
(
BOOL
)
waitUntilQueryDone
:
(
int
*
)
done
timeout
:
(
NSDate
*
)
timeout
processEvents
:
(
BOOL
)
processEvents
{
PerformRequest
(
NULL
);
do
{
[[
NSRunLoop
currentRunLoop
]
runMode
:
WineAppWaitQueryResponseMode
beforeDate
:
timeout
];
if
(
processEvents
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSEvent
*
event
=
[
NSApp
nextEventMatchingMask
:
NSAnyEventMask
untilDate
:
timeout
inMode
:
NSDefaultRunLoopMode
dequeue
:
YES
];
if
(
event
)
[
NSApp
sendEvent
:
event
];
[
pool
release
];
}
else
[[
NSRunLoop
currentRunLoop
]
runMode
:
WineAppWaitQueryResponseMode
beforeDate
:
timeout
];
}
while
(
!*
done
&&
[
timeout
timeIntervalSinceNow
]
>=
0
);
return
*
done
;
...
...
dlls/winemac.drv/cocoa_event.h
View file @
761ad810
...
...
@@ -36,6 +36,7 @@
-
(
void
)
postEvent
:
(
const
macdrv_event
*
)
inEvent
;
-
(
void
)
discardEventsMatchingMask
:(
macdrv_event_mask
)
mask
forWindow
:(
NSWindow
*
)
window
;
-
(
BOOL
)
query
:(
macdrv_query
*
)
query
timeout
:(
NSTimeInterval
)
timeout
processEvents
:(
BOOL
)
processEvents
;
-
(
BOOL
)
query
:(
macdrv_query
*
)
query
timeout
:(
NSTimeInterval
)
timeout
;
@end
...
...
dlls/winemac.drv/cocoa_event.m
View file @
761ad810
...
...
@@ -252,7 +252,7 @@ static NSString* const WineEventQueueThreadDictionaryKey = @"WineEventQueueThrea
[
eventsLock
unlock
];
}
-
(
BOOL
)
query
:
(
macdrv_query
*
)
query
timeout
:
(
NSTimeInterval
)
timeout
-
(
BOOL
)
query
:
(
macdrv_query
*
)
query
timeout
:
(
NSTimeInterval
)
timeout
processEvents
:
(
BOOL
)
processEvents
{
macdrv_event
event
;
NSDate
*
timeoutDate
=
[
NSDate
dateWithTimeIntervalSinceNow
:
timeout
];
...
...
@@ -264,10 +264,15 @@ static NSString* const WineEventQueueThreadDictionaryKey = @"WineEventQueueThrea
query
->
done
=
FALSE
;
[
self
postEvent
:
&
event
];
timedout
=
!
[
NSApp
waitUntilQueryDone
:
&
query
->
done
timeout
:
timeoutDate
];
timedout
=
!
[
NSApp
waitUntilQueryDone
:
&
query
->
done
timeout
:
timeoutDate
processEvents
:
processEvents
];
return
!
timedout
&&
query
->
status
;
}
-
(
BOOL
)
query
:
(
macdrv_query
*
)
query
timeout
:
(
NSTimeInterval
)
timeout
{
return
[
self
query
:
query
timeout
:
timeout
processEvents
:
FALSE
];
}
/***********************************************************************
* OnMainThread
...
...
@@ -470,8 +475,21 @@ void macdrv_set_query_done(macdrv_query *query)
macdrv_retain_query
(
query
);
OnMainThreadAsync
(
^
{
NSEvent
*
event
;
query
->
done
=
TRUE
;
macdrv_release_query
(
query
);
event
=
[
NSEvent
otherEventWithType
:
NSApplicationDefined
location
:
NSZeroPoint
modifierFlags
:
0
timestamp
:
[[
NSProcessInfo
processInfo
]
systemUptime
]
windowNumber
:
0
context
:
nil
subtype
:
WineApplicationEventWakeQuery
data1
:
0
data2
:
0
];
[
NSApp
postEvent
:
event
atStart
:
TRUE
];
});
}
...
...
dlls/winemac.drv/event.c
View file @
761ad810
...
...
@@ -240,7 +240,8 @@ DWORD CDECL macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handle
timeout
,
flags
&
MWMO_ALERTABLE
);
}
if
(
data
->
current_event
)
event_mask
=
0
;
/* don't process nested events */
if
(
data
->
current_event
&&
data
->
current_event
->
type
!=
QUERY_EVENT
)
event_mask
=
0
;
/* don't process nested events */
if
(
process_events
(
data
->
queue
,
event_mask
))
ret
=
count
-
1
;
else
if
(
count
||
timeout
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment