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 701751 - GtkProgressBar causes warnings
GtkProgressBar causes warnings
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.24.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-06-06 15:51 UTC by Ivan Stankovic
Modified: 2013-11-10 04:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch that fixes the problem (1.12 KB, patch)
2013-06-06 15:51 UTC, Ivan Stankovic
committed Details | Review

Description Ivan Stankovic 2013-06-06 15:51:04 UTC
Created attachment 246169 [details] [review]
A patch that fixes the problem

When doing updates, gtk_progress_bar_real_update can calculate
compute a negative value for activity_pos:

              if (pbar->activity_dir == 0)
                {
                  pbar->activity_pos += pbar->activity_step;
                  if (pbar->activity_pos + size >=
                      widget->allocation.width -
                      widget->style->xthickness)
                    {
                      pbar->activity_pos = widget->allocation.width -
                        widget->style->xthickness - size;
                      pbar->activity_dir = 1;
                    }
                }

If the allocation width is smaller than (xthickness + size),
pbar->activity_pos will be set to a negative value and this will
cause the drawing code to emit a warning about coordinates being
out of bounds (in this case x will be negative).

The fix is to make activity_pos always positive, like the attached
patch does.