http://bugs.winehq.org/show_bug.cgi?id=13951
Summary: SetParent doesn't behave properly Product: Wine Version: 1.0-rc5 Platform: PC-x86-64 OS/Version: Linux Status: NEW Keywords: source Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: dmitry@codeweavers.com
Created an attachment (id=14100) --> (http://bugs.winehq.org/attachment.cgi?id=14100) Sample application with source
Attached sample application behaves properly under Windows but makes a popup window unmoveable and not responsive after a SetParent call.
http://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #1 from Dmitry Timoshkov dmitry@codeweavers.com 2008-06-16 09:50:51 --- Created an attachment (id=14101) --> (http://bugs.winehq.org/attachment.cgi?id=14101) Preliminary work in progress patch
This patch makes the window moveable, but it the coordinates are busted. It looks like that even adding a SetWindowPos call in SetParent doesn't help to remap window coordinates to a new parent.
http://bugs.winehq.org/show_bug.cgi?id=13951
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, testcase
http://bugs.winehq.org/show_bug.cgi?id=13951
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
--- Comment #2 from Austin English austinenglish@gmail.com 2008-12-24 10:49:50 --- Still present in git.
http://bugs.winehq.org/show_bug.cgi?id=13951
Luke Benstead kazade@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kazade@gmail.com
--- Comment #3 from Luke Benstead kazade@gmail.com 2009-08-16 02:10:25 --- Still present in 1.1.27
http://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-03 04:20:00 CST --- It appears that SetWindowPos() called from SetParent() fails to make the window foreground if new parent of the window is not desktop. I.e. if the window is WS_POPUP and its parent is desktop, and then SetParent() replaces desktop with a new parent which is a WS_CHILD window, server/queue.c,set_foreground_window() refuses to make WS_POPUP window a foreground one, therefore all mouse input gets ignored for that window.
The only relevant part which fixes the bug is:
diff --git a/server/window.c b/server/window.c index 635dd9b..c7ccc27 100644 --- a/server/window.c +++ b/server/window.c @@ -559,7 +559,7 @@ int is_child_window( user_handle_t parent, user_handle_t child ) int is_top_level_window( user_handle_t window ) { struct window *win = get_user_object( window, USER_WINDOW ); - return (win && (is_desktop_window(win) || is_desktop_window(win->parent))); + return (win && ((win->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)); }
/* make a window active if possible */
http://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #5 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-04 03:15:57 CST --- The following test should show the root of the problem:
http://www.winehq.org/pipermail/wine-patches/2011-February/098532.html
Once the failing test is fixed, the reparented window should become movable.
http://bugs.winehq.org/show_bug.cgi?id=13951
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |joshudson@gmail.com
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru 2011-06-21 03:27:16 CDT --- *** Bug 13404 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #7 from GreatEmerald pastas4@gmail.com 2013-10-14 13:13:28 CDT --- Created attachment 46298 --> http://bugs.winehq.org/attachment.cgi?id=46298 Patch adapted to wine 1.7.4
This bug is still present in at least wine 1.7.2 (I think it's in wine 1.7.4 as well since nothing about it has been updated between the two releases).
This bug is important to fix since the current functionality breaks UnrealEd (versions 2 and 3), which relies upon reparenting a popup window for the viewports. See bug #17455 for more information on it.
I adapted the patch in comment #4 to wine 1.7.4 and attached it. It does fix the issue with no input being handled at all, both in UnrealEd and the test program in this issue.
Is there any reason why this bug hasn't been fixed yet? You do have a testcase and a patch, is there anything else missing that is preventing it from being merged?
http://bugs.winehq.org/show_bug.cgi?id=13951
GreatEmerald pastas4@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pastas4@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #8 from Dmitry Timoshkov dmitry@baikal.ru 2013-10-14 19:20:29 CDT --- (In reply to comment #7)
Is there any reason why this bug hasn't been fixed yet? You do have a testcase and a patch, is there anything else missing that is preventing it from being merged?
It's no that simple. At the time I sent the following patches which were supposed to fix another part of Setparent() bug they were missing winex11.drv side of the problem, now since winemac.drv has been introduced it needs same kind of fixes, and therefore some needs to take care of it as well.
http://www.winehq.org/pipermail/wine-patches/2011-February/098748.html http://www.winehq.org/pipermail/wine-patches/2011-February/098749.html http://www.winehq.org/pipermail/wine-patches/2011-February/098750.html
http://bugs.winehq.org/show_bug.cgi?id=13951
Johan Gardhage johan.gardhage@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |johan.gardhage@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=13951
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=13951
--- Comment #9 from GreatEmerald pastas4@gmail.com --- Looks like this has been fixed now (1.7.25). The sample application behaves correctly, and the other programs that had problems due to this (UnrealEd) now work correctly as well.
https://bugs.winehq.org/show_bug.cgi?id=13951
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |de21941178fcf22f44b9c3d5bf7 | |221846d723ab6 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- Looks like the remaining part from my patch for server/window.c was commited as a part of de21941178fcf22f44b9c3d5bf7221846d723ab6.
Thanks for testing.
https://bugs.winehq.org/show_bug.cgi?id=13951
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.26.