Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a program, Vuescan, which I use with my flatbed scanner. It works fine up to Ubuntu 10.10 (64bit), but in Ubuntu 11.04 (64 bit), the Vuescan window does not launch under Unity or in Classic mode or in Classic mode - no effects. It does run normally in Safe mode.

I discovered through trial and error that if I turn OFF the Window Decoration plugin in Compiz (via the CCSM), Vuescan starts normally and opens its GUI window. I can then turn Window Decorations back ON via the CCSM and everything works OK with the window decorations, including Vuescan.

As a workaround until either Vuescan is fixed or the Compiz/Unity window decorator is fixed, I would like to start Vuescan with a script, BASH preferably, that would first turn OFF Window Decorations, then start Vuescan (this part is easy and I know how to do it), and then turn Window Decorations back ON. I'm not familiar enough with Compiz and how to communicate with it via Dbus, specifically as it is implemented in Ubuntu 11.04, to be able to do this script on my own.

Any help much appreciated!

share|improve this question

2 Answers 2

I make it for you:

#!/bin/bash
#
# by desgua
#
# to disable Windows Decoration plugin at compiz 
# start an app and re-enable this plugin
#
##################################################
previous=$(gconftool-2 --get /apps/compiz-1/general/screen0/options/active_plugins)  
gconftool-2 --type=List --list-type=String --set /apps/compiz-1/general/screen0/options/active_plugins [core,bailer,detection,composite,opengl,imgjpeg,compiztoolbox,maximumize,place,text,resize,mousepoll,regex,shift,gnomecompat,grid,wall,dbus,extrawm,put,commands,imgpng,move,session,animation,wobbly,workarounds,expo,scale,ezoom,staticswitcher,ring,unitymtgrabhandles,unityshell]
gnome-terminal -e "bash -c \"sleep 2 && /home/desgua/Downloads/VueScan/vuescan ; exit ; exec bash\"" 
sleep 2
gconftool-2 --type=List --list-type=String --set /apps/compiz-1/general/screen0/options/active_plugins $previous
exit 0
share|improve this answer
    
Almost there! The script works fine in Classic mode in 11.04 but not in Unity. I wonder if it has something to do with the two Compiz Unity plugins not being enabled (Ubuntu Unity Plugin and Unity MT Grab Handles) by the script when it turns decorations off? –  Ross Jenkins May 1 '11 at 15:03
    
OK, if I add 'unitymtgrabhandles' and 'unityshell' to the active_plugins list, Vuescan opens OK in Unity, but window decorations don't come back until I close Vuescan. I think that the Unity shell plugin must be buggy. –  Ross Jenkins May 1 '11 at 15:11
    
Besides unitymtgrabhandles can you try to add 'sleep 5' after every change? –  desgua May 1 '11 at 17:13
    
I tried experimenting with longer sleep times but it seems that after the script launches Vuescan (/home/ross/VueScan/vuescan), the last instruction of the script which restores the window borders doesn't execute until the program (vuescan) is closed or terminated. In other words, the script seems to do the following: 1) Save current Compiz settings 2) Set Compiz without window decorations 3) wait for Sleep time to expire 4) launch vuescan 5) wait for vuescan to close 6) wait for Sleep time to expire 7) restore original Compiz settings 8) Exit. Step 5) seems to be the problem. –  Ross Jenkins May 1 '11 at 22:39
    
PS - Above behaviour only ocurs under Unity. –  Ross Jenkins May 1 '11 at 22:48
up vote 1 down vote accepted

OK, there is no longer any need for a script or workaround. As of Nov 3, 2011, version 9.0.61 x64 of Vuescan has fixed the problem between Unity, Compiz, Vuescan and window decorations, at least on Ubuntu 11.10. All works normally now (thank goodness!).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.