[Bug 77844] Re: displayconfig-restore.py can crash kde login with ZeroDivisionError
sebas
sebas at kde.org
Wed Jan 3 20:03:11 UTC 2007
SVN commit 619592 by sebas:
Don't crash displayconfig-restore when screenwidth and height are bogus, use
a sensible value of 96 instead. Thanks to Michael Blakeley for reporting.
CCMAIL:mike+ubuntu at blakeley.com,77844 at bugs.launchpad.net
M +8 -2 displayconfig-restore.py
--- trunk/playground/base/guidance/displayconfig/displayconfig-restore.py #619591:619592
@@ -81,8 +81,14 @@
xserver = xf86misc.XF86Server()
if len(xserver.getScreens())!=0:
(width,height,width_mm,height_mm) = xserver.getScreens()[0].getDimensions()
- w_dpi = float(width)/(float(width_mm)/25.4)
- h_dpi = float(height)/(float(height_mm)/25.4)
+ if not float(width_mm) == 0:
+ w_dpi = float(width)/(float(width_mm)/25.4)
+ else:
+ w_dpi = 96
+ if not float(height_mm) == 0:
+ h_dpi = float(height)/(float(height_mm)/25.4)
+ else:
+ h_dpi = 96
dpi = (w_dpi+h_dpi)/2.0 # Average the two possible DPIs.
if dpi >= 140: # Anything above 140 is ok.
** Changed in: kde-guidance (Ubuntu)
Assignee: (unassigned) => sebas
Status: Unconfirmed => Fix Committed
--
displayconfig-restore.py can crash kde login with ZeroDivisionError
https://launchpad.net/bugs/77844
More information about the kubuntu-bugs
mailing list