Commit Graph

28 Commits

Author SHA1 Message Date
Brendan Shanks 7aa2601f94 winemac.drv: Fix warnings for constants deprecated by macOS 10.12.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-27 23:28:16 +02:00
Ken Thomases af2690ab06 winemac: Add a category on NSEvent to simplify checking if the Command key (and only that modifier) is pressed for an event.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-24 20:31:50 +02:00
Ken Thomases 1c94bf396f winemac: Add support for a high-resolution ("Retina") rendering mode.
When this Retina mode is enabled and the primary display is in the user's
default configuration, Wine gets told that screen and window sizes and mouse
coordinates are twice what Cocoa reports them as in its virtual coordinate
system ("points").  The Windows apps then renders at that high resolution and
the Mac driver blits it to screen.  If the screen is actually a Retina display
in a high-DPI mode, then this extra detail will be preserved.  Otherwise, the
rendering will be downsampled and blurry.

This is intended to be combined with increasing the Windows DPI, as via winecfg.
If that is doubled to 192, then, in theory, graphical elements will remain the
same visual size on screen but be rendered with finer detail.  Unfortunately,
many Windows programs don't correctly handle non-standard DPI so the results
are not always perfect.

The registry setting to enable Retina mode is:

[HKEY_CURRENT_USER\Software\Wine\Mac Driver]
"RetinaMode"="y"

Note that this setting is not looked for in the AppDefaults\<exe name> key
because it doesn't make sense for only some processes in a Wine session to see
the high-resolution sizes and coordinates.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-06 11:45:24 +09:00
Ken Thomases 33610da6b4 winemac: Don't process QUERY_IME_CHAR_RECT while waiting in OnMainThread().
Most queries are handled even by threads which are otherwise blocked in
OnMainThread().  There's a problem with QUERY_IME_CHAR_RECT, though, in that it
can be handled before a previously-queued IM_SET_TEXT event, in which case its
character range may be out of bounds.  Some apps (e.g. Excel 2007) hang due to
the bad range.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-05 13:53:36 +09:00
Ken Thomases a1a93ce193 winemac: Change the processEvents parameter of -[WineEventQueue query:timeout:processEvents:] to a flags bitmask.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-05 13:53:22 +09:00
Charles Davis a872c21a48 winemac.drv: Always initialize a closure-captured object pointer. 2015-02-02 22:27:42 +09:00
Ken Thomases 9d1cfecc6d winemac: When removing the status item for a systray icon, discard any associated events in the queue. 2014-08-06 14:27:29 +02:00
Ken Thomases 4f9de6bcdf winemac: More thoroughly discard events which have been obsoleted by subsequent Wine- or program-driven changes.
Among other things, this fixes Syberia 2.  That game shows, hides, and then
shows its window.  Hiding it caused a WINDOW_LOST_FOCUS event to be queued.
By the time it was processed, the window was the foreground window again.
In response to being told it had lost focus, the game minimized its window.

Hiding the window should have prevented or discarded the WINDOW_LOST_FOCUS
event since the change was driven from Wine and the Win32 foreground/active
window state would already be correct.  In addition, when the program
re-showed its window and made it foreground, that should have discarded the
event as being out of date.  Now they do.
2013-12-31 12:31:39 +01:00
Huw Davies 22008f7fd9 winemac: Update the thread's active_keyboard_layout on keyboard change. 2013-11-20 19:39:01 +01:00
Ken Thomases 2f68e47167 winemac: Don't use the main dispatch queue to implement OnMainThread() for a thread with no event queue.
The main dispatch queue is a serial queue and is a shared resource.  If we
submit a long-running task to it, then no other tasks, including those submitted
by the system frameworks, can run until it completes.
2013-10-30 15:29:33 +01:00
Ken Thomases 761092a2fe winemac: Clean up fully-delivered events in queues which aren't being drained.
Some events get queued for all GUI-connected threads but are only processed
by the first to dequeue them.  Other threads which tend their event queue
discard such already-processed events.  However, some threads may be
connected to the GUI but never tend their event queue.  To prevent such
threads from accumulating zombie events, the zombies are cleared each time a
new event is queued.
2013-10-18 11:32:37 +02:00
Ken Thomases 9deb00bfdc winemac: Don't coalesce events which might be in multiple queues. 2013-10-18 11:32:23 +02:00
Ken Thomases 6bae7cf796 winemac: Implement support for global hot keys.
Partially based on a patch for winex11 previously submitted by Vincent Povirk.
2013-09-27 10:41:05 +02:00
Ken Thomases 3eee56668a winemac: Mouse drags don't imply anything about z-order of target window because of implicit capture. 2013-05-07 11:20:11 +02:00
Ken Thomases 51129752bc winemac: For SetCursorPos(), reset positions of pending mouse button and scroll events.
They are effectively deemed to have happened after the SetCursorPos().
2013-04-26 11:48:53 +02:00
Ken Thomases 192b8dbf9d winemac: Implement an IME that uses the OS X input methods.
Developed with Aric Stewart.
2013-04-22 12:37:50 +02:00
Ken Thomases e7d5f329e5 winemac: Refactor WineApplication class to separate most logic into a controller class. 2013-04-16 12:10:36 +02:00
Ken Thomases ca2d7140fb winemac: Add a delivery limit to events.
Some events are application-wide, not specific to a thread.  Such an event
needs to be broadcast to all GUI-attached threads because we don't know which
are handling events, but we don't want the event to be processed in each.
Often it should only be processed by the first to pull it from its queue.
2013-04-04 12:14:56 +02:00
Ken Thomases 1ee93853c2 winemac: Make macdrv_event structs heap-allocated and reference-counted. 2013-04-04 12:14:33 +02:00
Ken Thomases 5dac8a90cc winemac: Drain the autorelease pool within loop in OnMainThread(). 2013-04-04 12:13:38 +02:00
Ken Thomases 7993bd3d90 winemac: Implement support for drag-and-drop. 2013-03-14 12:03:32 +01:00
Ken Thomases 761ad810d9 winemac: Allow for processing Cocoa events while waiting for query results. 2013-03-14 12:02:28 +01:00
Ken Thomases 449e2655c2 winemac: Add support for delay-rendered (a.k.a. promised) clipboard data. 2013-03-11 10:53:38 +01:00
Ken Thomases 69e631e04e winemac: Add support for "query" events which wait for synchronous responses. 2013-03-11 10:53:32 +01:00
Ken Thomases 572324bae3 winemac: Implement MOUSE_MOVED(_ABSOLUTE) events. 2013-02-07 12:04:49 +01:00
Ken Thomases d0e1a02515 winemac: Rebuild key map when Mac keyboard layout changes. 2013-02-05 11:06:27 +01:00
Ken Thomases 7863a230ec winemac: Implement a WINDOW_GOT_FOCUS event for when Cocoa tries to focus a window. 2013-01-28 14:03:40 +01:00
Ken Thomases 3c995bb682 winemac: Add WineEventQueue class for conveying events from Cocoa to Wine threads. 2013-01-21 12:51:17 +01:00