Commit Graph

120 Commits

Author SHA1 Message Date
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
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
Frédéric Delanoy 69d35a01cf winemac.drv: Use BOOL type where appropriate. 2013-11-29 13:32:44 +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
Ken Thomases f6a8c5b50e winemac: Take WS_EX_TOOLWINDOW into account when computing how much of a window is replaced by the Mac decorations. 2013-11-21 19:39:01 +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 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
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 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 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 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 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 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 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 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 315b39ec8d winemac: Skip minimized windows when looking for z-ordering neighbor. 2013-08-30 11:18:11 +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
Ken Thomases 47337ed14c winemac: Make a file-scope variable static. 2013-08-01 11:42:32 +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 92a67d4259 winemac: Don't complain that WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS is unrecognized. 2013-06-20 11:29:58 +02:00
Ken Thomases e635952459 winemac: Actually switch Win32 focus away from a window that has lost Cocoa focus. 2013-06-07 11:57:50 +02:00
Ken Thomases a6dc4906de winemac: Ignore window frame changes while minimized but check again when unminimized. 2013-06-04 15:01:15 +02:00
Ken Thomases b15f412e14 winemac: Allow Cocoa to make minimized windows key; it will unminimize them as necessary. 2013-06-04 15:01:08 +02:00
Ken Thomases f010a930df winemac: Improve the debug tracing in macdrv_SetWindowStyle(). 2013-06-04 15:01:03 +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
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 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 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 3f3ee6393d winemac: Implement OpenGL support. 2013-03-06 12:56:12 +01:00
Ken Thomases 6cfa0a31d8 winemac: Don't bring a window onto the screen in SetFocus(). 2013-02-19 10:40:12 +01:00
Ken Thomases 1561fa4126 winemac: Call sync_window_position() before show_window() since window frame affects whether it shows. 2013-02-19 10:40:08 +01:00
Ken Thomases abb0161c4c winemac: Always use proper z-order when putting a window on screen. 2013-02-19 10:40:03 +01:00
Ken Thomases bc75a9baff winemac: Implement DISPLAYS_CHANGED event for when display configuration has changed. 2013-02-18 10:34:55 +01:00
Ken Thomases 3799acb3ac winemac: Use only on-screen windows for Cocoa parent (Win32 owner) and ordering sibling. 2013-02-18 10:34:33 +01:00
Ken Thomases 5f06bf80db winemac: Implement SysCommand() to prevent Alt keypresses from activating system menu. 2013-02-07 12:04:42 +01:00
Alexandre Julliard e1b6dc57ac winemac: Don't move off-screen windows to a random position. 2013-02-05 20:15:34 +01:00
Ken Thomases 3ab66a6916 winemac: Implement ToUnicodeEx(). 2013-02-05 11:07:19 +01:00
Ken Thomases 8a0c8d9264 winemac: Implement support for minimizing windows. 2013-02-05 11:05:23 +01:00
Ken Thomases b564d97229 winemac: Implement an APP_DEACTIVATED event. 2013-01-28 14:03:51 +01:00
Ken Thomases 3c5973139f winemac: Implement a WINDOW_LOST_FOCUS event. 2013-01-28 14:03:45 +01:00
Ken Thomases 7863a230ec winemac: Implement a WINDOW_GOT_FOCUS event for when Cocoa tries to focus a window. 2013-01-28 14:03:40 +01:00
Ken Thomases 6cde62ac18 winemac: Take control over when a window can become focused away from Cocoa. 2013-01-28 14:03:18 +01:00
Ken Thomases 6e59740e18 winemac: Implement WINDOW_FRAME_CHANGED event to tell Wine when window is moved or resized. 2013-01-28 14:00:49 +01:00
Ken Thomases ed367c504d winemac: Implement a WINDOW_CLOSE_REQUESTED event to allow closing windows. 2013-01-21 12:51:19 +01:00
Ken Thomases 177b67e6bd winemac: Make each Mac driver window track the HWND it's associated with. 2013-01-21 12:51:18 +01:00
Ken Thomases 207c4d193f winemac: Associate an event queue with each thread that creates windows and with each window. 2013-01-21 12:51:17 +01:00
Ken Thomases c0d43fb51f winemac: Implement layered windows: SetLayeredWindowAttributes() and UpdateLayeredWindow(). 2013-01-15 12:17:02 +01:00
Ken Thomases 2d4bcc47be winemac: Implement SetWindowRgn. 2013-01-15 12:16:52 +01:00
Ken Thomases 7d6ebfa742 winemac: Implement window surface rendering. 2013-01-15 12:16:44 +01:00
Ken Thomases 15d4b2ab51 winemac: Translate presence in Windows task bar to participation in Exposé and window cycling. 2013-01-11 18:14:08 +01:00
Ken Thomases b6544d19dd winemac: Implement support for owned windows. 2013-01-11 18:14:07 +01:00
Ken Thomases 429732ce1a winemac: Implement support for WS_EX_TOPMOST windows. 2013-01-11 18:14:07 +01:00
Ken Thomases 9d29ea42e1 winemac: Implement support for no-activate windows. 2013-01-11 18:14:07 +01:00
Ken Thomases 064186e739 winemac: Implement support for WS_DISABLED windows. 2013-01-11 18:14:07 +01:00
Ken Thomases 8da2cb1698 winemac: Implement basic window functionality. 2013-01-09 17:39:38 +01:00
Ken Thomases bbb8c60c7e winemac: Implement CreateDesktopWindow(). 2013-01-08 12:50:20 +01:00