Module: wine
Branch: master
Commit: 9372af77a546609b703070d60ef773d5ae7c2ddd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9372af77a546609b703070d60…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Mon Oct 5 15:44:28 2015 -0500
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(a)codeweavers.com>
---
dlls/winemac.drv/cocoa_window.m | 37 +++++++++++++++++++++++++++++++++++++
dlls/winemac.drv/event.c | 5 +++++
dlls/winemac.drv/macdrv.h | 1 +
dlls/winemac.drv/macdrv_cocoa.h | 1 +
dlls/winemac.drv/window.c | 24 ++++++++++++++++++------
5 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 4ac03a7..35488b0 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -150,6 +150,11 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
}
+@interface NSWindow (WineAccessPrivateMethods)
+ - (id) _displayChanged;
+@end
+
+
@interface WineContentView : NSView <NSTextInputClient>
{
NSMutableArray* glContexts;
@@ -1593,6 +1598,38 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
return frameRect;
}
+ // This private method of NSWindow is called as Cocoa reacts to the display
+ // configuration changing. Among other things, it adjusts the window's
+ // frame based on how the screen(s) changed size. That tells Wine that the
+ // window has been moved. We don't want that. Rather, we want to make
+ // sure that the WinAPI notion of the window position is maintained/
+ // restored, possibly undoing or overriding Cocoa's adjustment.
+ //
+ // So, we queue a REASSERT_WINDOW_POSITION event to the back end before
+ // Cocoa has a chance to adjust the frame, thus preceding any resulting
+ // WINDOW_FRAME_CHANGED event that may get queued. The back end will
+ // reassert its notion of the position. That call won't get processed
+ // until after this method returns, so it will override whatever this
+ // method does to the window position. It will also discard any pending
+ // WINDOW_FRAME_CHANGED events.
+ //
+ // Unfortunately, the only way I've found to know when Cocoa is _about to_
+ // adjust the window's position due to a display change is to hook into
+ // this private method. This private method has remained stable from 10.6
+ // through 10.11. If it does change, the most likely thing is that it
+ // will be removed and no longer called and this fix will simply stop
+ // working. The only real danger would be if Apple changed the return type
+ // to a struct or floating-point type, which would change the calling
+ // convention.
+ - (id) _displayChanged
+ {
+ macdrv_event* event = macdrv_create_event(REASSERT_WINDOW_POSITION, self);
+ [queue postEvent:event];
+ macdrv_release_event(event);
+
+ return [super _displayChanged];
+ }
+
- (BOOL) isExcludedFromWindowsMenu
{
return !([self collectionBehavior] & NSWindowCollectionBehaviorParticipatesInCycle);
diff --git a/dlls/winemac.drv/event.c b/dlls/winemac.drv/event.c
index 58b507c..785bc0a 100644
--- a/dlls/winemac.drv/event.c
+++ b/dlls/winemac.drv/event.c
@@ -45,6 +45,7 @@ static const char *dbgstr_event(int type)
"MOUSE_MOVED_ABSOLUTE",
"MOUSE_SCROLL",
"QUERY_EVENT",
+ "REASSERT_WINDOW_POSITION",
"RELEASE_CAPTURE",
"STATUS_ITEM_MOUSE_BUTTON",
"STATUS_ITEM_MOUSE_MOVE",
@@ -115,6 +116,7 @@ static macdrv_event_mask get_event_mask(DWORD mask)
if (mask & QS_SENDMESSAGE)
{
event_mask |= event_mask_for_type(QUERY_EVENT);
+ event_mask |= event_mask_for_type(REASSERT_WINDOW_POSITION);
event_mask |= event_mask_for_type(RELEASE_CAPTURE);
event_mask |= event_mask_for_type(WINDOW_BROUGHT_FORWARD);
event_mask |= event_mask_for_type(WINDOW_CLOSE_REQUESTED);
@@ -237,6 +239,9 @@ void macdrv_handle_event(const macdrv_event *event)
case QUERY_EVENT:
macdrv_query_event(hwnd, event);
break;
+ case REASSERT_WINDOW_POSITION:
+ macdrv_reassert_window_position(hwnd);
+ break;
case RELEASE_CAPTURE:
macdrv_release_capture(hwnd, event);
break;
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index a31d7e3..44b79ac 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -175,6 +175,7 @@ extern void macdrv_window_resize_ended(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_restore_requested(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_window_drag_begin(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_window_drag_end(HWND hwnd) DECLSPEC_HIDDEN;
+extern void macdrv_reassert_window_position(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL query_resize_size(HWND hwnd, macdrv_query *query) DECLSPEC_HIDDEN;
extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN;
diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h
index d5e3f46..2385097 100644
--- a/dlls/winemac.drv/macdrv_cocoa.h
+++ b/dlls/winemac.drv/macdrv_cocoa.h
@@ -195,6 +195,7 @@ enum {
MOUSE_MOVED_ABSOLUTE,
MOUSE_SCROLL,
QUERY_EVENT,
+ REASSERT_WINDOW_POSITION,
RELEASE_CAPTURE,
STATUS_ITEM_MOUSE_BUTTON,
STATUS_ITEM_MOUSE_MOVE,
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 9d996ec..a48ac17 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -1682,12 +1682,7 @@ LRESULT CDECL macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
macdrv_reset_device_metrics();
return 0;
case WM_MACDRV_DISPLAYCHANGE:
- if ((data = get_win_data(hwnd)))
- {
- if (data->cocoa_window && data->on_screen)
- sync_window_position(data, SWP_NOZORDER | SWP_NOACTIVATE, NULL, NULL);
- release_win_data(data);
- }
+ macdrv_reassert_window_position(hwnd);
SendMessageW(hwnd, WM_DISPLAYCHANGE, wp, lp);
return 0;
case WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS:
@@ -2244,6 +2239,23 @@ void macdrv_window_drag_end(HWND hwnd)
}
+/***********************************************************************
+ * macdrv_reassert_window_position
+ *
+ * Handler for REASSERT_WINDOW_POSITION events.
+ */
+void macdrv_reassert_window_position(HWND hwnd)
+{
+ struct macdrv_win_data *data = get_win_data(hwnd);
+ if (data)
+ {
+ if (data->cocoa_window && data->on_screen)
+ sync_window_position(data, SWP_NOZORDER | SWP_NOACTIVATE, NULL, NULL);
+ release_win_data(data);
+ }
+}
+
+
struct quit_info {
HWND *wins;
UINT capacity;
Module: wine
Branch: master
Commit: 01a5e00479c1360596369892092a1f6a9cd11458
URL: http://source.winehq.org/git/wine.git/?a=commit;h=01a5e00479c13605963698920…
Author: Andrew Eikum <aeikum(a)codeweavers.com>
Date: Mon Oct 5 11:33:42 2015 -0500
xapofx1_2: Forward to xapofx1_5.
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
configure | 2 ++
configure.ac | 1 +
dlls/xapofx1_2/Makefile.in | 4 ++++
dlls/xapofx1_2/main.c | 45 +++++++++++++++++++++++++++++++++++++++++++
dlls/xapofx1_2/xapofx1_2.spec | 1 +
5 files changed, 53 insertions(+)
diff --git a/configure b/configure
index 34edcce..9cd9ca3 100755
--- a/configure
+++ b/configure
@@ -1371,6 +1371,7 @@ enable_x3daudio1_5
enable_x3daudio1_6
enable_x3daudio1_7
enable_xapofx1_1
+enable_xapofx1_2
enable_xapofx1_3
enable_xapofx1_4
enable_xapofx1_5
@@ -17914,6 +17915,7 @@ wine_fn_config_dll x3daudio1_5 enable_x3daudio1_5
wine_fn_config_dll x3daudio1_6 enable_x3daudio1_6
wine_fn_config_dll x3daudio1_7 enable_x3daudio1_7
wine_fn_config_dll xapofx1_1 enable_xapofx1_1
+wine_fn_config_dll xapofx1_2 enable_xapofx1_2
wine_fn_config_dll xapofx1_3 enable_xapofx1_3
wine_fn_config_dll xapofx1_4 enable_xapofx1_4
wine_fn_config_dll xapofx1_5 enable_xapofx1_5
diff --git a/configure.ac b/configure.ac
index d350ea6..62abe1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3457,6 +3457,7 @@ WINE_CONFIG_DLL(x3daudio1_5)
WINE_CONFIG_DLL(x3daudio1_6)
WINE_CONFIG_DLL(x3daudio1_7)
WINE_CONFIG_DLL(xapofx1_1)
+WINE_CONFIG_DLL(xapofx1_2)
WINE_CONFIG_DLL(xapofx1_3)
WINE_CONFIG_DLL(xapofx1_4)
WINE_CONFIG_DLL(xapofx1_5)
diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in
new file mode 100644
index 0000000..fb76b12
--- /dev/null
+++ b/dlls/xapofx1_2/Makefile.in
@@ -0,0 +1,4 @@
+MODULE = xapofx1_2.dll
+
+C_SRCS = \
+ main.c
diff --git a/dlls/xapofx1_2/main.c b/dlls/xapofx1_2/main.c
new file mode 100644
index 0000000..e873b58
--- /dev/null
+++ b/dlls/xapofx1_2/main.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Andrew Eikum for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xapofx);
+
+/*****************************************************
+ * DllMain
+ */
+BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
+{
+ TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
+
+ switch(reason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinst);
+ break;
+ }
+ return TRUE;
+}
diff --git a/dlls/xapofx1_2/xapofx1_2.spec b/dlls/xapofx1_2/xapofx1_2.spec
new file mode 100644
index 0000000..bc17511
--- /dev/null
+++ b/dlls/xapofx1_2/xapofx1_2.spec
@@ -0,0 +1 @@
+@ cdecl CreateFX(ptr ptr) xapofx1_5.CreateFX
Module: wine
Branch: master
Commit: 24a371c9d6917e87e8f6781a233286a3c04469f8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=24a371c9d6917e87e8f6781a2…
Author: Andrew Eikum <aeikum(a)codeweavers.com>
Date: Mon Oct 5 11:33:09 2015 -0500
xaudio2_1: Forward to xaudio2_7.
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
configure | 2 ++
configure.ac | 1 +
dlls/xaudio2_1/Makefile.in | 7 ++++++
dlls/xaudio2_1/xaudio2_1.spec | 4 +++
dlls/xaudio2_1/xaudio_classes.idl | 28 +++++++++++++++++++++
dlls/xaudio2_1/xaudio_dll.c | 52 +++++++++++++++++++++++++++++++++++++++
include/xaudio2.idl | 7 ++++++
7 files changed, 101 insertions(+)
diff --git a/configure b/configure
index 5b5000d..34edcce 100755
--- a/configure
+++ b/configure
@@ -1374,6 +1374,7 @@ enable_xapofx1_1
enable_xapofx1_3
enable_xapofx1_4
enable_xapofx1_5
+enable_xaudio2_1
enable_xaudio2_2
enable_xaudio2_3
enable_xaudio2_4
@@ -17916,6 +17917,7 @@ wine_fn_config_dll xapofx1_1 enable_xapofx1_1
wine_fn_config_dll xapofx1_3 enable_xapofx1_3
wine_fn_config_dll xapofx1_4 enable_xapofx1_4
wine_fn_config_dll xapofx1_5 enable_xapofx1_5
+wine_fn_config_dll xaudio2_1 enable_xaudio2_1 clean
wine_fn_config_dll xaudio2_2 enable_xaudio2_2 clean
wine_fn_config_dll xaudio2_3 enable_xaudio2_3 clean
wine_fn_config_dll xaudio2_4 enable_xaudio2_4 clean
diff --git a/configure.ac b/configure.ac
index 51574db..d350ea6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3460,6 +3460,7 @@ WINE_CONFIG_DLL(xapofx1_1)
WINE_CONFIG_DLL(xapofx1_3)
WINE_CONFIG_DLL(xapofx1_4)
WINE_CONFIG_DLL(xapofx1_5)
+WINE_CONFIG_DLL(xaudio2_1,,[clean])
WINE_CONFIG_DLL(xaudio2_2,,[clean])
WINE_CONFIG_DLL(xaudio2_3,,[clean])
WINE_CONFIG_DLL(xaudio2_4,,[clean])
diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in
new file mode 100644
index 0000000..282513b
--- /dev/null
+++ b/dlls/xaudio2_1/Makefile.in
@@ -0,0 +1,7 @@
+MODULE = xaudio2_1.dll
+IMPORTS = ole32
+
+C_SRCS = \
+ xaudio_dll.c
+
+IDL_SRCS = xaudio_classes.idl
diff --git a/dlls/xaudio2_1/xaudio2_1.spec b/dlls/xaudio2_1/xaudio2_1.spec
new file mode 100644
index 0000000..cb263d4
--- /dev/null
+++ b/dlls/xaudio2_1/xaudio2_1.spec
@@ -0,0 +1,4 @@
+@ stdcall -private DllCanUnloadNow()
+@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
diff --git a/dlls/xaudio2_1/xaudio_classes.idl b/dlls/xaudio2_1/xaudio_classes.idl
new file mode 100644
index 0000000..de85c0b
--- /dev/null
+++ b/dlls/xaudio2_1/xaudio_classes.idl
@@ -0,0 +1,28 @@
+/*
+ * COM Classes for xaudio
+ *
+ * Copyright 2015 Andrew Eikum for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#pragma makedep register
+
+[
+ helpstring("XAudio2.1 Class"),
+ threading(both),
+ uuid(e21a7345-eb21-468e-be50-804db97cf708)
+]
+coclass XAudio21 { interface IXAudio22; }
diff --git a/dlls/xaudio2_1/xaudio_dll.c b/dlls/xaudio2_1/xaudio_dll.c
new file mode 100644
index 0000000..7c95c28
--- /dev/null
+++ b/dlls/xaudio2_1/xaudio_dll.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015 Andrew Eikum for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "objbase.h"
+#include "rpcproxy.h"
+
+static HINSTANCE instance;
+
+BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved)
+{
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ instance = hinstance;
+ DisableThreadLibraryCalls(hinstance);
+ break;
+ }
+ return TRUE;
+}
+
+HRESULT WINAPI DllCanUnloadNow(void)
+{
+ return S_FALSE;
+}
+
+HRESULT WINAPI DllRegisterServer(void)
+{
+ return __wine_register_resources(instance);
+}
+
+HRESULT WINAPI DllUnregisterServer(void)
+{
+ return __wine_unregister_resources(instance);
+}
diff --git a/include/xaudio2.idl b/include/xaudio2.idl
index bd79718..5d4726a 100644
--- a/include/xaudio2.idl
+++ b/include/xaudio2.idl
@@ -31,6 +31,13 @@ coclass XAudio2 {
}
[
+ uuid(e21a7345-eb21-468e-be50-804db97cf708)
+]
+coclass XAudio21 {
+ interface IUnknown;
+}
+
+[
uuid(b802058a-464a-42db-bc10-b650d6f2586a)
]
coclass XAudio22 {