Bug 139044 - kprinter window much wider than desktop screen and not resizable
Summary: kprinter window much wider than desktop screen and not resizable
Status: CLOSED WORKSFORME
Alias: None
Product: kdeprint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KDEPrint Devel Mailinglist
URL:
Keywords:
: 139516 139866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-20 13:37 UTC by Roman Fietze
Modified: 2008-12-31 20:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kprinter, CUPS selected (79.93 KB, image/png)
2006-12-21 10:17 UTC, Roman Fietze
Details
kprinter, lpr/lprng selected (74.65 KB, image/png)
2006-12-21 10:18 UTC, Roman Fietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Fietze 2006-12-20 13:37:57 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs

When I start kprinter, it comes up 2860 pixels wide and and 538 pixels high. It cannot be resized to some smaller width, resizing to another height is possible.

Almost all interesting parts of kprinter, e.g. the print button, fall of my monitor on its right side into all the garbage already there. :)

This is the version as delivered in the OpenSUSE KDE update repositories for 10.2.
Comment 1 Michael Goffioul 2006-12-20 14:49:34 UTC
Do you have some printer with particularly long name?
Comment 2 Roman Fietze 2006-12-20 15:32:44 UTC
No, not that I know.

Just the defaults like Mail, PS, PDF and FAX in the lower part of the printer combo box. And then our printers from a SUSE 10.0 CUPS server. Those printers are the same since months and the kprinter dialog shows up properly on 10.0 systems with kprinter from kdebase3-3.5.5-17.1, whereas on the system with the SUSE 10.2 we have kdebase3-3.5.5-125.2.

But I think I found the reason. It's the text "CUPS (Common Unix Print System)" displayed in the selection for the print system to be used in either kprinter or the print manager. The print manager (kcmshell kde-printers.desktop) shows exactly the same behaviour, but only when selecting CUPS. When I e.g. switch to "lpr/lprng" I suddenly can resize the kprinter or printer manager window to smaller widths. This seems to be independant from the language beeing used, I tried US-English and German.
Comment 3 Roman Fietze 2006-12-20 20:57:24 UTC
One should more closely to what's displayed!

The real problem seems to be the name of the CUPS server shown just below the selected printing system. On my home machine it displays "localhost: %2" and at the company this is "cups.ourdomain.de: %2" when using CUPS.

There seems to be something wrong with the port number display.
Comment 4 Johannes Studt 2006-12-21 01:17:40 UTC
Same behaviour here.

openSUSE 10.2, KDE 3.5.5 (installed from openSUSE rpms), CUPS-Server on a SuSE 10.1 box
Comment 5 Michael Goffioul 2006-12-21 09:39:24 UTC
The fact that you can't resize down the window is due to some minimal size computed for the dialog. This minimal size is automatically computed, based on the dialog's content. So the question is: what control (label, combobox...) requires so much space to show? "localhost: %2" doesn't seem so long (although there seems to be a problem in the port number display).

Can you find any control in the dialog (be sure to expand it) that would requires an unexpected large width?
Comment 6 Roman Fietze 2006-12-21 10:16:19 UTC
As said before. The only difference I can see when I switch between CUPS and lpr/lprng ist a few more tabs ("Advanced Options" and "Additional Tags") in the container above the print system selection and the "<server>:%2". One of those tabs could contain elements that stretch these panels, but how do I find out what element stretches the size? It could be the "value" column of the additional tags, but how do I find out?

The listed printers are the same when I switch printing systems.

The selection button of the selection "CUPS" vs. "lpr/lprng" has different widths. When I select "CUPS" this text field almost goes from the complete left to the right. When I select "lpr/lprng" and manually stretch kprinter I get a filler between "Print system currently used:" and the left edge, when I select CUPS this label is at the complete left edge and the button "CUPS ..." fills the complete rest of the width of kprinter.

I'll attach two PNG's showing the difference.
Comment 7 Roman Fietze 2006-12-21 10:17:36 UTC
Created attachment 19003 [details]
kprinter, CUPS selected
Comment 8 Roman Fietze 2006-12-21 10:18:14 UTC
Created attachment 19004 [details]
kprinter, lpr/lprng selected
Comment 9 Michael Goffioul 2006-12-21 10:39:29 UTC
Can you check the CUPS server name (use "System Options" button)? Is there any spaces/tabs in front of it?
Comment 10 Roman Fietze 2006-12-21 11:28:45 UTC
Sorry, neither in the text field of the system options "Cups Server"->"Host", nor inside ~/.kde/.../kdeprintrc in the line "Host=localhost".

But of course, as you can see it in the attached PNG *between* the text fields "Server:" and "localhost:%2". But those can simply be caused by the layout manager.

I downloaded the sources, once the SVN branch 3.5, once the source RPM. I'll start with the source RPM.

When looking over the sources I was wondering about kdelibs/kdeprint/cups/kmcupsmanager.cpp KMCupsManager::stateInformation(). There is one call to AString::arg with two parameters. CupsInfos::port() returns an int, therefore the version QString::arg(const QString &a, int fieldWidth) const must be called. Could this be the reason for the problem? Probably port() returned QSTring in previous versions?
Comment 11 Roman Fietze 2006-12-21 11:36:15 UTC
Yes, the function KMCupsManager::stateInformation() must be the reason for the problem. When I temporarily switch to a small port number, e.g. 20, everything looks good.
Comment 12 Cristian Tibirna 2006-12-21 12:20:57 UTC
Thanks a lot for the excellent debugging. I will make up a patch as soon as I get 2 minutes.
Comment 13 Roman Fietze 2006-12-21 12:21:59 UTC
The bug is introduced by the patch

  cups-only-accepts-localhost-ipp.diff

of the kdelibs3 source RPM as located on the OpenSUSE repository servers.

The SVN versions of KDE do not seem to have that problem.
Comment 14 Cristian Tibirna 2006-12-21 12:46:12 UTC
Exactly.

It's taking forever to download the src.rpm here and I'm 15 minutes before going to work.

Please consider wrapping the second attribute in a call of .arg() for itself and rebuild the src.rpm. You might want to ping the openSUSE people (notably the maintainer of the kdelibs rpm) for this annoying slip in their package.

I will close this bug report, since it's not a problem with KDE sources.

Thanks a lot for your excellent debugging.
Comment 15 Cristian Tibirna 2007-01-02 20:18:46 UTC
*** Bug 139516 has been marked as a duplicate of this bug. ***
Comment 16 Cristian Tibirna 2007-01-10 19:50:24 UTC
*** Bug 139866 has been marked as a duplicate of this bug. ***
Comment 17 John Layt 2008-12-31 20:33:40 UTC
Closing old Resolved status bug.