Use Devilspie2 to set the window type to "Utility" for selective applications. This window type will not be affected by "Opacity of inactive windows" in Xfce environment.
Install Devilspie2 from the repository (available in Debian and Ubuntu repositories), then create a new configuration file at
$HOME/.config/devilspie2 with the following content.
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name());
if (get_application_name()=="xfce4-dict") then
Save the file as
opaque.lua. The file name can be anything, but it must have
.lua file extension to work with Devilspie2.
Run Devilspie2 in debug mode and you will see something like below.
$ devilspie2 -d
Running devilspie2 in debug mode.
Using scripts from folder: /home/USERNAME/.config/devilspie2
List of LUA files handling "window_open" events in folder:
List of LUA files handling "window_close" events in folder:
Window Name: Desktop
Application name: xfdesktop
Window Name: xfce4-panel
Application name: xfce4-panel
Window Name: Application Finder
Application name: xfrun4
Window Name: Dictionary
Application name: xfce4-dict
The following screenshots are showing inactive window of Dictionary, before and after running Devilspie2. Notice that the opacity changes for Dictionary (bottom) but Xfce Terminal remained less opaque (left) while both windows are inactive.
The inactive window of Dictionary remained fully opaque because the window type has been changed to "Utility" by Devilspie2, with respect to the configuration file.
The created configuration file contains the first two lines that begin with
debug_print to show debug messages of "Window Name: ... Application name: ...". These lines allow Devilspie2 to show respective names for both currently running applications and subsequently run applications.
Based on the debug messages, user shall follow these steps:
Identify the application of choice, which needs to be fully opaque when inactive. Look for the line containing its
Application name: and copy the value.
Open the same configuration file at
/home/USERNAME/.config/devilspie2/opaque.lua using a text editor, then replace
xfce4-dict with the application of choice.
Save the file.
Quit and run again Devilspie2.
Note that USERNAME refers to the current username.
The modified configuration will now be effective. If the application of choice is already running, switch the window back and forth to see effective changes when the window becomes inactive again.
Devilspie2 must be running in background for this solution to be effective for every session. To make this persistent, add
devilspie2 under "Applications Autostart" tab in "Session and Startup".
What window type
Initially, I found this solution while playing with Devilspie2 by trials and errors. Later I tried running GIMP 2.8 and noticed that main window became less opaque when inactive, but the other two floating windows were remained fully opaque.
Then I had confirmed the window type by running
xwininfo, then click on one of the floating windows, to print the window manager hints.
$ xwininfo -wm
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x2a00686 "Layers - Brushes"
Window manager hints:
Client accepts input or input focus: Yes
Initial state is Normal State
Displayed on desktop 1
Process id: 5262 on host XXXXX
Frame extents: 1, 1, 22, 4
And bingo, the window type was indeed "Utility"!
One trivial issue
The "Utility" window type has one different behaviour, that is, the application window will no longer appear in the taskbar. User can continue to navigate by Alt+Tab keys instead of taskbar.
This behaviour is normal for "Utility" window type, which can be observed the same for the floating windows a.k.a. the docks in GIMP.
If user feels that this behaviour is not desirable, then changing window type could be a solution with drawback. On the other hand, the behaviour is a trivial issue while being able to keep selective windows as opaque when inactive.
Tested working in Xubuntu 14.04 (Xfce 4.10), using Devilspie2 v0.31.