You are not logged in.

#1 2010-12-11 12:57:40

ChaosEnergy
Member
Registered: 2010-12-10
Posts: 9

Gtk-window-decorator and compiz-fusion problem

Ok so I'm fairly new to Arch but along with the Wiki I've managed to set it up pretty much the way I want it. The problem now is compiz-fusion. I installed it and set it up but when I reboot it takes quite a long time to actually load my desktop environment after logging in. I tried replacing the Exec line with

Exec=bash -c 'compiz ccp decoration --sm-client-id $DESKTOP_AUTOSTART_ID'

but it didn't help. That's my first problem but I can sorta live with it for the time being (although I would really like to see it fixed).

Now for my second, more annoying problem. When I login I don't get any titlebars. I've looked around and tried several solutions such as adding a certain Option to the xorg.conf file for Nvidia cards but that didn't help. The thing that does work, however, is the fusion-icon. When I start that it reloads my window manager and I get my title bars back. Because of that I now have the fusion-icon in my startup list but when I login it takes a few seconds for the application to start of course and then it still has to reload the window manager to get my titlebars back. This takes way too much time and I don't want that icon in my system tray the whole time.

So to sum it up, I want compiz to run with my gtk-windows-decorator, with titlebars and preferably fix the delay right after logging in.

Thanks in advance.

Offline

#2 2010-12-11 17:07:53

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Gtk-window-decorator and compiz-fusion problem

It normally works like this:
Install gtk-window-decorator, activate "Window Decoration" in ccsm, and put "gtk-window-decorator --replace" in the command field. The ccp variable should load these settings when starting compiz.

Last edited by hokasch (2010-12-11 17:09:01)

Offline

#3 2010-12-12 11:34:07

ChaosEnergy
Member
Registered: 2010-12-10
Posts: 9

Re: Gtk-window-decorator and compiz-fusion problem

Indeed it should but for some reason it doesn't. The weird thing is that the moment I open the fusion-icon it refreshes my window manager and I do get the titlebars.

Offline

#4 2010-12-12 12:13:08

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Gtk-window-decorator and compiz-fusion problem

Are you positive that compiz itself is starting alright (window decorations aside)? Any errors in .xsession-errors (' grep compiz .xsession-errors') or when you run fusion-icon?

Not sure if this could be an issue, but for simplification I would try without a xorg.conf file once.

Offline

#5 2010-12-12 16:44:25

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

If you're using gnome-session, try commenting out X-GNOME-Autostart-Phase=WindowManager in /usr/share/applications/compiz.desktop and/or /usr/share/applications/gnome-wm, depending on how you start compiz. This will make Compiz fire up later during the application phase (gnome session manager doesn't require processes to call back after starting up during this phase), which isn't exactly desirable, but will work as a kludge

The gnome-session-ubuntu package in the AUR includes patches for the above, as well as adding a handy X-GNOME-Autostart-Delay key, which could be useful if late startup of your WM causes problems for dependant apps.


"Its too big and too slow"

Offline

#6 2010-12-12 20:09:40

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

hokasch wrote:

Are you positive that compiz itself is starting alright (window decorations aside)?

Hmm. Try running 'ps u -C compiz' before reloading; it may be that Compiz is not being start from the .desktop file and is not being passed any parameters i.e. ccp


"Its too big and too slow"

Offline

#7 2010-12-13 12:53:54

ChaosEnergy
Member
Registered: 2010-12-10
Posts: 9

Re: Gtk-window-decorator and compiz-fusion problem

When I try 'ps u -C compiz' it does seem to run compiz but when I open my fusion-icon and the window manager reloads it shows compiz --replac in the last column (the command column). I also tried commenting that line out but it doesn't seem to do anything.

Offline

#8 2010-12-13 15:34:16

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

ChaosEnergy wrote:

When I try 'ps u -C compiz' it does seem to run compiz but when I open my fusion-icon and the window manager reloads it shows compiz --replac in the last column (the command column). I also tried commenting that line out but it doesn't seem to do anything.

Is the entry under the command column simply "compiz" when you running ps before reloading Compiz? Are you using GNOME (or at least gnome-session) or another session manager? What display manager are you using? If its gnome-session you're using, Ithink I may know where the problem lies...


"Its too big and too slow"

Offline

#9 2010-12-13 15:43:05

ChaosEnergy
Member
Registered: 2010-12-10
Posts: 9

Re: Gtk-window-decorator and compiz-fusion problem

It simply says "compiz" before reloading, yes. I'm using GNOME (gnome-session) as a session manager and I'm not sure what you mean by display manager. My window manager is set to compiz. According to gconf apps/desktop/gnome/session/required_components/windowmanager has the value compiz.

I also tried gnome-session-ubuntu from AUR but that didn't seem to help either.

Offline

#10 2010-12-13 18:19:02

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

ChaosEnergy wrote:

It simply says "compiz" before reloading, yes. I'm using GNOME (gnome-session) as a session manager and I'm not sure what you mean by display manager. My window manager is set to compiz. According to gconf apps/desktop/gnome/session/required_components/windowmanager has the value compiz.

I also tried gnome-session-ubuntu from AUR but that didn't seem to help either.

The problem lies with gnome-session. It can't parse the exec line in your compiz.desktop, so it defaults to starting with no options at all roll Soo, to get compiz started up correctly, with your options set and a valid sm-client-id, a wrapper has to be used.

As root, create /usr/local/bin/compiz-wrapper and chmod it to 755. Drop the following into the file:

#!/bin/sh
exec compiz ccp --indirect-rendering --sm-client-id $DESKTOP_AUTOSTART_ID

Change the 'Exec' key in /usr/share/applications/compiz.desktop to "Exec=compiz-wrapper". It should be OK to leave "X-GNOME-Autostart-Phase=WindowManager" enabled, the sm-client-id is now being passed.

Check that /usr/local/bin is included in the PATH variable in /etc/profile. If not, prepend it to the string, followed by a colon.

Log in again, and hopefully, the symptoms will be gone.

Gnome-session appears to be bit of a mess atm, if you set /apps/desktop/gnome/session/required_components/windowmanager to anything other than compiz after having previously run compiz, it still runs compiz again, despite what is set in gconf, and then tries to run whatever you set in gconf without the --replace option afterwards. Also, a wrapper has to be used for supplying sm-client-id. And the gnome-wm script that comes with the package is funked. The Ubuntu patches to gnome-wm just make matters worse by trying to reinstate other deprecated gconf strings... I might do a wrapper based on what can be salvaged from gnome-wm that can handle more than just compiz...

A display manager is something like XDM, GDM, KDM, WHATEVERPREFIXDM or SLiM etc ... It is just a set of scripts that handle initialisation of your desktop environment...

Last edited by rufflove (2010-12-13 18:29:52)


"Its too big and too slow"

Offline

#11 2010-12-14 00:00:25

Stunts
Member
From: Portugal
Registered: 2009-03-28
Posts: 339
Website

Re: Gtk-window-decorator and compiz-fusion problem

All of a sudden, I started having the very same problem here...
I have tried rufflove's solution to no avail. It's still not working.
The only workaround I have found is to start fusion-icon from Gnome's "Startup Applications".
The symptoms I am having are simple tough. When I start a new gnome session, no WM is started. Just like that.
After that, starting compiz manually (without the --replace switch) will start compiz, but if I kill it right after (with, say Ctrl+c or closing the terminal window where it is running), it just respawns, and with the ccp option activated, since I get all the settings...

Last edited by Stunts (2010-12-14 00:05:18)

Offline

#12 2010-12-17 18:41:20

ChaosEnergy
Member
Registered: 2010-12-10
Posts: 9

Re: Gtk-window-decorator and compiz-fusion problem

I played around with it a bit more before reading your post rufflove and apparently the line

Exec=bash -c 'compiz --replace ccp --indirect-rendering decoration --sm-client-id $DESKTOP_AUTOSTART_ID'

seems to work. There's still a bit of a delay after the login screen so I'll try your solution as well to see if it makes a difference. It might also be that compiz simply takes some time to load although I don't remember it taking that long on my old Ubuntu install.

Anyway, thanks a lot for your help. ^^

As for Stunts, you can try replacing the Exec line with the one I posted above, it might work for you as well. Good luck.

Offline

#13 2010-12-18 00:55:25

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

Yeah, it shouldn't be as slow as it sounds. It takes markedly longer to startup here via gnome-session, than it does via lxsession. Try removing X-GNOME-Autostart-Phase=WindowManager. Gnome-session doesn't complain that compiz doesn't call back with it enabled though. Do you have the DBus plugin enabled?

I tried that line in compiz.desktop myself, and ended up with compiz running without params roll

When I started up Compiz on a box with an Nvidia card today, I too came across the same problem as Stunts - no window manager, but no problem starting it from the command line. I must've upgraded gnome-session inbetween using it last. I knocked together a replacement for gnome-wm as a workaround, which you might want to try, Stunts. Save the following as /usr/local/bin/gnome-wman and chmod to 755, ensuring /usr/local/bin is in your $PATH.

#!/bin/sh

# This a simple alternative to the gnome-wm script which presently seems a tad confused about things.

WM=

# WINDOW_MANAGER overrides all (really).

if [ -n "$WINDOW_MANAGER" ]; then
    which $WINDOW_MANAGER 2> /dev/null
    if [ $? -eq 0 ]; then 
        WM=`basename $WINDOW_MANAGER`
    else
        echo -n "$(basename $0):$WINDOW_MANAGER is not in your PATH. Please check your setup"
    fi
fi

# If a specific window manager hasn't been declared, just use Metacity or maybe Compiz - this is GNOME, afterall.

if [ -z "$WM" ] || [ "$WM" == "$(basename $0)" ]; then

    # Use Compiz if available and compositing is enabled... 
    xdpyinfo 2> /dev/null | grep -q "^ *Composite$" 2> /dev/null
    if [ $? -eq 0 ] ; then
        if [ -x `which compiz` ]; then
                WM="compiz"
        fi
    else
        if [ -x `which metacity` ]; then
            WM="metacity"
        else
            echo -n "$(basename $0): Failed to default to either Compiz or Metacity."
            exit 1
        fi
    fi
fi

# Set client ID. Add other WMs below, along with the respective parameter. 

SMID=

case $WM in
    sawfish|sawmill|metacity)
        SMID="--sm-client-id="
        ;;
    openbox|enlightenment|e16|compiz)
        SMID="--sm-client-id "
        ;;
    twm)
        SMID="-clientId "
        ;;
    lwm)
        SMID="-s "
        ;;
    fvwm|fvwm2)
        SMID="-i "
        ;;
esac

# Grab command from .desktop file, incase it provides additional options

OPTS=

if [ -e "/usr/share/applications/$WM.desktop" ]; then
    OPTS=`grep Exec < /usr/share/applications/$WM.desktop | sed 's/[^ ]* \(.*\)/\1/'`
fi

# Set some safe defaults for compiz, if none have been added.

if [ -z "$OPTS" ] && [ "$WM" == "compiz" ]; then OPTS="ccp --indirect-rendering"; fi

# --replace must be added to override gnome-session if it starts a window manager of its own accord. Dirty, but it works.

exec bash -c "$WM $OPTS $SMID$DESKTOP_AUTOSTART_ID --replace"

if [ $? -gt 0 ]; then
    echo -n "$(basename $0): Oops! Failed to start $WM with options '$OPTS $SMID$DESKTOP_AUTOSTART_ID --replace'"
    
    # Attempt to fall back to Metacity, if another WM has failed to run.

    if [ "$WM" != "metacity" ]; then
        exec bash -c "metacity $SMID$DESKTOP_AUTOSTART_ID --replace"
        if [ $? -gt 0 ]; then 
            echo "$(basename $0): ... And also failed to start Metacity!"
            exit 1
        fi
    fi
fi

Then as root, create a .desktop file to trigger the script:

sed "s/Exec=gnome-wm/Exec=gnome-wman/" /usr/share/applications/gnome-wm.desktop > /usr/share/applications/gnome-wman.desktop

And then, as your user:

gconftool-2 -t string -s /desktop/session/gnome/required_components/windowmanager gnome-wman

Don't put --replace or --sm-client-id in the compiz.desktop file, the script will append these. Setting the environmental var WINDOW_MANAGER to the basename of a particular window manager can be used as a manual override, otherwise the script will try to use Compiz, or failing that, Metacity by default. In my case, SLiM passes either "metacity","compiz" or null to .xinitrc which includes the line 'export WINDOW_MANAGER=$1'.

Let me know if you try it and it helps.

Last edited by rufflove (2010-12-18 01:11:36)


"Its too big and too slow"

Offline

#14 2010-12-18 17:37:54

Stunts
Member
From: Portugal
Registered: 2009-03-28
Posts: 339
Website

Re: Gtk-window-decorator and compiz-fusion problem

@rufflove

Your suggestion is looking great. But I have hit an issue... I don't have a "gnome-wm.desktop" anywhere in my filesystem...
I have also done a "touch /usr/local/bin/gnome-wm" followed by a "pacman -Qo /usr/local/bin/gnome-wm" in case I had deleted it during my tweakings, but no packages own that file.

Can you please post yours so I can use it? I've also done some google searching for it, but I didn't find anything conclusive... And definitely no examples.
Also which package owns that file in your system?

Thanks for your effort.

Offline

#15 2010-12-19 00:06:41

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

/usr/share/applications/gnome-wman.desktop:

[Desktop Entry]
Type=Application
Name=Window Manager
Exec=gnome-wman
NoDisplay=true
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=true
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-session
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=2.30.0
X-Ubuntu-Gettext-Domain=gnome-session-2.0

the gnome-wm script is part of the gnome-session package (installed to /usr/bin/gnome-wm). The .desktop is supplied in the same package iirc. I'm using gnome-session-ubuntu, which may account for it.


"Its too big and too slow"

Offline

#16 2010-12-19 00:24:35

Stunts
Member
From: Portugal
Registered: 2009-03-28
Posts: 339
Website

Re: Gtk-window-decorator and compiz-fusion problem

It Works!
And as a side effect I also have a quite faster startup!
Thanks for this. Have you considered submitting this script to Gnome bugzilla?
It seems to make things simply work...
I also have a "/usr/bin/gnome-wm" which is owned by gnome-session, but this package doesn't bring a gnome-wm.desktop file, so yours must come from gnome-session-ubuntu...
Anyway, thank you for your suggestion. It solved my issue on the spot!

Offline

#17 2010-12-19 16:09:29

rufflove
Member
From: Holmfirth, UK
Registered: 2010-11-22
Posts: 96

Re: Gtk-window-decorator and compiz-fusion problem

I'm glad it helped, thanks for letting me know smile

I doubt the guys at GNOME would really be interested; this is more of a workaround than a fix. Gnome-session tries to divine your choice of window manager and start it automatically and I'm not sure why the gnome-wm script is still included. Even so, there are some useful snippets in gnome-wm that can be used to create a somewhat more sane replacement that gets the job done when gnome-session's magic wand doesn't.


"Its too big and too slow"

Offline

#18 2010-12-20 16:27:26

Stunts
Member
From: Portugal
Registered: 2009-03-28
Posts: 339
Website

Re: Gtk-window-decorator and compiz-fusion problem

Point taken! =-)
Thanks again.

Offline

Board footer

Powered by FluxBB