https://bugs.winehq.org/show_bug.cgi?id=55927
Bug ID: 55927 Summary: RestoreDC appears to fail with printers Product: Wine Version: 8.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: kadlecf@fzu.cz Distribution: ---
My wine is packed within the OpenSuse Tumbleweed distribution. Since recently, I experience problems with printing from a custom application which worked in earlier wine versions. Its graphical output (mostly data represented as lines and text) is normally shown on the screen where I encounter no problems. However, currently, when the data is sent to a printer - either one with paper or the CUPS pdf printer -, it is clipped to a rectangle defined by the SaveDC function. This would be OK except that the function RestoreDC
BOOL RestoreDC ( [in] HDC hdc, [in] int nSavedDC ) ;
does not work properly with the device context hdc connected to a printer device.
In brief, the sequence
SaveDC
(functions involving clipping of the output region)
RestoreDC
does not restore the clipping region to the original one for the printer (however, it does for the screen device context).
https://bugs.winehq.org/show_bug.cgi?id=55927
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Does downgrading work? If so, you could figure out which is the last version of wine that works. Then you could do a regression test to find the actual commit.
If you can't / don't want to do a regression test, a minimal sample to reproduce the issue would be useful, if possible.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #2 from kadlecf@fzu.cz --- Created attachment 75496 --> https://bugs.winehq.org/attachment.cgi?id=75496 attempts to run the program from the PlayOnLinux console
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #3 from kadlecf@fzu.cz --- I don't know how to downgrade the wine system-wide, and am even not sure I would like to do so. But I found the possibility to run programs, in principle, under a chosen older version of wine via PlayOnLinux. So I installed that and activated the wine version 7.22 within it but, still, I was not able to run my program. The best I could do was to open the PlayOnLinux console, then I tried to run it from the shell, but it did not run. The screenshot with my attempts is attached. I did not note here before that the program (PKGraph) is compiled as a 32bit code, but I am not sure if it is important, nor whether it can be run under PlayOnLinux, selecting an old version. Any thoughts are welcome.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #4 from Fabian Maurer dark.shadow4@web.de --- PlayOnLinux is generally not supported here. You seem to be using a 32bit version of wine which doesn't work with your 64bit WINEPREFIX. Like the error message tells you.
There is no harm downgrading system wine, you can always just update it again later
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #5 from kadlecf@fzu.cz --- I don't know how I could use the 32bit version of wine; I just installed it via the software manager Yast, and I did not choose 32 bit anywhere. True, the PKGraph application is compiled as 32bit, but I thought it was running under the 64bit server which has the ability to do so. So I am confused in this respect.
As for substantially downgrading the wine version under OpenSUSE Tumbleweed, I agree that it would do no harm if this were controlled by the distribution tools. However, being a fairly inexperienced user, I did not find a reasonable means to do so. I would appreciate any advice.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #6 from Fabian Maurer dark.shadow4@web.de --- Sorry, I don't know much about OpenSUSE Tumbleweed. However, if you could provide a minimal sample that reproduces the issue, I could do the testing for you.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #7 from kadlecf@fzu.cz --- Created attachment 75551 --> https://bugs.winehq.org/attachment.cgi?id=75551 testcase- software producing faulty print output
The attachment zip contains a kind of a minimal example. There is an installation utility installing the software. Once you run PKGraph.exe, you should be able to open the attached file test.ts1. Some graphs will show up on the page on the screen. However, printing to the cups-pdf printer produces the test.ps file where the clipping hides a major part of the objects.
https://bugs.winehq.org/show_bug.cgi?id=55927
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |piotr@codeweavers.com Regression SHA1| |7034fc297bf730427c6c808cb3f | |574b56f50b60f
--- Comment #8 from Fabian Maurer dark.shadow4@web.de --- Thanks, bisected to
commit 7034fc297bf730427c6c808cb3f574b56f50b60f Author: Piotr Caban piotr@codeweavers.com Date: Mon May 1 13:11:42 2023 +0200
winspool: Change CUPS printers print processor to wineps.
Not sure how useful that is though. Reverting is possible, but only breaks printing.
https://bugs.winehq.org/show_bug.cgi?id=55927
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #9 from Piotr Caban piotr.caban@gmail.com --- It looks like the same clipping bug I've seen in bug 55950. I'm currently working on it.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #10 from Piotr Caban piotr.caban@gmail.com --- I've sent a patch that probably fixes this bug: https://gitlab.winehq.org/wine/wine/-/merge_requests/4549
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #11 from Fabian Maurer dark.shadow4@web.de --- Yes, I can confirm this fixes the issue, great work!
https://bugs.winehq.org/show_bug.cgi?id=55927
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |4843daaee128ec5f4643d041139 | |ce8f52e13df27 Resolution|--- |FIXED
--- Comment #12 from Fabian Maurer dark.shadow4@web.de --- Fixed by https://gitlab.winehq.org/wine/wine/-/commit/4843daaee128ec5f4643d041139ce8f...
https://bugs.winehq.org/show_bug.cgi?id=55927
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.0-rc1.
https://bugs.winehq.org/show_bug.cgi?id=55927
--- Comment #14 from kadlecf@fzu.cz --- I verified that the issue is gone in wine-9.0-rc1.