They shouldn't get a separate space; they should stick with their parent (owner).
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Simply ordering them out leaves the user on the full-screen space, which is now
an empty black screen. Closing the window closes the space, too.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Cocoa doesn't handle the window being ordered out or closed during the
animation well and leaves a ghost window around.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The code had been handling ordering sibling windows relative to each other,
including windows neither of which were child windows. However, it wasn't
properly handling other relationships (e.g. cousins, nieces, uncles, etc.).
The reason this is complicated is that Cocoa keeps child windows in a fixed
relative order to their parent and siblings. The normal -orderWindow:relativeTo:
method doesn't work. One has to remove the children from the parent and re-add
them in the desired order.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Cocoa does this automatically for non-owned windows and informs the back end
via a different mechanism (WINDOW_BROUGHT_FORWARD). However, for owned windows
(child windows in Cocoa parlance), Cocoa does not change their z-order relative
to the owner (parent) or sibling owned windows when clicked. So, we have to
move the window in user32's z-order so that it gets moved appropriately on
screen in response.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Ideally, user32 would adjust its z-order for window activation as happens on
Windows. Then, the Mac driver would just reflect such changes in the Cocoa
windows. But user32 doesn't do that. SetActiveWindow() and SetForegroundWindow()
just adjust focus and status.
This is an attempt to achieve a similar result.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Fixes a problem where the client area view would not be resized as the user
resizes the Cocoa window.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Even if the (un)hidden view doesn't have attached GL contexts itself, its
descendants may. It doesn't make sense not to check them just because this
view doesn't have GL contexts.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
-[NSApplication sendEvent:] seems to consume the event and doesn't pass it along
to the window.
Mac keyboards haven't included a Help key for a long time, but users with PC
keyboards can use the Insert key, which is in the same position. The Mac
driver translates either one to VK_INSERT.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Sierra (macOS 10.12) changed the behavior of key repeat. In previous versions
of macOS, key repeat stops when a modifier key is pressed or released. In
Sierra, it does not; it just keeps repeating as newly-modified.
On Windows, key repeat stops when a modifier key is pressed, although not when
one is released. Some programs depend on this behavior. So, the Mac driver
emulates it.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Hiding a view seems to semi-detach any attached OpenGL contexts such that
rendering no longer works. There's no GL surface for the view. Calling
-[NSOpenGLContext update] is not sufficient to reattach the context. So,
fully detach the contexts and reattach them.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
During a call to GetClipboardData(), the app may be asked to render the data
for a promised format. This will cause us to receive WM_CLIPBOARDUPDATE.
Almost always, the app will have just rendered the requested format and not
made any other changes. Therefore, we don't need to rebuild the Mac pasteboard
from the Win32 clipboard. Doing so can cause a race with the other Mac app
which is querying the pasteboard (for a paste operation, for example). We
basically delete the data we _just_ added and rebuild the list of available
types. The symptom is that the other Mac app sees the available types change
and maybe be incomplete.
In theory, the Windows app could make other changes to the clipboard and this
change would cause us to fail to convey them to the Mac pasteboard. I consider
that very unlikely and the tradeoff to improve the common case is worth it.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
With windows, the Cocoa main thread may have changed the frame and messages to
that effect may be in the queue, so it can be important to reassert the
"current" value and discard those messages. With views, by contrast, Cocoa
will never change the frame on its own and there are no messages to discard.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The skipped code is a no-op for the child window case, except that the call to
set_window_surface() synchronizes with the main thread, even with null arguments.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
There's no reason for them to be synchronous and this improves performance.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Continue exporting in the original format under org.winehq.registered.HTML Format
for fidelity when copying and pasting within Wine.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
If another app grabbed the clipboard, that most likely happened while it was
active and the Wine process was inactive. Our process being made active again
is a good opportunity to check for that.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
When windows aren't full-screen, non-floating windows go in NSNormalWindowLevel
and floating ones go in NSFloatingWindowLevel, which is higher. However, a
non-floating full-screen window will go into a level higher than either of
those. The prior logic of the -adjustWindowLevels: method would keep the
floating windows at a window level at least that high. They should actually
be in a strictly higher level.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This fixes an oversight in commit d91e56863. Some of the views created for
Win32 child windows were being left out of any view hierarchy. OpenGL contexts
attached to such child windows and views were not able to render to screen,
leaving blank areas.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
It would eventually get updated by the keyboard changed event, but
only after the message queue was pumped.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Renamed it to macdrv_get_pasteboard_formats(), since the "copy" was meant to
convey Core Foundation ownership semantics which no longer apply.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
… as is done in user32's and gdi32's version of the same function.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The relevant Mac-native types, public.utf16-plain-text and public.utf8-plain-text,
are handled by CF_UNICODETEXT and user32 handles the synthesis of CF_TEXT and
CF_OEMTEXT from that.
CF_TEXT and CF_OEMTEXT are still exported and imported with a Wine-specific
type to preserve cross-prefix copy/paste fidelity.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The relevant Mac-native type, com.microsoft.bmp, is handled by CF_DIB and
user32 handles the synthesis of CF_BITMAP and CF_DIBV5 from that.
CF_BITMAP and CF_DIBV5 are still exported and imported with a Wine-specific
type to preserve cross-prefix copy/paste fidelity.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
At least one Mac app, TextWrangler, puts UTF-16 data on the pasteboard with
lines separated by CR (although it uses LF for the UTF-8 form of the same text).
Other Mac apps handle it properly; we should, too.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
We had been posting it when exiting fullscreen mode ended. However, certain
events during exiting could provoke the back-end to assert the window frame as
it knows it, which would be the one from full-screen mode. This would be
handled by the Cocoa thread after exiting full-screen mode. So, the window
would animate to its pre-fullscreen frame and then spontaneously go back to
covering the screen. This would be Windows-style fullscreen rather than
Cocoa-style and there'd be no obvious way to get out.
The problem occurs on macOS 10.12 (Sierra) due to a change in what methods it
calls on the window while exiting fullscreen.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>