After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 148184 - cups instances ignored
cups instances ignored
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Printing
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-22 15:41 UTC by Andreas J. Guelzow
Modified: 2018-05-02 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first patch with refactoring to avoid duplicate code (3.01 KB, patch)
2015-10-01 16:26 UTC, Michael Weghorn
none Details | Review
second patch with refactoring to avoid duplicate code (3.28 KB, patch)
2015-10-01 16:26 UTC, Michael Weghorn
none Details | Review
patch that adds support for CUPS printer instances (12.99 KB, patch)
2015-10-01 16:27 UTC, Michael Weghorn
none Details | Review
first patch with refactoring to avoid duplicate code (3.02 KB, patch)
2018-03-15 13:06 UTC, Michael Weghorn
none Details | Review
second patch with refactoring to avoid duplicate code (3.29 KB, patch)
2018-03-15 13:07 UTC, Michael Weghorn
none Details | Review
patch that adds support for CUPS printer instances (13.07 KB, patch)
2018-03-15 13:10 UTC, Michael Weghorn
none Details | Review

Description Andreas J. Guelzow 2004-07-22 15:41:47 UTC
If a user configured a second (or third or ...) instance for a printer, only one
instance appears in the print dialog.  (For a while the other instances were
visible as alternative settings, but that appears to have disappeared again.)
Comment 1 Jody Goldberg 2004-07-22 20:05:34 UTC
Any thoughts on how to display a printer with multiple instances
Should the parent appear as well as the instances ? or just the instances ?
Comment 2 Andreas J. Guelzow 2004-07-23 06:00:28 UTC
Different instances of the same printer differ only in the settings, so I had
thought that they should appear as differnet settings. Currently every printer
in gnome-print has a single setting called default. I think the "default"
setting should be setting for the parent printer (Instance==NULL). The other
instances should be shown as other instances. (As they were just prior to
turning the print dialog into a print manager. I guess the UNIX idea of
separating different functions has gone out of the window.) 
Comment 3 Jody Goldberg 2004-07-26 13:14:24 UTC
Interesting.  I had a rather different perspective on the function of instances.
 I'd always seen them as specific printers in a pool.

PS
  The new printer selector seems like an improvement from the old static list. 
We don't want a full on printer manager in there, but having the list include
the number of outstanding jobs is an improvement in my eyes.
Comment 4 Andreas J. Guelzow 2004-07-29 19:33:10 UTC
Cups also has the concept of classes, that are a pool of printers to which you
can send a print job and then cups figures out which printer to use.

Of course I have no idea how they are reflected in the new dialog if at all.
They are really more important than to see how busy an individual printer is. If
several printers could be used for the same purpose then a class should have
been configured, rather than having the user look at the number of jobs pending
for each printer.
Comment 5 Johan Brannlund 2005-05-06 00:57:15 UTC
Has there been any progress on this issue since last year? For now, I can get by
using xpp to see my instances but I'd really like to be able to select them from
the gnome print dialog. There's some commented-out code for instances in
libgnomeprint/modules/cups/gnome-print-cups.c but that doesn't compile when the
comments are removed.

Comment 6 Andreas J. Guelzow 2005-05-06 05:04:30 UTC
The commented-out code used to support instances. Then, when a-synchronous
access was introduced the code was commented out, and support for instances lapsed.

I currently work around the limitation by creating duplicate printers with
different defaults rather than setting up instances. Perhaps that may be a
solution for you too.
Comment 7 Johan Brannlund 2006-05-09 05:32:54 UTC
I noticed that printing has recently been committed to gtk - does that have any bearing on this bug? In particular, is libgnomeprint slated to be removed? If so, maybe it'd be good to try to get support for instances into the gtk printing while people are still actively hacking on it.

Comment 8 Kjartan Maraas 2007-02-07 17:18:30 UTC
Yeah, new features should definitely go into gtk+ at this point.
Comment 9 Kjartan Maraas 2009-05-16 10:21:42 UTC
Moving to gtk+
Comment 10 Timothy Arceri 2015-04-30 23:38:00 UTC
Seems to be working correctly for me. Please reopen if this is still a problem.
Comment 11 Marek Kašík 2015-09-15 12:11:28 UTC
Hi Timothy,

I don't see the instances in the print dialog. Which version of Gtk+ and CUPS do you have? How have you created the instances?
Comment 12 Michael Weghorn 2015-09-24 20:21:37 UTC
(In reply to Marek Kašík from comment #11)
> Hi Timothy,
> 
> I don't see the instances in the print dialog. Which version of Gtk+ and
> CUPS do you have? How have you created the instances?

I also cannot see CUPS printer instances in a recent master build of GTK+. It would be great if this bug could therefore be reopened.
Comment 13 Timothy Arceri 2015-09-25 01:40:56 UTC
I don't have time to look at this right now but I've reopened the bug.
Comment 14 Michael Weghorn 2015-10-01 16:24:38 UTC
I have worked on an implementation that treats each CUPS printer instance as a GtkPrinter.

I attach the 3 patches that add support for printer instances.
The first two patches do some refactoring to avoid that the implementation introduces a lot of duplicate code.
The 3rd patch contains the "actual implementation" of printer instances.

Please let me know whether the approach taken in that implementation is OK in general and which things I should improve to get this accepted. (I am not a very experienced C programmer, particularly when it comes to C89 and the Gtk+ coding style.)
Comment 15 Michael Weghorn 2015-10-01 16:26:00 UTC
Created attachment 312507 [details] [review]
first patch with refactoring to avoid duplicate code
Comment 16 Michael Weghorn 2015-10-01 16:26:34 UTC
Created attachment 312508 [details] [review]
second patch with refactoring to avoid duplicate code
Comment 17 Michael Weghorn 2015-10-01 16:27:01 UTC
Created attachment 312509 [details] [review]
patch that adds support for CUPS printer instances
Comment 18 Matthias Clasen 2018-02-10 05:23:03 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 19 Michael Weghorn 2018-03-15 13:06:18 UTC
Created attachment 369731 [details] [review]
first patch with refactoring to avoid duplicate code
Comment 20 Michael Weghorn 2018-03-15 13:07:44 UTC
Created attachment 369732 [details] [review]
second patch with refactoring to avoid duplicate code
Comment 21 Michael Weghorn 2018-03-15 13:10:30 UTC
Created attachment 369733 [details] [review]
patch that adds support for CUPS printer instances
Comment 22 Michael Weghorn 2018-03-15 13:18:13 UTC
(In reply to Matthias Clasen from comment #18)
> We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO
> if they haven't seen activity in more than a year. If this issue is still
> important to you and still relevant with GTK+ 3.22 or master, please reopen
> it and we will migrate it to gitlab.

This is still relevant. Can somebody with sufficient privileges please reopen? (It seems I don't have permissions to do so myself, since I am not the initial reporter.)

I have attached updated patches that implement support for CUPS printer instances for the current "gtk-3-22" git branch. The update also includes a few small fixes for memory leaks that a colleague who is a more experienced C programmer found while getting over the patches.

Those patches (and a Gtk 2 backport) have been in use in our organisation (about 18,000 Linux clients) for more than two years now, with no problems being reported so far.

Is it still the right way to attach patches here or should I rather create a merge request on GNOME's GitLab instance?
Comment 23 GNOME Infrastructure Team 2018-05-02 14:03:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/236.