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 460908 - gtk_paper_size_get_[width|height] doesn't support GTK_UNIT_PIXEL
gtk_paper_size_get_[width|height] doesn't support GTK_UNIT_PIXEL
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-07-27 11:59 UTC by Christian Persch
Modified: 2012-05-04 01:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
document functions that reject GTK_UNIT_PIXEL for units parameter (2.87 KB, patch)
2012-02-20 13:26 UTC, David King
none Details | Review
printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE (5.87 KB, patch)
2012-05-03 23:17 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Christian Persch 2007-07-27 11:59:03 UTC
Steps:
0) gtk_paper_size_get_width (paper_size, GTK_UNIT_PIXEL)

Results:
Gtk-WARNING **: Unsupported unit

(gdb) where
  • #0 g_log
    at gmessages.c line 516
  • #1 _gtk_print_convert_from_mm
    at gtkprintutils.c line 57
  • #2 gtk_paper_size_get_width
    at gtkpapersize.c line 638

The docs don't mention that PIXEL isn't supported here. Same applies for gtk_paper_size_get_default_*_margin.
Comment 1 David King 2012-02-20 13:26:12 UTC
Created attachment 208039 [details] [review]
document functions that reject GTK_UNIT_PIXEL for units parameter
Comment 2 Allison Karlitskaya (desrt) 2012-05-03 23:08:55 UTC
I did a bit of review of the code -- it looks like the 'pixel' unit is basically used nowhere except for the case that a unit hasn't been specified in the print operation (in which case no transformation is used for cairo).

I wonder if we should perhaps not rename it to GTK_UNIT_NONE at which point it would be more evident that you can't use it with the other functions...
Comment 3 Allison Karlitskaya (desrt) 2012-05-03 23:17:55 UTC
Created attachment 213422 [details] [review]
printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE

...and document that many functions don't accept "none" as a unit.
Comment 4 Matthias Clasen 2012-05-04 00:57:57 UTC
Review of attachment 213422 [details] [review]:

sure, why not
Comment 5 Allison Karlitskaya (desrt) 2012-05-04 01:31:01 UTC
Attachment 213422 [details] pushed as 88c6390 - printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE