Commit Graph

268 Commits

Author SHA1 Message Date
Alexandre Julliard e4a43cfa1f winemac: Don't try to set the app icon before GDI is properly initialized. 2013-10-24 19:00:10 +02:00
Ken Thomases 35f0cf26b0 winemac: Send WM_CANCELMODE when keyboard layout changes from Cocoa side.
The standard keyboard shortcut for switching the keyboard layout is Command-
Space, but the Mac driver never sees the Space key press.  So, Wine only sees
a press and release of Alt, which puts focus on the menu bar.  This prevents
that focus change.
2013-10-24 10:54:55 +02:00
Ken Thomases 742c48b348 winemac: Disable software GL rendering unless it's enabled via a new registry setting, AllowSoftwareRendering. 2013-10-22 16:37:40 +02:00
Alexandre Julliard 639c202ea7 winemac: Use an init once function to register IME classes. 2013-10-22 10:25:36 +02:00
Alexandre Julliard 5435dad997 winemac: Only register the IME class when needed. 2013-10-21 14:46:25 +02:00
Ken Thomases 3ececfd2a5 winemac: Fix a leak in macdrv_CountClipboardFormats(). (Clang). 2013-10-21 10:46:44 +02:00
Ken Thomases 49197e811b winemac: Rename some confusingly-named variables. 2013-10-21 10:46:33 +02:00
Ken Thomases c7f8e71ab6 winemac: Fix some bytes-vs-WCHARs length computation bugs in the UTF-16 clipboard support. 2013-10-21 10:46:29 +02:00
Ken Thomases 1c049e5031 winemac: Restore app cursor settings when cursor moves back into an app window.
The code had previously set the cursor back to the standard arrow and unhid
it when it left all app windows.  Now it restores the cursor image that the
app set and re-hides it if necessary when it moves back over any app window.
2013-10-18 11:33:32 +02:00
Ken Thomases 8747df094d winemac: Treat mouse moves in a window title bar as outside the window.
Don't queue mouse-moved events.  Reset the cursor.
2013-10-18 11:32:53 +02: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
Kevin Eaves 771fcd894a winemac: Restore the window title when the window style is changed. 2013-10-17 20:29:25 +02:00
Alexandre Julliard 6ae1e33a17 winemac: Clear the thread data explicitly on detach. 2013-10-16 20:49:24 +02:00
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