Commit Graph

75 Commits

Author SHA1 Message Date
Ken Thomases 9372af77a5 winemac: Queue an event to reassert the WinAPI window position before Cocoa adjusts its position for a display change.
When the display mode changes such that the screen height changes, we'd like
our windows to keep their position relative to the top-left of the primary
screen.  That's how WinAPI's coordinate system works and we want the WinAPI
position of the window to not change just because the display mode changed.

Unfortunately that's not achievable in Cocoa.  Cocoa keeps the window
stationary relative to the screen it's on, not necessarily the primary screen,
and it's sometimes relative to the bottom-left and sometimes the top-left of
that screen.

So, what we do instead is queue an event to get the back end to reassert the
WinAPI position of the window.  This is queued before Cocoa can adjust the
Cocoa position of the window which would queue a WINDOW_FRAME_CHANGED to the
back end and mess up the WinAPI position.  The back end's reassertion of the
WinAPI position won't be processed by the Cocoa thread until after Cocoa has
adjusted the position and will thus override it.  It will also discard any
wrong WINDOW_FRAME_CHANGED that may have been queued.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
2015-10-06 17:21:01 +09:00
Ken Thomases 0c395c24e3 winemac: Remove extraneous CDECL attribute. 2015-06-05 14:10:12 +09:00
Ken Thomases 8d581d0e48 winemac: Allow the user to attempt to resize a maximized window and try to restore it if they do.
OS X doesn't have the same concept of maximized windows as Windows does.
There's no mode that prevents a normally-resizable window from being resized.
If a window is "zoomed", it mostly fills the screen but the user can still
move or resize it, at which point it ceases to be in the zoomed state.  So,
users are confused and frustrated when they can't resize a window that's
maximized.

To get similar behavior while still respecting Win32 semantics, we now let the
user try to resize maximized windows.  (The resize cursors are shown at the
edges of the window frame.)  When they start, a request is submitted to the app
to restore the window.  Unless and until the window is restored, we don't
actually allow the window to change its size.

The user expects to resize the window from its current (maximized) position.
It should not jump to its normal position upon being restored.  So, we set the
window's normal position to its current position before restoring it.
2015-03-24 13:55:18 +09:00
Ken Thomases 50cd5b6a57 winemac: Fix conversion of empty RECT to an empty CGRect.
For some empty RECTs, such as { INT_MAX, INT_MAX, INT_MIN, INT_MIN }, right
minus left or bottom minus top underflow and wrap around to positive values.
2015-01-20 11:10:36 +01: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 15612dd762 winemac: Make the swap interval a property of the window, not the context. 2014-03-21 11:16:58 +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 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
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 788e2034f6 winemac: Add support for a "Decorated" registry setting to control whether windows get Mac-style decorations. 2013-11-22 13:57:28 +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 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 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 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 c043587d56 winemac: Tell Wine when Cocoa has brought a window to the front. 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 0e8e45cf99 winemac: Use unsigned type for bitfields. 2013-10-08 15:39:01 +02:00
Ken Thomases 54291ad3d1 winemac: Let Wine always drive window minimization; Cocoa just requests it. 2013-09-30 20:36:34 +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 4ad9d5f04a winemac: Send WM_ENTER/EXITSIZEMOVE messages at start/end of a resizing operation. 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 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 87dd13150a winemac: Make cgrect_from_rect() preserve origin of empty rectangles. 2013-08-21 12:13:55 +02:00
Ken Thomases 4f23821f08 winemac: Add registry setting to control setting display gamma ramp. 2013-07-09 10:28:43 +02:00
Ken Thomases 9e878cb92c winemac: Add registry setting to disable vertical sync. 2013-07-02 10:07:57 +02:00
Ken Thomases b7c7d09470 winemac: Add registry setting to control glFlush() skipping for single-buffer contexts and disable it by default. 2013-07-02 10:05:35 +02:00
Ken Thomases 1d10457aee winemac: Also activate if a window is ordered front shortly after tray icon clicked.
... in addition to if one is focused.
2013-06-20 11:30:16 +02:00
Ken Thomases f57db8a3de winemac: Keep old window surface for minimized windows to allow redrawing.
This improves the animation of the window unminimizing from the Dock in some
cases.  The window would often be blank or, for shaped windows, invisible
during that animation.
2013-06-04 15:00:59 +02:00
Aric Stewart c6d307533b macdrv: Rework the way we handle cursor position and composition text. 2013-05-30 20:19:34 +02:00
Ken Thomases 939d9a906f winemac: Improve positioning of input method candidate window. 2013-05-17 12:14:51 +02:00
Ken Thomases 1a697e15b9 winemac: Implement SetCapture(). 2013-05-07 11:20:32 +02:00
Ken Thomases 1c7a2ba33b winemac: If an app opens a window shortly after its systray icon is clicked, activate it.
The Mac driver doesn't normally steal focus, but a click on the systray icon
counts as the user giving permission.
2013-04-25 11:44:42 +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 c2bbdc4b86 winemac: Clip surface drawn region to new visible rect on window resize.
This prevents stale drawing from being revealed if the window later grows.
2013-04-05 11:57:32 +02:00
Ken Thomases fd1e187ac7 winemac: Handle a Cocoa quit request as a single-process session shutdown.
This lets programs ask the user to save documents, etc., and possibly cancel
the quit.
2013-04-04 12:16:31 +02:00
Ken Thomases b55d7aae10 winemac: Constify some macdrv_event pointer parameters. 2013-04-04 12:13:45 +02:00
Ken Thomases a767ee99fa winemac: Track drawn surface region to reduce black flicker for new or resized windows. 2013-03-29 17:17:22 +01:00
Ken Thomases 4ec2809e73 winemac: Keep stable surface for layered windows using UpdateLayeredWindow(). 2013-03-26 16:40:23 +01:00
Ken Thomases e633f79f61 winemac: Implement GetDeviceGammaRamp() and SetDeviceGammaRamp(). 2013-03-26 12:07:03 +01:00
Ken Thomases 9714e6ee63 winemac: Implement rudimentary support for system tray icons as Mac status items. 2013-03-25 14:02:56 +01:00
Ken Thomases b1de532393 winemac: Set application Dock icon from first icon resource in process's .exe file. 2013-03-25 14:01:04 +01:00
Ken Thomases 462721a115 winemac: Move create_cgimage_from_icon_bitmaps() into new module, image.c. 2013-03-25 14:01:01 +01:00
Ken Thomases 7993bd3d90 winemac: Implement support for drag-and-drop. 2013-03-14 12:03:32 +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 6b2b3e69f7 winemac: Implement CountClipboardFormats() with support for text formats. 2013-03-11 10:52:59 +01:00
Ken Thomases 3f3ee6393d winemac: Implement OpenGL support. 2013-03-06 12:56:12 +01:00