Closed Bug 178045 Opened 22 years ago Closed 22 years ago

floating point error when using gtk2 on startup

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: blizzard, Assigned: blizzard)

References

Details

Attachments

(2 files, 2 obsolete files)

From bug #176842: ------- Additional Comment #11 From Geoff Leach 2002-11-01 21:55 ------- With this patch (from CVS checkout based build) I get ###!!! ASSERTION: Computed Size < 0: 'aReflowState.mComputedWidth >=0 && aReflowState.mComputedHeight >= 0', file nsBoxFrame.cpp, line 803 Break: at file nsBoxFrame.cpp, line 803 /home/gl/mozilla/dist/bin/run-mozilla.sh: line 444: 1147 Floating point exception"$prog" ${1+"$@"} When I back the patch out the above does not occur. .mozconfig ac_add_options --enable-svg ac_add_options --enable-crypto ac_add_options --enable-default-toolkit=gtk2 ac_add_options --disable-toolkit-gtk ac_add_options --disable-toolkit-qt ac_add_options --enable-xft ac_add_options --enable-freetype2 ac_add_options --enable-cpp-rtti ac_add_options --enable-cpp-exceptions ac_add_options --enable-extensions ac_add_options --with-system-jpeg ac_add_options --with-system-zlib ac_add_options --with-system-png ac_add_options --with-system-mng #ac_add_options --enable-calendar MOZ_INTERNAL_LIBART_LGPL=1 mk_add_options MOZ_INTERNAL_LIBART_LGPL=1 #MOZ_CALENDAR=1 #mk_add_options MOZ_CALENDAR=1
Blocks: gtk2
OK, then, something is still wrong. I need some pieces of information: Are you using Red Hat 8.0? Are you using a hand built copy of Gtk? If so, what version? Can you do an: 'xrdb -q -all' and paste the output here? (I'm looking specifically for a line that says something like 'Xft.dpi: 96.0000000') If you're really adventurous, we can do some debugging. I suspect that GetOSDPI() is returning a bogus value - I just want to know what part of it is doing so.
Output from xrdb -q -all
Yes, stock "up2date'd" RH 8.0 which has gtk2-2.0.6-8 >xrdb -q -all | grep -i dpi Xft.dpi: 96 (but not "Xft.dpi: 96.0000000")
If you're using RH8 with gtk2 you shouldn't even get that far: if (spec) { g_object_get(G_OBJECT(settings), "gtk-xft-dpi", &dpi, NULL); } if (dpi) return NSToCoordRound(dpi / PANGO_SCALE); Can you tell me what is being returned there?
dpi is being set to -1 from the call to g_object_get In /usr/include/pango-1.0/pango/pango-types.h #define PANGO_SCALE 1024 return value is 0 due to integer division of dpi / PANGO_SCALE
Just tried using Gnome rather than KDE. It works. dpi:98304 PANGO_SCALE: 1024 return value: 96
Wait, are you saying that if you log in using a KDE-based desktop that that call is returning a -1? wtf?
Attached patch patch (obsolete) — Splinter Review
Owen says that (surprise!) the default is -1 if the value is unset. Easy to detect.
Attached patch patch (obsolete) — Splinter Review
also, the scale factor is 1024, unrelated to PANGO_SCALE
Attachment #105111 - Attachment is obsolete: true
Attached patch patchSplinter Review
Add a .0 to promote the divisor to a float.
Attachment #105112 - Attachment is obsolete: true
Comment on attachment 105114 [details] [diff] [review] patch from irc: r=otaylor
Attachment #105114 - Flags: review+
Comment on attachment 105114 [details] [diff] [review] patch sr=scc
Attachment #105114 - Flags: superreview+
Comment on attachment 105114 [details] [diff] [review] patch a=rjesup@wgate.com for trunk; please consider for 1.0 branch too (this appears to be general gtk code; I'm not sure if it's relevant to 1.0)
Attachment #105114 - Flags: approval+
Checked in. Just FYI, this code isn't on the 1.0 branch at all.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: