http://bugs.winehq.org/show_bug.cgi?id=31702
--- Comment #22 from voidcastr cephryx@gmx.net 2012-09-23 11:16:01 CDT --- Based on the current git, I was able to narrow the problem down to dlls/winex11.drv/mouse.c:504.
The observed behavior of "every second time the mouse is bound" etc. was a misinterpretation and subject to the player's individual rate of click-dragging in order to turn the camera. This is also the reason why only few players reported this bug. More details on this in the "long version" below.
--------------------------- TL/DR version:
- from dlls/winex11.drv/mouse.c, remove line 504 --OR-- change the "1000" it contains to "10" - the original line is: "if (GetTickCount() - thread_data->clip_reset < 1000) return FALSE;" - recompile wine - check if this fix works for you
--------------------------- Long version (primarily interesting for Henri):
In dlls/winex11.drv/mouse.c,
BOOL clip_fullscreen_window( HWND, BOOL )
sometimes fails to call
static BOOL grab_clipping_window( const RECT )
which activates XI 2, which is required for raw input, which is used for GW2's mouse look.
This is because the condition in line 504
if (GetTickCount() - thread_data->clip_reset < 1000) return FALSE;
is "sometimes" fulfilled, causing the method to return early. In all cases, both GetTickCount() and thread_data->clip_reset contain sensible values (i.e. they are never zero). Their difference is just sometimes too small which results in occasionally returning FALSE.
The mentioned condition seems to be nothing more than a way of "throttling" possible calls to grab_clipping_window: The calculated difference basically represents the time passed since the last clipping reset operation (let's call it like that). GetTickCount() thereby must be something similar to "the time the application is running".
Now it gets interesting: A clipping reset operation seems to be triggered when pressing or releasing a mouse button. Thus, "1000" is the number of milliseconds that must have passed after releasing a mouse button that was pressed in order to trigger raw input, before grab_clipping_window can be called again by pressing the mouse button once more.
In GW2, this corresponds to "turning the camera", "releasing the mouse button" and then "immediately turning the camera again" -- and for many players it is not uncommon to do this in a succession faster than 1000 ms.
As expected, simply removing the line (504) seems to solve the problem for Guild Wars 2. An alternative persists in significantly lowering the original value of "1000". I tried various values there, and for me "10" (ms) was a convenient number I can never go below between two clicks (while 15 was still too high when trying really hard).
After removing or adjusting the line as described, I can now turn the camera in Guild Wars 2 without any constaint.
Though the removal or change of the above check does not seem to cause new problems, I can't tell yet if it breaks something for another application. Sadly, I don't possess another one using raw input.