http://bugs.winehq.org/show_bug.cgi?id=13886
Summary: Focus is killed after unminimizing the window Product: Wine Version: CVS/GIT Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P4 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: dylan.ah.smith@gmail.com
Steps to produce the bug: 1. Open up Wine's wordpad wine wordpad 2. Minimize the window 3. Restore the window Afterwards the window will have focus but the caret will not be shown.
I tested this on KDE 3.5.9 and Gnome 2.22.2 with the same bug occurring on both.
I tested wordpad in Windows XP SP3, and there was no issue there. I tested with WINEDLLOVERRIDES="riched20=n" and the bug occurred.
From this I believe that it isn't a wordpad, or richedit issue.
I added some MESSAGE statements to find the sequence of events that cause the cursor not to be shown, and this is what I found.
1. After the window is minimized WM_KILLFOCUS is sent to the richedit control as expected. 2. After the window is restored, WM_SETFOCUS is sent as expected, then another WM_KILLFOCUS is incorrectly sent which will cause the caret to be hidden and destroyed.
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #1 from Dylan Smith dylan.ah.smith@gmail.com 2008-06-13 10:18:06 --- I found out that it is the main window that got the focus at the end rather than the richedit control within the main window.
http://bugs.winehq.org/show_bug.cgi?id=13886
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |programs Summary|Focus is killed after |In wordpad focus is killed |unminimizing the window |after unminimizing the | |window
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2008-06-13 14:11:29 --- So this happens with Wine's wordpad only? Not Notepad or any other program?
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #3 from Dylan Smith dylan.ah.smith@gmail.com 2008-06-13 14:53:31 --- The issue would not be noticeable in Notepad because when the window receives a WM_SETFOCUS event, it will immediately set the focus on the edit control. Wordpad does not do this, so the bug is visible.
Maybe I am confused though, because I tried taking out the line that changed focus to the edit control in notepad's source, and then cross compiled it for Windows. After that the issue was noticeable in Windows.
I will completely rebuild everything for the newest release candidate and then do some more testing.
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #4 from Dylan Smith dylan.ah.smith@gmail.com 2008-06-13 16:51:54 --- Created an attachment (id=13980) --> (http://bugs.winehq.org/attachment.cgi?id=13980) Difference between notepad and wordpad regarding this issue.
I have figured out why there is a difference between wordpad and notepad on this issue. Wordpad sets the focus on the richedit control on WM_ACTIVATE, but Notepad sets the focus on the edit control on WM_SETFOCUS.
I have attached a patch shows the difference, and can be used in order to test the issue in notepad. With this patch the issue will be present under wine, but not in windows.
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #5 from Dmitry Timoshkov dmitry@codeweavers.com 2008-06-13 23:06:12 --- IMO it's better to fix wordpad to follow what notepad does, and then investigate the WM_ACTIVATE problem separately (with test cases).
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #6 from Dylan Smith dylan.ah.smith@gmail.com 2008-06-14 01:44:38 --- Created an attachment (id=13989) --> (http://bugs.winehq.org/attachment.cgi?id=13989) Workaround fix that makes wordpad work like notepad regarding this issue
Well here is the workaround fix for this bug. It has wordpad handle this situation like notepad, but this really only masks the problem.
This appears to be a user32 issue, and I am not familiar with that code. Could someone else make a test that will catch this bug, and either create a new bug report that identifies the problem more precisely or fix the bug.
It appears as if user32/winpos.c:show_window() is significant, since the call to SetWindowPos at line 1051 causes the WM_ACTIVATE message to be sent to the main window, and the focus is changed back to the window at the end of the function (line 1100) with a call to SetFocus.
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #7 from Dmitry Timoshkov dmitry@codeweavers.com 2008-06-14 04:13:38 --- Created an attachment (id=13993) --> (http://bugs.winehq.org/attachment.cgi?id=13993) Do not reset focus if it's in a child
Does the attached patch help?
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #8 from Dylan Smith dylan.ah.smith@gmail.com 2008-06-14 07:45:17 --- Dmitry Timoshkov, your patch fixes the problem.
http://bugs.winehq.org/show_bug.cgi?id=13886
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, source
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #9 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-12 00:56:06 --- That patch doesn't pass the tests, and appears to be not what Windows does.
http://bugs.winehq.org/show_bug.cgi?id=13886
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #10 from Austin English austinenglish@gmail.com 2009-01-20 02:39:13 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=13886
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |nerv@dawncrow.de Ever Confirmed|0 |1
--- Comment #11 from André H. nerv@dawncrow.de 2009-07-21 13:09:40 --- confirming in wine 1.1.26 this also happens in virtual desktop mode
http://bugs.winehq.org/show_bug.cgi?id=13886
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #12 from Austin English austinenglish@gmail.com 2010-05-19 16:45:44 --- This is your friendly reminder that there has been no bug activity for 6 months. Is this still an issue in current (1.1.44 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #13 from Dylan Smith dylan.ah.smith@gmail.com 2010-05-19 17:30:02 --- This is still an issue in the wine-1.1.44-322-g5cc00e8.
http://bugs.winehq.org/show_bug.cgi?id=13886
Dylan Smith dylan.ah.smith@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.1.26
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #14 from André H. nerv@dawncrow.de 2010-07-19 12:22:48 --- Still present in Wine 1.2
http://bugs.winehq.org/show_bug.cgi?id=13886
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #15 from Bruno Jesus 00cpxxx@gmail.com 2011-09-08 17:55:55 CDT --- Still present in 1.3.27.
http://bugs.winehq.org/show_bug.cgi?id=13886
Frédéric Delanoy frederic.delanoy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic.delanoy@gmail.com
--- Comment #16 from Frédéric Delanoy frederic.delanoy@gmail.com 2012-03-29 05:04:05 CDT --- Still present in wine-1.5.0-204-ga179b50
http://bugs.winehq.org/show_bug.cgi?id=13886
Rafal Stanilewicz washuu@eastnews.com.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |washuu@eastnews.com.pl
--- Comment #17 from Rafal Stanilewicz washuu@eastnews.com.pl 2012-10-24 15:35:58 CDT --- 1.5.15 as well, confirming.
http://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #18 from Frédéric Delanoy frederic.delanoy@gmail.com 2013-06-07 07:15:34 CDT --- Still in wine-1.5.31-225-gba40509
https://bugs.winehq.org/show_bug.cgi?id=13886
--- Comment #19 from Frédéric Delanoy frederic.delanoy@gmail.com --- Still in wine-1.9.18-121-g4e9cc30
https://bugs.winehq.org/show_bug.cgi?id=13886
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #20 from winetest@luukku.com --- Could be dupe or at least related to bug 27502. Could someone test if the patch fixes that bug too. It has source code, which hasn't been compiled. Also if you think it's dupe please mark it so.
https://bugs.winehq.org/show_bug.cgi?id=13886
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #21 from joaopa jeremielapuree@yahoo.fr --- Bug still occurs with wine-5.1.