diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-03-05 22:42:05 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-05 22:42:05 +0000 |
commit | 7dabd1ad92986a2b7428a1067d549fe9efd09971 (patch) | |
tree | 02aa9fa47327b7a4f2c52a4055dda2a7a9d701d9 /app-emulation | |
parent | Fix dependencies. Restrict Jython ABIs. Add src_test(). (diff) | |
download | historical-7dabd1ad92986a2b7428a1067d549fe9efd09971.tar.gz historical-7dabd1ad92986a2b7428a1067d549fe9efd09971.tar.bz2 historical-7dabd1ad92986a2b7428a1067d549fe9efd09971.zip |
Add USE=mousewarp patch to auto apply the mouse-warp patch.
Package-Manager: portage-2.2.0_alpha25/cvs/Linux x86_64
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/wine/ChangeLog | 6 | ||||
-rw-r--r-- | app-emulation/wine/Manifest | 19 | ||||
-rw-r--r-- | app-emulation/wine/files/wine-1.3.14-mouse-warp.patch | 594 | ||||
-rw-r--r-- | app-emulation/wine/metadata.xml | 1 | ||||
-rw-r--r-- | app-emulation/wine/wine-1.3.14.ebuild | 5 | ||||
-rw-r--r-- | app-emulation/wine/wine-9999.ebuild | 5 |
6 files changed, 621 insertions, 9 deletions
diff --git a/app-emulation/wine/ChangeLog b/app-emulation/wine/ChangeLog index 796e90d2da9c..658cb1aba26f 100644 --- a/app-emulation/wine/ChangeLog +++ b/app-emulation/wine/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-emulation/wine # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/ChangeLog,v 1.351 2011/02/18 21:31:10 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/ChangeLog,v 1.352 2011/03/05 22:42:05 vapier Exp $ + + 05 Mar 2011; Mike Frysinger <vapier@gentoo.org> wine-1.3.14.ebuild, + +files/wine-1.3.14-mouse-warp.patch, wine-9999.ebuild, metadata.xml: + Add USE=mousewarp patch to auto apply the mouse-warp patch. *wine-1.3.14 (18 Feb 2011) diff --git a/app-emulation/wine/Manifest b/app-emulation/wine/Manifest index 19d2427edd59..fb6db1798e5b 100644 --- a/app-emulation/wine/Manifest +++ b/app-emulation/wine/Manifest @@ -1,5 +1,9 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX wine-1.1.15-configure-host.patch 314 RMD160 1c8d09d5265a23b1931eba949a614eaeff251ac7 SHA1 af887b963cf154e8bcf1e9b8b19731bbdda5f487 SHA256 c281217f6e221a6235485918750907b02aa1e40fa68e45133cc4c14ebb40bfe9 AUX wine-1.1.15-winegcc.patch 1556 RMD160 ca7e0df0a45507e7d31ed81c5712111b83ed9bfa SHA1 4b155fe7cb5e831b7f92757d52aa1ab12569b232 SHA256 dbd89db561d7583faf317d795b8c11231575d885e21c6414add39079604dbd0d +AUX wine-1.3.14-mouse-warp.patch 20111 RMD160 43098f5ec5b597d6186fc7dad6e783c512b037b2 SHA1 ecb919b56503e522c32268b0bce1ec4dcb966c88 SHA256 08d84e68f4358709b943baa09b99b72ea80b4dbbe89e55c2fbe9d874da032b42 AUX wine-gentoo-no-ssp.patch 532 RMD160 fd5de0dd965ec58aa53f0ec1fb74ce7cd498a24e SHA1 6fc776bd96438c65a44a03c8adb3fedb0aaa70bf SHA256 6408ae3ed9bacc895677a5b2302bc27afc549ea99f54a9ab4594afb34c629e9e DIST wine-1.2.1.tar.bz2 17629106 RMD160 8652ac4f7c4fd2b3da22a840706b3adcb9901467 SHA1 02df427698de8a6d937e722923c8ac1cf886ca27 SHA256 43d1c4d8441221708e6e15ddcddf113308ce875c87f5a8c0f380c6a5b8b63701 DIST wine-1.2.2.tar.bz2 17665449 RMD160 0388547d56d0676354406d52e62de0b843d8be5d SHA1 8b37c8e0230dd6a665d310054f4e36dcbdab7330 SHA256 c3daead3d40a7c00111200a8e9271d4647369ee4eee2d5d866c2032ef37c09db @@ -39,7 +43,7 @@ EBUILD wine-1.3.10.ebuild 5819 RMD160 28fe75b6528e7e251193fa8b6ee2d80a3dbf641e S EBUILD wine-1.3.11.ebuild 5881 RMD160 56b5660adaba5a39df0fee14503a85bb03c649eb SHA1 3dd158b9ebefedd7ca91d3d754e9ded98d59c428 SHA256 45d68cc23faa04d981cc7e1e7b6c90b145f277237ab3de81b1a299bb1655033e EBUILD wine-1.3.12.ebuild 5883 RMD160 679ffa51ace4886e547b522fbde7c57bacb68adf SHA1 03f7dca2d1bd1e7c3e9d11f3737da09fd1ed5afa SHA256 b485e74d6fc8ae0bcccbb4ac339b389ecaa8ff0a6220870c2122cc3fc37ca52e EBUILD wine-1.3.13.ebuild 5883 RMD160 dc2a173cb187dd7899fbf501a3a0e9ee9ea0a5bb SHA1 5bd81ebdd04eed978cea0b7b9b35c75d5dc593ce SHA256 3271ef375e0c9bb0dbf955559015f34e05d9e3ee467760c3a1e2813738347df3 -EBUILD wine-1.3.14.ebuild 5886 RMD160 2f8b75c6e7dfa12bce13e84b3e58d91d49ff3092 SHA1 4ad70f629f1f1847fa04d8810795aabb49240080 SHA256 7448b32581588ef78a160e07375e56af88217ecaf1f658982caeadfcf794e011 +EBUILD wine-1.3.14.ebuild 5962 RMD160 b95db4ca52dd812be07f02298b7e705d1e37cdfd SHA1 9db9cbc0d231495b4137154f8e228549a08763ad SHA256 143f0e25a40c3c4ecdb35329e22ae01ba4ee1113f7747fc2982b0f9dbcce5304 EBUILD wine-1.3.2.ebuild 5715 RMD160 375a817e5e5bf8d385a1d2bc08faee1c780f49e0 SHA1 f93e5c72560d49139ea76b52ffc61641687538b9 SHA256 858aa83a689ec48745ee22dc95747f66892cb92f638a4cfc667dd17af761ee15 EBUILD wine-1.3.3.ebuild 5715 RMD160 0921d74c23c352a54c385d43e98f233d63e272a5 SHA1 f74c85a0662749a4fdbd2858ba607a477cb080d6 SHA256 7ed82390d2b1d9f18164e540793b820840cdc16945f52790556e4ae6fac4dc85 EBUILD wine-1.3.4.ebuild 5715 RMD160 e457e78d2b5262110bfdbda0ff824e15135e5cb8 SHA1 770e6dbd5fcf08f7e8a5acc96d5e2d6a4b071d10 SHA256 122916aecc0212f8a47c18059ba1baeafcc92b8213b3f69964e27ae32bda9b1b @@ -48,6 +52,13 @@ EBUILD wine-1.3.6.ebuild 5816 RMD160 1592bfcf93abf31b758c4d2f61dc23be34bd5e12 SH EBUILD wine-1.3.7.ebuild 5816 RMD160 5e04a8e9fd4ce819cb64413f5ff9136e7d366ef0 SHA1 d599da9c4594b747a72a464603fa02b6e7aaffe8 SHA256 38f2df4ab8d0e238ead323718f58926e36f87a7204ffef776a5b36367ef37a2d EBUILD wine-1.3.8.ebuild 5816 RMD160 851de949bbf7909b4f9bca9ce14dddbed1c0c5c6 SHA1 41a5f7be3535d2508ed607a3b55fae3920df0b7d SHA256 8f4e2c645ae692a820092ff047f3ca4cd9693298831314d8c44cd91a48b16a60 EBUILD wine-1.3.9.ebuild 5816 RMD160 9d6b3b04a575c7f7dc557097b3d88a69852595b1 SHA1 9a571c0bb42229c7d841c5029488e3ebc8b1a34d SHA256 3458ba56b4850be14b061bb880ac8cf897cdffea8c9786f3bbd1159a98478784 -EBUILD wine-9999.ebuild 5882 RMD160 2989f16035060a2f86112af908f854228607f730 SHA1 03b5773c9da5a8f0c40dd2d695ad258206c16ddc SHA256 7cdfc1309267c08b62d0a122979413f00393e1c0fb99dfecf0d37818faa04d2a -MISC ChangeLog 67849 RMD160 3e7d414a97812a248b5f6a64316256532c06ba71 SHA1 434ed744b69f612464c77715a7eb70346bda8f8c SHA256 454d63496951dd62c71974f5e74f588b01879a54eb17d1daa2704787fb8a9e3a -MISC metadata.xml 1417 RMD160 6956a69da8c1a72542e91d63b9e194247df3b781 SHA1 0a050a0047bbd4d750b57600b6f608c7411a7d0b SHA256 dc1c6fda02c66f6edf0b3095b1edc57e3730eece0b7eb4d15e67e0daa1bc9c50 +EBUILD wine-9999.ebuild 5961 RMD160 be860f24477b59b4ba6e9b2ea636c2a634964b79 SHA1 4bce082c355e23e4974a5c91776f9749acf079c7 SHA256 7849103f9dce5cd500f7129cfb74c8b78a2d259f376a05e0ba9d2583cd074172 +MISC ChangeLog 68050 RMD160 0322fc877518c2e0d44aaf73787a3fbbbeeba570 SHA1 b19297eb67eabb429ee979bb0d593d081756e738 SHA256 932f4e329dd7d6194712c0bdc84926375669b888fa30c22cae09f4fae2b437e1 +MISC metadata.xml 1558 RMD160 072ada500f9ea383d22bb56c3e19784bf64758c4 SHA1 21552cac41e0118c595475aaaa03a5a3d5708e04 SHA256 d2cd120a25ebecc8fd3c739c742c122ea8fb149be8ba62f7b5575fc578b91e34 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iF4EAREIAAYFAk1yvD4ACgkQaC/OocHi7JbeSgD+KxYEZp4ba9eCmaQECS/Z+JTC +xDNeJIJYgYEB0GVJuKkA/27xO1gBS+yDfOgKXJb6UTqe0C/Yimhyay6hst9AFQyZ +=gNRK +-----END PGP SIGNATURE----- diff --git a/app-emulation/wine/files/wine-1.3.14-mouse-warp.patch b/app-emulation/wine/files/wine-1.3.14-mouse-warp.patch new file mode 100644 index 000000000000..d6bf7978ca30 --- /dev/null +++ b/app-emulation/wine/files/wine-1.3.14-mouse-warp.patch @@ -0,0 +1,594 @@ +http://bugs.winehq.org/show_bug.cgi?id=6971 + +diff --git a/configure b/configure +index 9b1cb22..05baa8d 100755 +--- a/configure ++++ b/configure +@@ -7972,6 +7972,7 @@ fi + X11/Xcursor/Xcursor.h \ + X11/extensions/shape.h \ + X11/extensions/XInput.h \ ++ X11/extensions/XInput2.h \ + X11/extensions/XShm.h \ + X11/extensions/Xcomposite.h \ + X11/extensions/Xinerama.h \ +@@ -8168,6 +8169,61 @@ This is an error since --with-xinput was requested." "$LINENO" 5 ;; + esac + fi + ++ if test "$ac_cv_header_X11_extensions_XInput2_h" = "yes" ++ then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XIQueryVersion in -lXi" >&5 ++$as_echo_n "checking for XIQueryVersion in -lXi... " >&6; } ++if test "${ac_cv_lib_Xi_XIQueryVersion+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lXi $X_LIBS $XLIB $X_EXTRA_LIBS $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char XIQueryVersion (); ++int ++main () ++{ ++return XIQueryVersion (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_Xi_XIQueryVersion=yes ++else ++ ac_cv_lib_Xi_XIQueryVersion=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XIQueryVersion" >&5 ++$as_echo "$ac_cv_lib_Xi_XIQueryVersion" >&6; } ++if test "x$ac_cv_lib_Xi_XIQueryVersion" = x""yes; then : ++ ++$as_echo "#define HAVE_LIBXINPUT2 1" >>confdefs.h ++ ++fi ++ ++ ++ fi ++ if test "$ac_cv_lib_Xi_XIQueryVersion" != "yes"; then : ++ case "x$with_xinput2" in ++ x) as_fn_append wine_notices "|libxi ${notice_platform}development files not found, the Xinput2 extension won't be supported." ;; ++ xno) ;; ++ *) as_fn_error "libxi ${notice_platform}development files not found, the Xinput2 extension won't be supported. ++This is an error since --with-xinput2 was requested." "$LINENO" 5 ;; ++esac ++fi ++ + if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXext" >&5 +diff --git a/configure.ac b/configure.ac +index 04ed14f..0d4410a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -897,6 +897,7 @@ then + X11/Xcursor/Xcursor.h \ + X11/extensions/shape.h \ + X11/extensions/XInput.h \ ++ X11/extensions/XInput2.h \ + X11/extensions/XShm.h \ + X11/extensions/Xcomposite.h \ + X11/extensions/Xinerama.h \ +@@ -935,6 +936,17 @@ then + WINE_NOTICE_WITH(xinput,[test "x$ac_cv_lib_soname_Xi" = "x"], + [libxi ${notice_platform}development files not found, the Xinput extension won't be supported.]) + ++ dnl *** Check for X input 2 extension ++ if test "$ac_cv_header_X11_extensions_XInput2_h" = "yes" ++ then ++ AC_CHECK_LIB(Xi, XIQueryVersion, ++ AC_DEFINE(HAVE_LIBXINPUT2, 1, [Define if you have the XInput 2 extension]),, ++ $X_LIBS $XLIB $X_EXTRA_LIBS) ++ ++ fi ++ WINE_NOTICE_WITH(xinput2,[test "$ac_cv_lib_Xi_XIQueryVersion" != "yes"], ++ [libxi ${notice_platform}development files not found, the Xinput2 extension won't be supported.]) ++ + dnl *** Check for X Shm extension + if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" + then +diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c +index 06971db..c86ae97 100644 +--- a/dlls/dinput/dinput_main.c ++++ b/dlls/dinput/dinput_main.c +@@ -85,6 +85,16 @@ static const struct dinput_device *dinput_devices[] = + #define NB_DINPUT_DEVICES (sizeof(dinput_devices)/sizeof(dinput_devices[0])) + + static HINSTANCE DINPUT_instance = NULL; ++static int(*wine_xinput_acquire)(int,HOOKPROC); ++ ++static void dinput_init( HINSTANCE inst ) ++{ ++ HMODULE x11 = GetModuleHandleA("winex11.drv"); ++ ++ DINPUT_instance = inst; ++ if (x11) ++ wine_xinput_acquire = (void *)GetProcAddress(x11, "wine_xinput_acquire"); ++} + + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserv) + { +@@ -92,7 +102,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserv) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(inst); +- DINPUT_instance = inst; ++ dinput_init(inst); + break; + case DLL_PROCESS_DETACH: + break; +@@ -882,6 +892,28 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) + * DInput hook thread + */ + ++static LRESULT CALLBACK LL_hook_proc_xi2( int code, WPARAM wparam, LPARAM lparam ) ++{ ++ IDirectInputImpl *dinput; ++ ++ EnterCriticalSection( &dinput_hook_crit ); ++ LIST_FOR_EACH_ENTRY( dinput, &direct_input_list, IDirectInputImpl, entry ) ++ { ++ IDirectInputDeviceImpl *dev; ++ ++ EnterCriticalSection( &dinput->crit ); ++ LIST_FOR_EACH_ENTRY( dev, &dinput->devices_list, IDirectInputDeviceImpl, entry ) ++ if (dev->acquired && dev->event_proc) ++ { ++ TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam); ++ dev->event_proc( (LPDIRECTINPUTDEVICE8A)dev, wparam, lparam ); ++ } ++ LeaveCriticalSection( &dinput->crit ); ++ } ++ LeaveCriticalSection( &dinput_hook_crit ); ++ return 1; ++} ++ + static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) + { + IDirectInputImpl *dinput; +@@ -1003,12 +1035,15 @@ static DWORD WINAPI hook_thread_proc(void *param) + kbd_hook = NULL; + } + +- if (mice_cnt && !mouse_hook) +- mouse_hook = SetWindowsHookExW( WH_MOUSE_LL, LL_hook_proc, DINPUT_instance, 0 ); +- else if (!mice_cnt && mouse_hook) ++ if (!wine_xinput_acquire( (mice_cnt ? 2 : 0) , LL_hook_proc_xi2 )) + { +- UnhookWindowsHookEx( mouse_hook ); +- mouse_hook = NULL; ++ if (mice_cnt && !mouse_hook) ++ mouse_hook = SetWindowsHookExW( WH_MOUSE_LL, LL_hook_proc, DINPUT_instance, 0 ); ++ else if (!mice_cnt && mouse_hook) ++ { ++ UnhookWindowsHookEx( mouse_hook ); ++ mouse_hook = NULL; ++ } + } + } + TranslateMessage(&msg); +diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c +index 1599157..7390c01 100644 +--- a/dlls/dinput/mouse.c ++++ b/dlls/dinput/mouse.c +@@ -304,7 +304,10 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + { + POINT pt, pt1; + +- GetCursorPos(&pt); ++ if (hook->flags & 2) ++ pt.x = pt.y = 0; ++ else ++ GetCursorPos(&pt); + This->m_state.lX += pt.x = hook->pt.x - pt.x; + This->m_state.lY += pt.y = hook->pt.y - pt.y; + +@@ -330,7 +333,8 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + wdata = pt1.y; + } + +- This->need_warp = This->warp_override != WARP_DISABLE && ++ This->need_warp = !(hook->flags & 2) && ++ This->warp_override != WARP_DISABLE && + (pt.x || pt.y) && + (dwCoop & DISCL_EXCLUSIVE || This->warp_override == WARP_FORCE_ON); + break; +diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c +index ae0875b..bc9dedf 100644 +--- a/dlls/winex11.drv/event.c ++++ b/dlls/winex11.drv/event.c +@@ -141,9 +141,10 @@ static struct event_handler handlers[MAX_EVENT_HANDLERS] = + /* ColormapNotify */ + { ClientMessage, X11DRV_ClientMessage }, + { MappingNotify, X11DRV_MappingNotify }, ++ { GenericEvent, X11DRV_GenericEvent }, + }; + +-static int nb_event_handlers = 20; /* change this if you add handlers above */ ++static int nb_event_handlers = 21; /* change this if you add handlers above */ + + + /* return the name of an X event */ +diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c +index 71b31cc..61eb7dc 100644 +--- a/dlls/winex11.drv/mouse.c ++++ b/dlls/winex11.drv/mouse.c +@@ -22,23 +22,10 @@ + #include "config.h" + #include "wine/port.h" + +-#include <X11/Xlib.h> ++#include <stdlib.h> + #include <X11/cursorfont.h> + #include <stdarg.h> +- +-#ifdef SONAME_LIBXCURSOR +-# include <X11/Xcursor/Xcursor.h> +-static void *xcursor_handle; +-# define MAKE_FUNCPTR(f) static typeof(f) * p##f +-MAKE_FUNCPTR(XcursorImageCreate); +-MAKE_FUNCPTR(XcursorImageDestroy); +-MAKE_FUNCPTR(XcursorImageLoadCursor); +-MAKE_FUNCPTR(XcursorImagesCreate); +-MAKE_FUNCPTR(XcursorImagesDestroy); +-MAKE_FUNCPTR(XcursorImagesLoadCursor); +-MAKE_FUNCPTR(XcursorLibraryLoadCursor); +-# undef MAKE_FUNCPTR +-#endif /* SONAME_LIBXCURSOR */ ++#include <assert.h> + + #define NONAMELESSUNION + #define NONAMELESSSTRUCT +@@ -53,6 +40,39 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor); + #include "wine/unicode.h" + #include "wine/debug.h" + ++#include <X11/Xlib.h> ++ ++#define MAKE_FUNCPTR(f) static typeof(f) * p##f ++ ++#ifdef SONAME_LIBXCURSOR ++# include <X11/Xcursor/Xcursor.h> ++static void *xcursor_handle; ++MAKE_FUNCPTR(XcursorImageCreate); ++MAKE_FUNCPTR(XcursorImageDestroy); ++MAKE_FUNCPTR(XcursorImageLoadCursor); ++MAKE_FUNCPTR(XcursorImagesCreate); ++MAKE_FUNCPTR(XcursorImagesDestroy); ++MAKE_FUNCPTR(XcursorImagesLoadCursor); ++MAKE_FUNCPTR(XcursorLibraryLoadCursor); ++#endif /* SONAME_LIBXCURSOR */ ++ ++#ifdef HAVE_LIBXINPUT2 ++# include <X11/extensions/XInput2.h> ++static void *xinput2_handle; ++static int xinput2_opcode; ++static int xinput2_available; ++static int core_pointer_id; ++MAKE_FUNCPTR(XQueryExtension); ++MAKE_FUNCPTR(XIQueryVersion); ++MAKE_FUNCPTR(XISelectEvents); ++MAKE_FUNCPTR(XGetEventData); ++MAKE_FUNCPTR(XFreeEventData); ++MAKE_FUNCPTR(XIQueryDevice); ++MAKE_FUNCPTR(XIFreeDeviceInfo); ++#endif /* HAVE_LIBXINPUT2 */ ++ ++#undef MAKE_FUNCPTR ++ + WINE_DEFAULT_DEBUG_CHANNEL(cursor); + + /**********************************************************************/ +@@ -130,6 +150,67 @@ void X11DRV_Xcursor_Init(void) + #endif /* SONAME_LIBXCURSOR */ + } + ++void X11DRV_XInput2_Init(void) ++{ ++#ifdef HAVE_LIBXINPUT2 ++ int event_base, error_base, ret; ++ int major = 2, minor = 0; /* Need at least v2.0 extension */ ++ char msg[1024]; ++ ++ xinput2_handle = wine_dlopen(SONAME_LIBXI, RTLD_NOW, NULL, 0); ++ if (!xinput2_handle) /* wine_dlopen failed. */ ++ { ++ FIXME("XInput2 failed to load. Using fallback code.\n"); ++ return; ++ } ++#define LOAD_FUNCPTR(f) if (!(p##f = wine_dlsym(xinput2_handle, #f, msg, sizeof(msg)))) \ ++ { WARN("Error loading \"%s\": %s\n", #f, msg); return; } ++ LOAD_FUNCPTR(XQueryExtension) ++ LOAD_FUNCPTR(XIQueryVersion) ++ LOAD_FUNCPTR(XISelectEvents) ++ LOAD_FUNCPTR(XGetEventData) ++ LOAD_FUNCPTR(XFreeEventData) ++ LOAD_FUNCPTR(XIQueryDevice) ++ LOAD_FUNCPTR(XIFreeDeviceInfo) ++#undef LOAD_FUNCPTR ++ ++ wine_tsx11_lock(); ++ if (!pXQueryExtension(gdi_display, "XInputExtension", &xinput2_opcode, &event_base, &error_base)) ++ { ++ wine_tsx11_unlock(); ++ WARN("Failed to query XInputExtension\n"); ++ return; ++ } ++ if ((ret = pXIQueryVersion(gdi_display, &major, &minor)) == Success) ++ { ++ XIDeviceInfo *devs; ++ int num_devs, i; ++ ++ /* Find core pointer id. */ ++ devs = pXIQueryDevice(gdi_display, XIAllMasterDevices, &num_devs); ++ for (i = 0; i < num_devs; i++) ++ { ++ if (devs[i].use == XIMasterPointer) ++ { ++ core_pointer_id = devs[i].deviceid; ++ break; ++ } ++ } ++ pXIFreeDeviceInfo(devs); ++ } ++ wine_tsx11_unlock(); ++ ++ if (ret != Success) ++ { ++ WARN("Failed to get requred Xi2 version. Server supports %d.%d\n", major, minor); ++ return; ++ } ++ TRACE("Server supports Xinput2 extension version %d.%d\n", major, minor); ++ xinput2_available = 1; ++ ++ return; ++#endif /* HAVE_LIBXINPUT2 */ ++} + + /*********************************************************************** + * clip_point_to_rect +@@ -1258,3 +1339,160 @@ void X11DRV_EnterNotify( HWND hwnd, XEvent *xev ) + X11DRV_send_mouse_input( top_hwnd, hwnd, MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, + pt.x, pt.y, 0, EVENT_x11_time_to_win32_time(event->time), 0, 0 ); + } ++ ++#ifdef HAVE_LIBXINPUT2 ++static HOOKPROC xi2_callback; ++ ++static UINT xi2_press_to_mesage(int btn) ++{ ++ switch (btn) ++ { ++ case 1: return WM_LBUTTONDOWN; ++ case 2: return WM_MBUTTONDOWN; ++ case 3: return WM_RBUTTONDOWN; ++ case 4: case 5: ++ case 6: case 7: ++ return WM_MOUSEWHEEL; ++ case 8: ++ case 9: return WM_XBUTTONDOWN; ++ } ++ return 0; ++} ++ ++static UINT xi2_release_to_mesage(int btn) ++{ ++ switch (btn) ++ { ++ case 1: return WM_LBUTTONUP; ++ case 2: return WM_MBUTTONUP; ++ case 3: return WM_RBUTTONUP; ++ case 4: case 5: ++ case 6: case 7: ++ return WM_MOUSEWHEEL; ++ case 8: ++ case 9: return WM_XBUTTONUP; ++ } ++ return 0; ++} ++#endif ++ ++/*********************************************************************** ++ * X11DRV_GenericEvent ++ */ ++void X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) ++{ ++#ifdef HAVE_LIBXINPUT2 ++ XGenericEventCookie *cookie = (XGenericEventCookie*)&xev->xcookie; ++ Display *display = thread_init_display(); ++ ++ assert(xinput2_available); ++ TRACE("%p %p\n", hwnd, xev); ++ ++ if (pXGetEventData(display , cookie) && ++ cookie->type == GenericEvent && ++ cookie->extension == xinput2_opcode) ++ { ++ XIRawEvent *revent = (XIRawEvent *)cookie->data; ++ DWORD wData; ++ MSLLHOOKSTRUCT hook; ++ ++ memset(&hook, 0, sizeof(hook)); ++ hook.time = EVENT_x11_time_to_win32_time(revent->time); ++ ++ /* Skip core pointer events */ ++ if (revent->deviceid != core_pointer_id) ++ switch (cookie->evtype) ++ { ++ case XI_RawMotion: ++ { ++ int i = 0; ++ hook.pt.x = XIMaskIsSet(revent->valuators.mask, 0) ? revent->raw_values[i++] : 0; ++ hook.pt.y = XIMaskIsSet(revent->valuators.mask, 1) ? revent->raw_values[i++] : 0; ++ hook.flags = 2; ++ if (xi2_callback) xi2_callback(0, WM_MOUSEMOVE, (LPARAM)&hook); ++ break; ++ } ++ ++ case XI_RawButtonPress: ++ switch (revent->detail) ++ { ++ case 4: case 6: wData = WHEEL_DELTA; break; ++ case 5: case 7: wData = -WHEEL_DELTA; break; ++ case 8: wData = XBUTTON1; break; ++ case 9: wData = XBUTTON2; break; ++ default: wData = 0; ++ } ++ hook.mouseData = MAKELONG(0, wData); ++ if (xi2_callback) xi2_callback(0, xi2_press_to_mesage(revent->detail), (LPARAM)&hook); ++ break; ++ ++ case XI_RawButtonRelease: ++ switch (revent->detail) ++ { ++ case 8: wData = XBUTTON1; break; ++ case 9: wData = XBUTTON2; break; ++ default: wData = 0; ++ } ++ hook.mouseData = MAKELONG(0, wData); ++ if (xi2_callback) xi2_callback(0, xi2_release_to_mesage(revent->detail), (LPARAM)&hook); ++ break; ++ ++ case XI_RawKeyPress: ++ break; ++ case XI_RawKeyRelease: ++ break; ++ } ++ } ++ pXFreeEventData(display , &xev->xcookie); ++#endif ++} ++ ++ ++#ifdef HAVE_LIBXINPUT2 ++int CDECL X11DRV_xinput_acquire(int dev_mask, HOOKPROC cb) ++{ ++ XIEventMask eventmask; ++ unsigned char mask[XIMaskLen(XI_RawMotion)] = {0}; ++ Display *display = thread_init_display(); ++ int ret; ++ ++ TRACE("%d %p\n", dev_mask, cb); ++ if (!xinput2_available) return 0; ++ ++ eventmask.mask = mask; ++ eventmask.mask_len = sizeof(mask); ++ eventmask.deviceid = XIAllDevices; ++ ++ if (dev_mask & 1) ++ { ++ XISetMask(eventmask.mask, XI_RawKeyPress); ++ XISetMask(eventmask.mask, XI_RawKeyRelease); ++ } ++ if (dev_mask & 2) ++ { ++ XISetMask(eventmask.mask, XI_RawButtonPress); ++ XISetMask(eventmask.mask, XI_RawButtonRelease); ++ XISetMask(eventmask.mask, XI_RawMotion); ++ } ++ wine_tsx11_lock(); ++ ret = pXISelectEvents(display, DefaultRootWindow(display), &eventmask, 1); ++ wine_tsx11_unlock(); ++ if (ret != Success) ++ { ++ WARN("Failed to set mask: %d\n", ret); ++ return 0; ++ } ++ InterlockedExchangePointer((LPVOID)&xi2_callback, cb); ++ TRACE("Set Xi2 callback to %p\n", cb); ++ ++ return 1; ++} ++ ++#else /* HAVE_LIBXINPUT2 */ ++int X11DRV_xinput_acquire(int dev_mask, HOOKPROC cb) ++{ ++ WARN("xinput2 is not available\n"); ++ return 0; ++} ++ ++#endif /* HAVE_LIBXINPUT2 */ +diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec +index 9476c40..6ead1aa 100644 +--- a/dlls/winex11.drv/winex11.drv.spec ++++ b/dlls/winex11.drv/winex11.drv.spec +@@ -162,3 +162,5 @@ + @ stdcall ImeProcessKey(long long long ptr) + @ stdcall ImeGetRegisterWordStyle(long ptr) + @ stdcall ImeGetImeMenuItems(long long long ptr ptr long) ++ ++@ cdecl wine_xinput_acquire(long ptr) X11DRV_xinput_acquire +diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h +index f48b51f..d9035ce 100644 +--- a/dlls/winex11.drv/x11drv.h ++++ b/dlls/winex11.drv/x11drv.h +@@ -713,6 +713,7 @@ extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event ); + extern void X11DRV_SelectionRequest( HWND hWnd, XEvent *event ); + extern void X11DRV_SelectionClear( HWND hWnd, XEvent *event ); + extern void X11DRV_MappingNotify( HWND hWnd, XEvent *event ); ++extern void X11DRV_GenericEvent( HWND hWnd, XEvent *event ); + + extern DWORD EVENT_x11_time_to_win32_time(Time time); + +@@ -843,6 +844,8 @@ extern void X11DRV_XIMLookupChars( const char *str, DWORD count ) DECLSPEC_HIDDE + extern void X11DRV_ForceXIMReset(HWND hwnd) DECLSPEC_HIDDEN; + extern BOOL X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen); + ++extern void X11DRV_XInput2_Init(void); ++ + /* FIXME: private functions imported from user32 */ + extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ); + +diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c +index 0d1a7da..f94bba4 100644 +--- a/dlls/winex11.drv/x11drv_main.c ++++ b/dlls/winex11.drv/x11drv_main.c +@@ -562,6 +562,7 @@ static BOOL process_attach(void) + #ifdef SONAME_LIBXCOMPOSITE + X11DRV_XComposite_Init(); + #endif ++ X11DRV_XInput2_Init(); + + #ifdef HAVE_XKB + if (use_xkb) use_xkb = XkbUseExtension( gdi_display, NULL, NULL ); +diff --git a/include/config.h.in b/include/config.h.in +index 46adad8..be06226 100644 +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -367,6 +367,9 @@ + /* Define to 1 if you have the `ossaudio' library (-lossaudio). */ + #undef HAVE_LIBOSSAUDIO + ++/* Define if you have the XInput 2 extension */ ++#undef HAVE_LIBXINPUT2 ++ + /* Define if you have the libxml2 library */ + #undef HAVE_LIBXML2 + +@@ -1075,6 +1078,9 @@ + /* Define to 1 if you have the <X11/extensions/Xinerama.h> header file. */ + #undef HAVE_X11_EXTENSIONS_XINERAMA_H + ++/* Define to 1 if you have the <X11/extensions/XInput2.h> header file. */ ++#undef HAVE_X11_EXTENSIONS_XINPUT2_H ++ + /* Define to 1 if you have the <X11/extensions/XInput.h> header file. */ + #undef HAVE_X11_EXTENSIONS_XINPUT_H + diff --git a/app-emulation/wine/metadata.xml b/app-emulation/wine/metadata.xml index fe355ba91ce2..0e06effde274 100644 --- a/app-emulation/wine/metadata.xml +++ b/app-emulation/wine/metadata.xml @@ -11,6 +11,7 @@ Think of Wine as a compatibility layer for running Windows programs. Wine does n <flag name='capi'>Enable ISDN support via CAPI</flag> <flag name='custom-cflags'>Bypass strip-flags; use are your own peril</flag> <flag name='gecko'>Add support for the Gecko engine when using iexplore</flag> + <flag name='mousewarp'>Add mouse warp patch -- enable this if you primarily play games (http://bugs.winehq.org/show_bug.cgi?id=6971)</flag> <flag name='perl'>Install helpers written in perl (winedump/winemaker)</flag> <flag name='samba'>Add support for NTLM auth. see http://wiki.winehq.org/NtlmAuthSetupGuide and diff --git a/app-emulation/wine/wine-1.3.14.ebuild b/app-emulation/wine/wine-1.3.14.ebuild index 446abce2078e..cfc98e6a660a 100644 --- a/app-emulation/wine/wine-1.3.14.ebuild +++ b/app-emulation/wine/wine-1.3.14.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.3.14.ebuild,v 1.1 2011/02/18 21:31:10 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.3.14.ebuild,v 1.2 2011/03/05 22:42:05 vapier Exp $ EAPI="2" @@ -33,7 +33,7 @@ SRC_URI="${SRC_URI} LICENSE="LGPL-2.1" SLOT="0" -IUSE="alsa capi cups custom-cflags dbus esd fontconfig +gecko gnutls gphoto2 gsm gstreamer hal jack jpeg lcms ldap mp3 nas ncurses nls openal +opengl +oss +perl png pulseaudio samba scanner ssl test +threads +truetype +win32 +win64 +X xcomposite xinerama xml" +IUSE="alsa capi cups custom-cflags dbus esd fontconfig +gecko gnutls gphoto2 gsm gstreamer hal jack jpeg lcms ldap mousewarp mp3 nas ncurses nls openal +opengl +oss +perl png pulseaudio samba scanner ssl test +threads +truetype +win32 +win64 +X xcomposite xinerama xml" RESTRICT="test" #72375 MLIB_DEPS="amd64? ( @@ -113,6 +113,7 @@ src_unpack() { } src_prepare() { + use mousewarp && epatch "${FILESDIR}"/${PN}-1.3.14-mouse-warp.patch if use pulseaudio ; then EPATCH_OPTS=-p1 epatch `pulse_patches "${DISTDIR}"` eautoreconf diff --git a/app-emulation/wine/wine-9999.ebuild b/app-emulation/wine/wine-9999.ebuild index 4edb939dcffd..55c48cdb0350 100644 --- a/app-emulation/wine/wine-9999.ebuild +++ b/app-emulation/wine/wine-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-9999.ebuild,v 1.72 2011/02/05 09:23:15 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-9999.ebuild,v 1.73 2011/03/05 22:42:05 vapier Exp $ EAPI="2" @@ -33,7 +33,7 @@ SRC_URI="${SRC_URI} LICENSE="LGPL-2.1" SLOT="0" -IUSE="alsa capi cups custom-cflags dbus esd fontconfig +gecko gnutls gphoto2 gsm gstreamer hal jack jpeg lcms ldap mp3 nas ncurses nls openal +opengl +oss +perl png pulseaudio samba scanner ssl test +threads +truetype +win32 +win64 +X xcomposite xinerama xml" +IUSE="alsa capi cups custom-cflags dbus esd fontconfig +gecko gnutls gphoto2 gsm gstreamer hal jack jpeg lcms ldap mousewarp mp3 nas ncurses nls openal +opengl +oss +perl png pulseaudio samba scanner ssl test +threads +truetype +win32 +win64 +X xcomposite xinerama xml" RESTRICT="test" #72375 MLIB_DEPS="amd64? ( @@ -113,6 +113,7 @@ src_unpack() { } src_prepare() { + use mousewarp && epatch "${FILESDIR}"/${PN}-1.3.14-mouse-warp.patch if use pulseaudio ; then EPATCH_OPTS=-p1 epatch `pulse_patches "${DISTDIR}"` eautoreconf |