Commit Graph

254 Commits

Author SHA1 Message Date
Ken Thomases f4f50c9e4a winemac: Implement support for Cocoa-style full-screen mode.
Based in large part on a patch submitted by Kevin Eaves.
2013-10-11 11:04:53 +02:00
Ken Thomases 79d45585bc winemac: Add registry settings to make Option keys send Alt rather than accessing additional characters from the keyboard layout. 2013-10-10 10:45:22 +02:00
Ken Thomases 05e3d0e5cc winemac: Make sure the same housekeeping is done when closing a window as is done when hiding it. 2013-10-10 10:45:13 +02:00
Frédéric Delanoy 510e30bd63 winemac.drv: Use BOOL type where appropriate. 2013-10-09 10:08:34 +02:00
Ken Thomases c043587d56 winemac: Tell Wine when Cocoa has brought a window to the front. 2013-10-08 15:39:01 +02:00
Ken Thomases 9779f0ace4 winemac: If the app doesn't specify a custom max. tracking size, don't restrict Cocoa. 2013-10-08 15:39:01 +02:00
Ken Thomases 4d9340eb41 winemac: Update the window min/max size info and enforce it when zooming. 2013-10-08 15:39:01 +02:00
Ken Thomases bdcb8138fe winemac: Don't accidentally clear Cocoa window style mask bits. 2013-10-08 15:39:01 +02:00
Ken Thomases dd59ab26fe winemac: Only update window minimized state when it has changed from what processed events told us it was.
This fixes a problem where windows could spontaneously re-minimize after
being unminimized.  Cocoa would see the window unminimize.  It would queue
a WINDOW_DID_UNMINIMIZE event.  While that event was pending, Wine might do
something which caused set_cocoa_window_properties() to be called and tell
Cocoa to conform itself to the current Win32 state.  The current Win32 state
still had the window minimized, so Cocoa would re-minimize the window.  It
would even discard the WINDOW_DID_UNMINIMIZE event.
2013-10-08 15:39:01 +02:00
Ken Thomases 0e8e45cf99 winemac: Use unsigned type for bitfields. 2013-10-08 15:39:01 +02:00
Ken Thomases 1186c36c89 winemac: Make clicking on the app's dock icon unminimize a window if there are only minimized windows.
Cocoa would automatically do this for a normal app.  However, the Mac driver
makes all of its windows inherit from NSPanel and Cocoa ignores panels for
this feature.
2013-10-04 12:45:56 +02:00
Ken Thomases 63fe00eae7 winemac: Allow zero-sized windows to be selected from the Mac Window menu.
They show up in the taskbar on Windows 7.  Selecting them from there is
meaningful and useful, as is selecting them from the Window menu.

In addition to just switching among windows from that menu, this is also
important to recovering a minimized window if the user has configured their
system preferences to minimize windows into the process's dock icon (rather
than as separate dock icons).
2013-10-04 12:45:52 +02:00
Ken Thomases b7709771d1 winemac: Reapply display modes when switching back to app after "escaping" with Command-Tab.
The Mac driver captures the displays when the program changes the display
mode.  If the user types Command-Tab to switch away, it resets the displays
to their original modes and releases them.  However, if they switched back,
it didn't restore the mode to what the program had set, so the program often
showed the game window in a corner of the screen with the top behind the Mac
menu bar.
2013-10-02 11:00:36 +02:00
Ken Thomases 7c55e912da winemac: Remove a too-early attempt to set the process's Dock icon. 2013-10-01 23:05:08 +02:00
Ken Thomases 54291ad3d1 winemac: Let Wine always drive window minimization; Cocoa just requests it. 2013-09-30 20:36:34 +02:00
Frédéric Delanoy 66a95f6d45 winemac.drv: Use BOOL type where appropriate. 2013-09-30 20:35:02 +02:00
Ken Thomases 12e0b0577c winemac: Activate an app if it sets focus on a window shortly after a hot key is pressed.
The Mac driver doesn't normally steal focus, but a press of a hot key counts
as the user giving permission.
2013-09-27 10:41:17 +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 5a859655d7 winemac: Re-sync the window region whenever factors affecting its conversion to Cocoa coordinates change. 2013-09-27 10:39:22 +02:00
Ken Thomases d7f4d67514 winemac: Fix hiding windows that are minimized using -close instead of -orderOut:.
Cocoa won't order a minimized window out of the screen list using -orderOut:.
This leaves a window that should be hidden still visible in the Dock, where
it can be unminimized.
2013-09-27 10:39:13 +02:00
Ken Thomases 4e0e9ca84a winemac: When programmatically focusing a window, don't generate WINDOW_LOST_FOCUS event for previously focused window.
That event can confuse things if the program switches focus from A to B and
then back to A and then processes events.  It will get an event saying that
A lost focus in Cocoa, check that A does indeed have current focus in Wine,
and so switch focus away from it (to the desktop window).  (It then gets an
event that B lost focus, but that does nothing at that point.)
2013-09-26 20:05:41 +02:00
Michael Stefaniuc 3a13dc5995 winemac.drv: Avoid using CONST. 2013-09-24 12:58:00 +02:00
Ken Thomases 018d629b3c winemac: Use NSMouseInRect() instead of NSPointInRect() to compensate for Cocoa's off-by-one coordinate system.
This matches what Cocoa does when determining how to handle an event so that,
for example, our test if a click is in the window grow box corresponds to
whether Cocoa will run an internal mouse-tracking loop to resize the window
when we pass it the event.  This fixes a problem where both Cocoa and user32
would try to run a resize loop and the cursor would get "stuck" resizing the
window after the button was released.
2013-09-19 09:30:18 +02:00
Ken Thomases 4ad9d5f04a winemac: Send WM_ENTER/EXITSIZEMOVE messages at start/end of a resizing operation. 2013-09-18 22:23:09 +02:00
Ken Thomases d55d2ec85a winemac: Move memory management of liveResizeDisplayTimer into property setter. 2013-09-18 22:23:09 +02:00
Ken Thomases a3197b8ad0 winemac: At the start of a resize operation, get window min/max size info and pass it to Cocoa. 2013-09-18 22:23:09 +02:00
Ken Thomases 53036b6917 winemac: Trace the pixel format in DescribePixelFormat(). 2013-09-12 11:08:23 +02:00
Ken Thomases a300efc852 winemac: Return failure from DescribePixelFormat() for invalid pixel format.
Also use the proper function for checking the format and looking up the
internal format description.
2013-09-12 11:08:19 +02:00
Ken Thomases d33a4da5ed winemac: Restrict DescribePixelFormat() to displayable pixel formats. 2013-09-12 11:07:58 +02:00
Ken Thomases ae2ce18fd6 winemac: Don't allow dead-key state to repeat after characters are generated.
It's fairly common in Mac keyboard layouts that, if you type a dead key twice,
the second key press will both produce a non-dead character and also
perpetuate the dead-key state.  For example, with the U.S. layout, Option-E,
E will produce "" and Option-E, Option-E, E will produce "".  Windows
keyboard layouts don't tend to do this.  The second key press produces the
non-dead character and clears the dead-key state.
2013-09-10 11:07:41 +02:00
Ken Thomases 7ed00f6d97 winemac: Add support for mouse-move and right- and middle-click events on systray icons in the Mac status bar. 2013-09-06 11:59:13 +02:00
Ken Thomases 675b052572 winemac: When ordering sibling child windows, don't remove and re-add ones already in the right order. 2013-09-03 16:58:15 +02:00
Ken Thomases 987309e528 winemac: Don't use Cocoa parent-child relationship when topmost state is enough to keep owned in front of owner.
The Cocoa parent-child relationship has undesirable side effects and bugs.  In
the general case, it's the only way to maintain the z-order of owned windows
relative to their owner.  But when the owner is non-topmost and an owned
window is topmost, the Cocoa window level will enforce that and we don't
need it.
2013-09-03 16:58:15 +02:00
Ken Thomases fad48773f6 winemac: A window is ineligible to be a Cocoa parent or child while minimized. 2013-08-30 11:18:38 +02:00
Ken Thomases 84903c5db3 winemac: Track latent child windows (the inverse of the latent parent window relationship).
This allows the relationship to be restored when the window becomes eligible
again.
2013-08-30 11:18:35 +02:00
Ken Thomases a68d0a24ef winemac: When a window becomes ineligible to be a parent, make the relationship latent in its children, too. 2013-08-30 11:18:30 +02:00
Ken Thomases 029bcf97dd winemac: Clear latent parent on window close to break potential retain cycle. 2013-08-30 11:18:27 +02:00
Ken Thomases 512237ebe6 winemac: Consolidate the code for managing the Cocoa parent/child window relationship. 2013-08-30 11:18:23 +02:00
Ken Thomases 6873c3ee66 winemac: Make -setMacDrvParentWindow: do nothing if new parent is same as latent parent. 2013-08-30 11:18:18 +02:00
Ken Thomases 4b2f4eb600 winemac: Remove some duplicated code from -makeKeyAndOrderFront:. 2013-08-30 11:18:15 +02:00
Ken Thomases 315b39ec8d winemac: Skip minimized windows when looking for z-ordering neighbor. 2013-08-30 11:18:11 +02:00
Ken Thomases b550ee8d59 winemac: On click, don't reorder Cocoa child window after siblings of higher level.
It may be necessary to reorder to some extent because the clicked window is
behind a sibling at the same level, but that shouldn't move it later in the
list than higher-level siblings.

Cocoa gets buggy if the list of child windows isn't in z-order.
2013-08-30 11:18:07 +02:00
Ken Thomases d14f787192 winemac: Don't reorder clicked window relative to sibling owned windows if it's in the right place.
The right place may not be the end of the list of Cocoa child windows if some
of the siblings are at a higher window level (i.e. floating if the clicked
window is not).
2013-08-30 11:17:56 +02:00
Ken Thomases 1b9fac3b3d winemac: Don't generate scroll wheel events for axes with 0 delta. 2013-08-27 11:50:52 +02:00
Ken Thomases b755674df3 winemac: Don't unminimize a window for SetFocus(). 2013-08-27 11:50:52 +02:00
Charles Davis a157c7bd81 winemac.drv: Support the public UTF-16 type for Unicode text. 2013-08-22 22:06:43 +02:00
Ken Thomases 251160fef9 winemac: Always trace arguments in macdrv_ShowWindow(). 2013-08-21 12:13:56 +02:00
Ken Thomases 121eb08bae winemac: Improve tracing in sync_window_position() to include adjusted frame. 2013-08-21 12:13:56 +02:00
Ken Thomases d6624ee9f6 winemac: Remove a redundant memset of a struct. 2013-08-21 12:13:56 +02:00
Ken Thomases 20c3c80257 winemac: Create 1x1 Cocoa window with empty shape for zero-sized Win32 window. 2013-08-21 12:13:55 +02:00