Subject: Bug#353: Subsequent attempts to resume a fullscreen linux session fails

From: Harvey Eneman <[email-masked]>
Date: Tue, 03 Dec 2013 23:13:48 -0800

Package: x2goserver
Version: 4.0.1.7

As of version 4.0.1.7, x2gostartagent no longer includes the geometry
field in the options file when fullscreen is used.  Unfortunately,
x2goresume-session assumes the geometry field is at position 13 and
subsequently corrupts the options file.  The attached patch modifies
x2goresume-session to avoid the corruption by detecting whether the
geometry was specified and, if not, setting an appropriate default value
and reapplying the subsequent positional assignments.

*** x2goserver-4.0.1.9.orig/x2goserver/bin/x2goresume-session	2013-11-28 07:20:50.000000000 -0800
--- x2goserver-4.0.1.9/x2goserver/bin/x2goresume-session	2013-12-03 16:03:45.000000000 -0800
***************
*** 131,136 ****
--- 131,143 ----
  KTSTR=`echo "$OPTIONS" | awk -F, {'print $12'}`
  LISTSTR=`echo "$OPTIONS" | awk -F, {'print $17'}`
  
+ XGSTR=`echo $GSTR | sed s/geometry=.*//`
+ if [ -n "$XGSTR" ]; then
+ 	GSTR="geometry="
+         RSTR=`echo "$OPTIONS" | awk -F, {'print $13'}`
+         FSTR=`echo "$OPTIONS" | awk -F, {'print $14'}`
+         LISTSTR=`echo "$OPTIONS" | awk -F, {'print $16'}`
+ fi
  
  KTSTR=`echo "$KTSTR" | sed "s/\//\\\\\\\\\//"`
  X2GO_KBD_TYPE=`echo "$X2GO_KBD_TYPE" | sed "s/\//\\\\\\\\\//"`