[Bug 36153] New: Borderlands 2 mouse focus no longer works properly
https://bugs.winehq.org/show_bug.cgi?id=36153 Bug ID: 36153 Summary: Borderlands 2 mouse focus no longer works properly Product: Wine Version: 1.7.17 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs(a)winehq.org Reporter: erich.e.hoover(a)gmail.com Regression SHA1: 4d40aea0bde11e8c856c1c7047a429836b95998e Using the mouse for the menus in Borderlands 2 no longer sets the appropriate focus. Items in the background frequently maintain the focus instead of the menu that opened. Regression testing points to: 4d40aea0bde11e8c856c1c7047a429836b95998e is the first bad commit commit 4d40aea0bde11e8c856c1c7047a429836b95998e Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 17 13:07:00 2014 +0200 msvcr100: Share the source code with msvcrt. :040000 040000 d736562de0aa311ff4841b671ed018a859d74a84 46cbf9e06828dc989b3e09eeb310dfb654d79de2 M dlls :040000 040000 c4ce5030770a19ed507850f7664c0f178a7bf870 21c8e818efa0aa5ee052037d70c82372f1165463 M tools -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 Erich Hoover <erich.e.hoover(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr(a)codeweavers.com --- Comment #1 from Erich Hoover <erich.e.hoover(a)gmail.com> --- Whoops, forgot to add Piotr to the CC list. Note: As I have time I'll try to do a linear search for the responsible function, I assume that version-specific behavior is responsible for the problem. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban(a)gmail.com --- Comment #2 from Piotr Caban <piotr.caban(a)gmail.com> --- Without the patch wine was using native msvcr100 by default. Probably it never worked with builtin msvcr100.dll. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 Jerome Leclanche <adys.wh(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #3 from Piotr Caban <piotr.caban(a)gmail.com> --- Please attach a log with msvcrt,tid,seh,relay debug channels. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #4 from Jerome Leclanche <adys.wh(a)gmail.com> --- I can't get you a relay log. It grows to 3 gigabytes within seconds and no matter how much stuff I add in RelayExclude it's still unusable. RelayFromExclude doesn't seem to do anything either... Without +relay it's crashing. Looking into it, might be one of my patches. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #5 from Erich Hoover <erich.e.hoover(a)gmail.com> --- I'm sorry I haven't had a chance to get to this yet, been a little busy with work. Is it possible to easily forward individual calls to the native DLL with the spec file? That might help narrow things down. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #6 from Jerome Leclanche <adys.wh(a)gmail.com> --- Created attachment 48333 --> https://bugs.winehq.org/attachment.cgi?id=48333 Screenshot of behaviour This is a screenshot showcasing the issue with the video screen. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #7 from Jerome Leclanche <adys.wh(a)gmail.com> --- Created attachment 48334 --> https://bugs.winehq.org/attachment.cgi?id=48334 WINEDEBUG=msvcrt,tid,seh WINEPREFIX=~/.local/share/wineprefixes/steam ~/src/wine/build32/wine Borderlands2.exe -NoLauncher &> out.txt Debug output attached. No +relay for the reasons highlighted above, sorry -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #8 from Piotr Caban <piotr.caban(a)gmail.com> --- Could you please attach output of `winedump -j import BorderLands2.exe` as well? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #9 from Erich Hoover <erich.e.hoover(a)gmail.com> --- Created attachment 48335 --> http://bugs.winehq.org/attachment.cgi?id=48335 BL2 executable linking dump (In reply to Piotr Caban from comment #8)
Could you please attach output of `winedump -j import BorderLands2.exe` as well?
Ah-ha, that I can do from work! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #10 from Piotr Caban <piotr.caban(a)gmail.com> --- The game is using qsort in broken way. It uses comparator that always returns 1 and expects that data is reordered in some specific way. In order to fix it wine's qsort implementation needs to call comparator in the same way as native does. The way comparator is called is not preserved between different versions of msvcrXX.dll (I've checked only msvcrt.dll and msvcr100.dll). It looks like msvcrt uses very similar sorting algorithm as glibc. It uses qsort (pivot element is selected from 3 elements) and falls back to insertion sort on small portions of table (with less than 9 elements). Adding something like this in qsort_s fixes Borderlands 2 for me: /* Borderlands 2 depends on comparator calling order for small tables */ if (nmemb <= 8) { MSVCRT_size_t e, i; char *max, *p, tmp; for(e=nmemb; e>1; e--) { max = base; for(i=1; i<e; i++) { p = (char*)base + i*size; if(compar(context, p, max) > 0) max = p; } if(p != max) { for(i=size; i; i--) { tmp = *max; *max++ = *p; *p++ = tmp; } } } return; } -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #11 from Erich Hoover <erich.e.hoover(a)gmail.com> --- (In reply to Piotr Caban from comment #10)
... The way comparator is called is not preserved between different versions of msvcrXX.dll (I've checked only msvcrt.dll and msvcr100.dll). ... Adding something like this in qsort_s fixes Borderlands 2 for me: ...
Fixes the problem for me as well. Is this something where AJ would allow a "#define MSVCR100"/"#ifdef MSVCR100" so that msvcr100 has this behavior without breaking other versions? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 Luke Bratch <l_bratch(a)yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |l_bratch(a)yahoo.co.uk -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 mikachu(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikachu(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #12 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Erich Hoover from comment #11)
Fixes the problem for me as well. Is this something where AJ would allow a "#define MSVCR100"/"#ifdef MSVCR100" so that msvcr100 has this behavior without breaking other versions? I think that better solution is to rewrite qsort so it doesn't allocate additional memory. While doing it one can implement fallback to simpler sort for small partitions. This way the function will be much more similar to native implementation.
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 --- Comment #13 from Piotr Caban <piotr.caban(a)gmail.com> --- It should be working now. Please retest. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=36153 Erich Hoover <erich.e.hoover(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b703afda86ef962c617ff33f7b8 | |a552ea550d1e5 Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #14 from Erich Hoover <erich.e.hoover(a)gmail.com> --- Yup, that did the trick - thanks so much! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=36153 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #15 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.7.20. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org