Commit Graph

354 Commits

Author SHA1 Message Date
Aric Stewart 20daa8b61c winemac: Reposition cursor for IME composition.
It is more natural for the cursor to be at the end of the selection
being composed instead of being at the beginning.
2014-05-24 11:02:08 +09:00
Ken Thomases 451915100a winemac: Add the ability to disable high-resolution scrolling.
The Mac driver can generate scroll wheel events with values which are not integral
multiples of WHEEL_DELTA.  Apps should handle that by scrolling a corresponding
non-integral multiple of what they'd do for a WHEEL_DELTA-valued scroll or, if
they can't, then at least accumulate scroll distance until its magnitude exceeds
WHEEL_DELTA and do a "chunky" scroll.  However, many apps don't do that properly.
They may scroll way too far/fast or even in the opposite direction.

If the registry setting UsePreciseScrolling is set to "n", the Mac driver will do
that accumulation and chunking itself to work around such broken app behavior.
2014-05-15 11:28:52 +02:00
Ken Thomases 757c57634e winemac: Fix a memory leak if posting WM_DROPFILES fails. 2014-05-15 11:28:36 +02:00
Ken Thomases 3bca22a6b9 winemac: Don't bring owned windows to the front when they're clicked.
Cocoa will bring an unowned window to the front of its level when it's clicked,
but it doesn't do that for owned windows.  The old code went out of its way to
make owned windows behave like unowned windows in this respect.  That was
exactly backward.  We wish we could control whether windows are raised on a
click.  We don't have that opportunity for unowned windows, but, by ripping
out a bunch of code, we do for owned windows.
2014-05-08 10:24:31 +02:00
Alexandre Julliard 6a0f3df68c user32: Don't bother returning a value from the SetWindowRgn driver entry point. 2014-05-01 12:31:14 +02:00
Ken Thomases ef4677106a winemac: Disable moving or resizing windows when cursor clipping is in effect.
Many games clip the cursor to the client area of the window.  However, on OS X,
the resizing controls extend into that client area.  So, it's possible that
while playing, the user might unintentionally click in the resizing area and
drag, resizing the window.
2014-04-29 11:22:58 +02:00
Ken Thomases d1f554711f winemac: Send WM_SIZING messages during resizing to let app alter the proposed size. 2014-04-24 11:37:34 +02:00
Ken Thomases b52c89fc91 winemac: For GetKeyNameText(), use the hard-coded table in preference to the Mac keyboard layout. 2014-04-24 11:37:28 +02:00
Hermès Bélusca-Maïto 7a7925c872 winemac.drv: Fix a typo in _MSC_VER. 2014-03-26 19:20:26 +01:00
Ken Thomases fc37ed94d8 winemac: Improve handling of swap interval with respect to pbuffers, clamping to 0. 2014-03-24 11:46:22 +01:00
Ken Thomases 10f50b89c6 winemac: Don't recreate the GL view when the pixel format is set again.
It's not necessary.  Unlike with X11, on Mac OS X the pixel format doesn't affect
the properties of windows and views.  The pixel format is a property of the GL
context, which can attach to any view.
2014-03-24 11:46:16 +01:00
Ken Thomases 15612dd762 winemac: Make the swap interval a property of the window, not the context. 2014-03-21 11:16:58 +01:00
Ken Thomases 5943c58094 winemac: Fix wglSwapBuffers() to operate on the HDC, not the current GL context. 2014-03-21 11:16:54 +01:00
Aric Stewart 7a907f1fd7 imm32: Add IME_CMODE_FULLSHAPE to conversion mode. 2014-03-12 10:42:29 +01:00
Ken Thomases 06f80d6542 winemac: Make the window's contentView its firstResponder again after changing its style. 2014-03-11 19:39:24 +01:00
Aric Stewart eb19c39126 winemac.drv: Improve positioning of IME client window based on caret. 2014-02-20 11:19:46 +01:00
Ken Thomases 0d23637e0d winemac: Ignore window dragging if window is disabled, maximized, minimized, or hidden. 2014-01-29 12:39:00 +01:00
Ken Thomases a86cfc683d winemac: Reset cursor clipping and capture when window dragging begins. 2014-01-29 12:38:56 +01:00
Ken Thomases 70c4f43ed3 winemac: Ignore mouse capture during window drags for routing click and move events. 2014-01-29 12:38:52 +01:00
Ken Thomases ed3ed03519 winemac: Ignore failure to send or 0 result from WM_QUERYENDSESSION if target window was destroyed. 2014-01-17 11:02:46 +01:00
Ken Thomases f4b41eeb17 winemac: Eliminate unused "hdc" field of OpenGL context structure. 2014-01-16 10:55:16 +01:00
Ken Thomases e21192469d winemac: Make WineOpenGLContext hold a strong reference to its view.
Its superclass, NSOpenGLContext, only holds a weak reference.  The view was
sometimes being deallocated before the context was disposed of, resulting in
crashes.
2014-01-14 11:17:40 +01:00
Ken Thomases 2963a2d4ab winemac: Don't remove an OpenGL context from its view if we're only going to re-add it.
If the context is being made current with its existing view, just update it
before making it current.
2014-01-14 11:17:38 +01:00
Ken Thomases 2cc5337940 winemac: Consolidate code paths for clearing the OpenGL context.
We clear it if the context or the view is NULL.  If the context is non-NULL,
we want to disassociate the views of both the current and passed-in contexts,
if they differ.
2014-01-14 11:17:35 +01:00
Ken Thomases d57a99b482 winemac: When setting a view for an OpenGL context and it is latent, clear any existing view. 2014-01-14 11:17:31 +01:00
Ken Thomases 1896396330 winemac: When clearing the OpenGL context, disassociate it from its view. 2014-01-14 11:17:28 +01:00
Ken Thomases c072a4564e winemac: For ChangeDisplaySettingsEx(), if caller didn't specify, prefer non-interlaced and unstretched modes. 2014-01-10 12:05:45 +01:00
Ken Thomases ce5a87b1ef winemac: Simplify display mode code.
When originalDisplayModes has entries, the app is active.  When the app is
active, latentDisplayModes is empty.
2014-01-10 12:05:41 +01:00
Ken Thomases d4d92a759e winemac: Clear the latentDisplayModes instance variable before realizing the latent modes. 2014-01-10 12:05:38 +01:00
Ken Thomases 42a7d7209b winemac: Restore display mode to original in more cases.
We only care if we have changed the mode and we're changing it back to its
original.  Even if the current mode matches the target mode, we may still
need to release the displays and clear the entry from originalDisplayModes.
2014-01-10 12:05:34 +01:00
Ken Thomases 9c65d672a2 winemac: Don't assume the current display mode is the original if we don't have the displays captured.
Another process may have changed the display mode before we queried the
current mode, so we may be seeing a non-original mode.
2014-01-10 12:05:30 +01:00
Ken Thomases fe1c0ab952 winemac: Don't record original display modes when not the active app.
originalDisplayModes should be used when active, empty when inactive.
latentDisplayModes is used when inactive, empty when active.

The count of entries in originalDisplayModes is used to test whether the
process has the displays captured so adding entries when inactive would give
incorrect results.  This could have led us to mistakenly change the display
mode when we don't have the displays captured.
2014-01-10 12:05:25 +01:00
Alexandre Julliard 5e7416e5c8 makefiles: Get rid of the MAKE_DLL_RULES variable. 2014-01-02 12:08:18 +01: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
Ken Thomases 94cfa7799b winemac: For WINDOW_DID_UNMINIMIZE events, don't attempt to restore windows which aren't minimized and visible.
The Win32 window state might have changed while the event was in the queue,
making it obsolete.  Sending WM_SYSCOMMAND/SC_RESTORE might re-show a hidden
window, for example.
2013-12-31 12:31:33 +01:00
Ken Thomases bcde44fb8a winemac: Explicitly unhide the app early when showing windows.
Cocoa would implictly unhide it when we order a window, anyway.  Doing it
early avoids problems from querying -[NSWindow isVisible] while the app is
hidden.  That method returns FALSE even for windows which would be visible
if the app weren't hidden.
2013-12-31 12:31:29 +01:00
Ken Thomases ae47323604 winemac: Track whether our windows would be visible if the process weren't hidden.
The -[NSWindow isVisible] method returns FALSE when the process is hidden,
but that's not what we need to know in some cases.

This fixes full-screen games which minimize their window when they lose
focus.  Command-Tabbing away hides the process.  Because the window was not
visible, the code didn't actually minimize it.  When switching back to the
process, no event was sent to the Wine back-end telling it the window had
been restored, so it never resumed drawing to it.
2013-12-31 12:31:21 +01:00
Ken Thomases 6447e8e75c winemac: Defer adjusting window levels while the process is hidden.
While the process is hidden, it can't get a list of its windows which would
be visible were it not hidden.
2013-12-31 12:31:15 +01:00
Ken Thomases 66736b4ab3 winemac: Implement support for maximizing windows.
The user is prevented from moving or resizing a maximized window.  The zoom
button is still present and enabled for a maximized window but requests that
it be restored rather than simply resizing it, which is what it does for
normal windows.

If a window is not resizable (lacks WS_THICKFRAME) but has a maximize box
(WS_MAXIMIZEBOX), then the zoom button requests that it be maximized rather
than resizing it.
2013-12-30 19:01:50 +01:00
Ken Thomases 0137b07973 winemac: Allow programmatic changes of the window frame even if a window is disabled (prevented from resizing). 2013-12-30 19:01:49 +01:00
Ken Thomases 8876751e93 winemac: Prevent disabled windows from being moved.
This won't be enforced if AllowImmovableWindows=n is set in the registry.
2013-12-30 19:01:48 +01:00
Ken Thomases 5f7b30aee2 winemac: Move some state-based feature adjustment into the -adjustFeaturesForState method. 2013-12-30 19:01:47 +01:00
Ken Thomases 2d1396af32 winemac: Extract some duplicated code to a new perform_window_command() function.
This also changes to posting rather than sending WM_SYSCOMMAND/SC_MINIMIZE.
2013-12-30 19:01:47 +01:00
Ken Thomases 2c6ad1829d winemac: Don't check the state of the SC_MINIMIZE item of the window menu when asked to minimize.
The window menu items are not updated as the window state changes; they only
update when the menu is shown.  So the item state is not a reliable indicator
of whether minimization is allowed.
2013-12-30 19:01:46 +01:00
Frédéric Delanoy f2e1589b34 winemac.drv: Constify a character string. 2013-12-19 17:09:08 +01:00
Ken Thomases 77f0a63b4f winemac: When ClipCursor() is called redundantly, don't warp the cursor or discard mouse move events.
Fixes a problem in some games which repeatedly (re)establish the same cursor
clipping rect, making it exceedingly difficult to move the camera with the
mouse.
2013-12-17 16:53:44 +01:00
Ken Thomases b877885400 winemac: When dragging an undecorated window, keep the title bar vertically within the work area.
In particular, keep the title bar from moving behind the menu bar or Dock (when
it's on the bottom).
2013-12-17 16:53:36 +01:00
Frédéric Delanoy e0b68129fa winemac.drv: Use BOOL type where appropriate. 2013-12-13 12:36:10 +01:00
Ken Thomases f068e329c1 winemac: Send WM_{ENTER, EXIT}SIZEMOVE before/after window dragging and run an internal event loop during.
This simulates some of what would happen if user32 were managing the drag.  The
click in the caption would cause WM_SYSCOMMAND/SC_MOVE.  The processing of that
message is synchronous and doesn't return until the move is complete.

Some games require that "blocking" in the internal event loop to prevent them
from misbehaving during the drag.
2013-12-12 12:06:47 +01:00
Ken Thomases b3cc34e5b0 winemac: While a window is being dragged, suppress mouse events and disable cursor clipping and warping. 2013-12-12 12:06:39 +01:00