Subject: Bug#834: defaults.py X2GOBROKER_SESSIONPROFILE_DEFAULTS dpi prevents client from using autodetected dpi

From: Jason Alavaliant <[email-masked]>
Date: Thu, 02 Apr 2015 11:14:08 +1300

Package: python-x2gobroker
Version: 0.0.2.3
Tags: patch

It was noted by my users that their x2go sessions started via the broker 
always got the default dpi setting of 96 instead of the dpi value native 
to their machine.     Tracing through the code as far as I can see the 
problem is that if the /etc/x2go/broker/x2gobroker-sessionprofiles.conf  
  file doesn't have a dpi=  setting defined in it  the default one is 
provided by the value in the 
/usr/lib/python2.7/dist-packages/x2gobroker/defaults.py   file under 
X2GOBROKER_SESSIONPROFILE_DEFAULTS        that's not ideal since it 
stops the client from supplying it's autodetected one which matches the 
actual dpi on the user's machine.

I'd suggest updating the 
/usr/lib/python2.7/dist-packages/x2gobroker/defaults.py file to remove 
the line "u'dpi': 96,"  from the X2GOBROKER_SESSIONPROFILE_DEFAULTS 
section  (as per the attached patch).

In my testing with that default value gone (assuming that setdpi=1 is 
set);

* If a dpi=num value is set in x2gobroker-sessionprofiles.conf (which is 
the default provided in the sample config file), then that 
sessionprofile set dpi value is used by the session.
* If there is no dpi=num value set in x2gobroker-sessionprofiles.conf  
then that the x2goclient provides it's own value which is either the 
autodetected value matching the dpi of the machine that is being 
connected from or the client falls back to it's default value which is 
also 96

So as far is I can see in default cases having that default value 
removed shouldn't change behavior and it would allow people optionally 
configure their sessionprofiles to have no dpi value set so broker 
sessions would be free to use the native dpi value provided by the 
client (which doesn't seem to be possible currently due to the default 
overriding the client providing it's own value).

Thanks
Jason

--- old/x2gobroker/defaults.py	2015-04-02 11:09:16.806901779 +1300
+++ new/x2gobroker/defaults.py	2015-04-02 11:09:24.343064936 +1300
@@ -202,7 +202,6 @@
         u'rootless': True,
         u'iconvto': u'UTF-8',
         u'soundtunnel': True,
-        u'dpi': 96,
         u'sshport': 22,
         u'setdpi': 0,
         u'pack': u'16m-jpeg',