All entries for Monday 22 February 2010
February 22, 2010
Citrix ICA Client seamless windows vs Compiz
If you've ever tried using the Citrix ICA Client with seamless windows whilst using Compiz, you've probably discovered the problem where the Citrix ICA Client window disappears if you switch workspaces. (See Google.) It's one of those annoying problems that has been around for a time span that can be measured in years, through multiple versions of the software involved with no sign of anyone fixing it. It appears to be one of those standoff situations where the people responsible for each piece of software think the problem is caused by a bug in the other piece of software and hence it's not them who need to fix it.
The best solution I've been able to find suggested is to switch to Metacity (or to word it a different way, disable desktop effects). This is a rather annoying workaround though. The client doesn't work with the window manager that you use all the time? Oh well, just switch to a different window manager when you want to run it. Yeah... If you're still reading you'll probably be interested to know that I've found a workaround that doesn't involve simply not using Compiz. Two actually. I'll start with the one I like best. (Tested on SLED 11 and openSUSE 11.2)
Workaround 1: Make the Citrix ICA Client window visible on all workspaces.
Right click on the Citrix ICA Client window's entry in the taskbar and select 'Always on Visible Workspace'. The downside of this is that the window is of course that the window is always on your current workspace, but you can get it out of the way by minimising it.
To save yourself having to manually set that on each Citrix window you can set up a Compiz rule that does it automatically:
- Run ccsm (not installed in Ubuntu by default but it's in the repos)
- Select Window Management
- Enable Window Rules and open it
- In the field marked Stick enter 'class=Wfica_Seamless' (without the quotes)
If you want to enable this by default for all users of a machine or machines, then you can do so using this script.
#!/bin/bash
# implements workaround for citrix client windows vanishing when
# you switch workareas in compiz by setting such windows
# to be visible on all desktops by default.
# not ideal, but better than the windows vanishing
# requires xmlstarlet
# add a rule that makes windows of the relevant class 'Sticky'
tempfile=$(mktemp);
filetomod=/usr/share/compiz/winrules.xml
xml ed -u "/compiz/plugin[@name='winrules']/screen/group/option[@name='sticky_match']/default" -v 'class=Wfica_Seamless' $filetomod > $tempfile && cat $tempfile > $filetomod
# using cat ensures permisisons on $filetomod are not changed
rm -f $tempfile;
# ensure that the window rules plugin is enabled by default
filetomod=/usr/share/compizconfig/global.xml;
plugintoadd="winrules"
# if winrule is already in the list then don't need to add it, so exit
if [ -n "$(grep "<value>${plugintoadd}</value>" ${filetomod})" ];then
exit 0;
fi
tempfile=$(mktemp);
xml ed -i "/compiz/core/display/option[@name='active_plugins']/default/value[1]" -t elem -n value -v $plugintoadd $filetomod > $tempfile && cat $tempfile > $filetomod
rm -f $tempfile;
XML file manipulation is done using XMLStarlet because I still haven't got around to learning Perl. (XMLStarlet is not installed on Ubuntu by default but it's in the repos, it's not included in SLED 11 but included in the SLE-SDK).
Note that the changes the script makes may be over-written by a compiz update. You could run the script during boot and/or shutdown or whatever suits your set up to ensure the modifications remain in place. Also note that the modification that adds winrules to the default list of active plugins will not affect any users that already have compiz configuration in the home directory (~/.config/compiz). This is because the config compiz writes to the user's home directory includes a list of active plugins which then takes precedence over the global list.
Workaround 2: Set a Size Rule
I don't like this workaround, but someone else might. Whilst reading up on the problem I found a reference to it being cause by the reported width/height of the Citrix ICA Client window. I forget where I saw this and am too lazy to go looking for it. This led me to wonder if the problem could be worked around by somehow setting a width/height that Compiz doesn't choke on.
- Run ccsm
- Select Window Management
- Enable Window Rules and open it
- Click on the 'Size rules' tab
- Click 'New'
- In the Sized Windows field enter 'class=Wfica_Seamless' (without the quotes)
- Set Width and Height to some suitable positive values
This will force a width/height upon the Citrix ICA Client window. The downside is that you can't re-size the windows, but the upside is that you can leave the window on one workspace.