Jannis Pohlmann jannis at xfce.org
Thu Feb 19 01:03:01 CET 2009


Am Wed, 18 Feb 2009 17:34:09 +0000
schrieb Olivier Fourdan <fourdan at gmail.com>:

> > IMHO i think we should show the DPI we send to x in the insensitive
> > spin button (that's what my reverted patch did). Storing the user
> > dpi is not really needed IMHO as long as we don't show crap like -1
> > or 0.
> I agree, we either remember the previous value (ie add another boolean
> setting instead of using -1 for disabled) or we just apply my original
> patch.

Ok, here's another patch which should address all our issues.

  1. Set the min/max values for the custom DPI spin button to 48/1000.
     Do the same in the registry code.

  1. Add boolean /Xfce/UseCustomDPI property to the xsettings channel.
     It is set to false by default.

  2. Instead of using callbacks for DPI-related property change events
     in xfce4-appearance-settings use xfconf_g_property_bind(). Bind
     the custom DPI check button to the /Xfce/UseCustomDPI property.

That's the easy part. Now for the more tricky one which is only related
to xfsettingsd.

  3. Add /Xfce/UseCustomDPI (false) and /Xft/DPI (-1) to the defaults
     xsettings.xml file.

  4. Whenever the /Xfce/CustomDPI value is toggled, check if its true
     (user wants custom DPI) and the value of /Xft/DPI is -1. In that
     case don't handle the property change event but compute
     and set /Xft/DPI automatically.

  5. Otherwise update the registry as follows: check whether to use
     custom or computed DPI. Make sure the one to use is not out of
     bounds. If it is, use the fallback value. 

You will find all of this documented in the code as well. It should
work fine. The only thing I still don't like is that initially, you'll
see 48 in the insensitive custom DPI spin button. As soon as you switch
to custom DPI you'll see the computed value in there. I guess that's
easy to fix by changing /Xft/DPI when starting xfsettingsd and the
value is -1. But ... yeah, it's not really that important. At least the
value is now remembered and the appearance settings don't act weird

Please give it some testing. 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfce4-settings-dpi-issue.patch
Type: text/x-patch
Size: 11358 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20090219/d699349d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20090219/d699349d/attachment.pgp>

More information about the Xfce4-dev mailing list