Commit Graph

282 Commits

Author SHA1 Message Date
Huw Davies 22008f7fd9 winemac: Update the thread's active_keyboard_layout on keyboard change. 2013-11-20 19:39:01 +01:00
Huw Davies f344d7a213 winemac: Update the layout list if the enabled input sources change. 2013-11-20 19:38:59 +01:00
Huw Davies fecaab9cfd winemac: Implement GetKeyboardLayoutList. 2013-11-20 19:38:56 +01:00
Ken Thomases 3a03dcf097 winemac: Avoid moving owned windows when programmatically moving the owner.
Cocoa normally maintains the relative position of owned windows with respect
to the owner, which differs from Windows.
2013-11-15 12:00:12 +01:00
Ken Thomases 784a91390e winemac: Allow ordering a window into Cocoa's window list even if it's positioned outside of the desktop.
Some programs minimize windows which are outside of the desktop.  The Mac
driver had been leaving such windows ordered out, which prevented them from
minimizing and appearing on the Dock.  That, in turn, made it difficult for
the user to restore them.
2013-11-15 11:59:47 +01:00
Ken Thomases aa53603135 winemac: Reduce duplicated code by consolidating exit paths from format_for_type(). 2013-11-06 15:52:48 +01:00
Ken Thomases 7c0c30b4d6 winemac: Fix search for clipboard format matching a pasteboard type so it can fail when it should.
It had been acting as though the last registered clipboard format always
matched any pasteboard type.
2013-11-06 15:52:45 +01:00
Rico Schüller 2fa9b7ebb5 opengl32: Use opengl xml registry files. 2013-11-05 20:38:21 +01:00
Ken Thomases 8e1fdb845e winemac: Trace flags of WINDOW_FRAME_CHANGED events. 2013-11-01 10:51:27 +01:00
Ken Thomases 83f6470c0e winemac: Convert the QUERY_RESIZE_END query to an event, WINDOW_RESIZE_ENDED.
Queries can be run out of order because the main thread is waiting on the
response.  The main thread didn't really need a response from QUERY_RESIZE_END.
It was only a query for symmetry with QUERY_RESIZE_START.
2013-11-01 10:51:23 +01:00
Ken Thomases de3fb34af7 winemac: Send WM_{ENTER, EXIT}SIZEMOVE around window frame changes initiated by Cocoa.
The Mac driver was already sending these events when the user resizes the
window by dragging its corner/edges, but there are other occasions when the
window frame changes.  For example, when the user zooms the window.
2013-11-01 10:51:11 +01:00
Ken Thomases b11d6850f2 winemac: Tell Cocoa that we don't draw a focus ring for our views.
This seems to eliminate a lot of house-keeping work inside Cocoa.
2013-11-01 10:51:01 +01:00
Ken Thomases 6b9f81271b winemac: Hide cursor when first requested even if we don't know it's over a window.
The tracking of whether it is over a window or not is only updated when the
mouse moves.  If a window was created or moved under it, then the state can be
stale.  That caused us to defer hiding the cursor until the mouse was moved.
This happens at the start of games pretty often.
2013-10-30 15:29:42 +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
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