http://bugs.winehq.org/show_bug.cgi?id=23940
Summary: SetWindowPos does not work for other wine processes Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: jUrner@arcor.de
resizing windows belonging to other (wine) processes does not work. user32.dll SetWindowPos() always returns 0. somewhere down in winpos.c set_window_pos() returns FALSE
wine 1.2
http://bugs.winehq.org/show_bug.cgi?id=23940
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.2
--- Comment #1 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-08 07:44:39 --- It's supposed to work. Please provide a test case.
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #2 from jUrner@arcor.de 2010-08-08 08:25:55 --- Created an attachment (id=30051) --> (http://bugs.winehq.org/attachment.cgi?id=30051) python >= 2.6 -- user32.SetWindowPos() always returns 0
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-08 08:57:12 --- (In reply to comment #2)
Created an attachment (id=30051)
--> (http://bugs.winehq.org/attachment.cgi?id=30051) [details]
python >= 2.6 -- user32.SetWindowPos() always returns 0
Please provide a real test case, which doesn't require additional efforts, preferably in C.
http://bugs.winehq.org/show_bug.cgi?id=23940
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |dank@kegel.com Ever Confirmed|0 |1
--- Comment #4 from Dan Kegel dank@kegel.com 2010-08-08 11:39:19 --- It would be nice if the test case started the other process itself, and was written in C, but I tried the python one anyway as follows:
sh winetricks python cd .wine/drive_c/Python26 wine notepad & cp ~/swpfail-testcase.py . WINEDEBUG=+win,+relay wine python swpfail-testcase.py > log 2>&1
This shows
0024:Call user32.SetWindowPos(00010052,00000000,00000000,00000000,000001f4,000001f4,00000016) ret=1d1aaf5b trace:win:SetWindowPos hwnd 0x10052, after (nil), 0,0 (500x500), flags 00000016 trace:win:dump_winpos_flags flags: SWP_NOMOVE SWP_NOZORDER SWP_NOACTIVATE 0024:Ret user32.SetWindowPos() retval=00000000 ret=1d1aaf5b
But a quick look at dlls/user32/winpos.c makes me think that it's not currently supposed to work:
BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ) { ... if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE;
http://bugs.winehq.org/show_bug.cgi?id=23940
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #5 from Dan Kegel dank@kegel.com 2010-08-08 11:40:19 --- Oh, and I edited the test case to have the right window title for notepad.
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #6 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-08 23:42:33 --- (In reply to comment #4)
0024:Call user32.SetWindowPos(00010052,00000000,00000000,00000000,000001f4,000001f4,00000016) ret=1d1aaf5b trace:win:SetWindowPos hwnd 0x10052, after (nil), 0,0 (500x500), flags 00000016 trace:win:dump_winpos_flags flags: SWP_NOMOVE SWP_NOZORDER SWP_NOACTIVATE 0024:Ret user32.SetWindowPos() retval=00000000 ret=1d1aaf5b
But a quick look at dlls/user32/winpos.c makes me think that it's not currently supposed to work:
BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ) { ... if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE;
SetWindowPos() does: if (WIN_IsCurrentThread( hwnd )) return USER_SetWindowPos(&winpos);
return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
http://bugs.winehq.org/show_bug.cgi?id=23940
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
--- Comment #7 from Dan Kegel dank@kegel.com 2010-08-09 01:49:04 --- Thanks. To track the messages down a bit, I added a couple trace statements to unpack_message, and ran the commands
wineserver -k $WINE notepad & sleep 1 WINEDEBUG=+relay,+win,+msg $WINE winemine > winemine.log 2>&1 & sleep 1 $WINE python.exe swpfail-testcase.py wineserver -k
At the end of winemine.log, I saw
001d:Call user32.GetMessageA(0032fd7c,00000000,00000000,00000000) ret=7ec0e14b trace:msg:peek_message got type 5 msg 80000001 (WM_WINE_SETWINDOWPOS) hwnd 0x20028 wp 0 lp 41f864 trace:msg:unpack_message got WM_WINE_SETWINDOWPOS trace:msg:unpack_message line 1209: size 28, sizeof(ps->wp) 40, returning FALSE
It looks like unpack_message is returning false, and the message is being ignored by winemine, because the size being passed to unpack_message is wrong?
Looks like this might be a regression caused by
commit 5c652698970c6b8cf14a4515e4ebc6251640e5c2 Author: Alexandre Julliard julliard@winehq.org Date: Tue Mar 30 20:30:50 2010 +0200
user32: Pack the WINDOWPOS structure in messages to allow crossing 32/64 boundaries.
This change was introduced after wine-1.1.41. Does your test work with wine-1.1.41?
(Also, what app is this affecting?)
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #8 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-09 01:56:52 --- Patch sent: http://www.winehq.org/pipermail/wine-patches/2010-August/091890.html
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #9 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-09 01:59:14 --- Created an attachment (id=30064) --> (http://bugs.winehq.org/attachment.cgi?id=30064) Test for SetWindowPos() on another process window
Here a test case I used for debugging.
http://bugs.winehq.org/show_bug.cgi?id=23940
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|SetWindowPos does not work |SetWindowPos does not work |for other wine processes |for other process windows
http://bugs.winehq.org/show_bug.cgi?id=23940
--- Comment #10 from jUrner@arcor.de 2010-08-09 02:33:13 --- very nice guys ty.
the app affected is the one i am coding right now. next time around i know it's ok to open fire on notepad
http://bugs.winehq.org/show_bug.cgi?id=23940
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #30051|text/x-python |text/plain mime type| |
http://bugs.winehq.org/show_bug.cgi?id=23940
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.2.x
--- Comment #11 from Dan Kegel dank@kegel.com 2010-08-10 12:52:00 --- Nominating for 1.2.x
http://bugs.winehq.org/show_bug.cgi?id=23940
Andrew Nguyen arethusa26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #12 from Andrew Nguyen arethusa26@gmail.com 2010-08-16 17:50:33 --- Dmitry's patch was committed as ea7020480bbc975c5ca6994b178a1ffce835906c, so this is fixed.
http://bugs.winehq.org/show_bug.cgi?id=23940
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org 2010-08-20 12:39:46 --- Closing bugs fixed in 1.3.1.
http://bugs.winehq.org/show_bug.cgi?id=23940
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.2.x |---
--- Comment #14 from Alexandre Julliard julliard@winehq.org 2010-10-08 10:40:26 CDT --- Removing 1.2.x milestone from bugs fixed in 1.2.1.
http://bugs.winehq.org/show_bug.cgi?id=23940
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|regression |testcase Fixed by SHA1| |ea7020480bbc975c5ca6994b178 | |a1ffce835906c CC| |focht@gmx.net Regression SHA1| |5c652698970c6b8cf14a4515e4e | |bc6251640e5c2
http://bugs.winehq.org/show_bug.cgi?id=23940
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression