CCSM: <precision> tag just works for float, but not for int, a workaround is known and tested

Bug #1168877 reported by MC Return
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
New
Low
MC Return

Bug Description

The <precision> tag in the .xml files will not work for int values. It gets ignored.

The definition seems to be:

typedef struct _CompOptionIntRestriction
{
    int min;
    int max;
} IntRestriction;

in src/privateoption.h

Note:
This will require a patching of several files, it does not seem to be trivial.

As workaround we could use floats that get converted to ints by Compiz afterwards, so
a float with precision 5.0f would be read and converted to (int) later.
This workaround is now tested and works perfectly as expected, so for example a percent setting can be expressed as min 0.0f, max 100.0f, precision 5.0f and in the code we can do a: int percent = (int) optionGetPercent ();

MC Return (mc-return)
Changed in compiz:
assignee: nobody → MC Return (mc-return)
description: updated
Changed in compiz:
status: New → In Progress
MC Return (mc-return)
Changed in compiz:
status: In Progress → New
MC Return (mc-return)
description: updated
MC Return (mc-return)
Changed in compiz:
importance: Undecided → Low
milestone: none → 0.9.10.0
MC Return (mc-return)
description: updated
summary: - CCSM: <precision> tag just works for float, but not for int
+ CCSM: <precision> tag just works for float, but not for int, a
+ workaround is known and tested
Changed in compiz:
milestone: 0.9.10.0 → 0.9.10.2
MC Return (mc-return)
Changed in compiz:
milestone: 0.9.10.2 → 0.9.11.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.