Shutdown button only logs out ubuntu 15.04

Since i upgraded to Ubuntu 15.04, if i click on the shutdown button it only logs out and i have to click again on the shutdown button (from the ubuntu login screen) to power off the pc. How can i fix this?


If you have docky installed this fixed the problem for both of my machines.

Ubuntu 15.04 Unity + Docky, Plank, or Cairo-Dock

(DOCKY)

cd ~/.config/autostart
nano docky.desktop
add X-GNOME-Autostart-Delay=20

(IF YOU USE CAIRODOCK)

cd ~/.config/autostart
nano cairo-dock.desktop
add X-GNOME-Autostart-Delay=20

Or you can just remove either one from autostart.

Example docky.desktop

[Desktop Entry]
Type=Application
Exec=docky
Hidden=false
NoDisplay=false
X-GNOME-Autostart-Delay=20
X-GNOME-Autostart-enabled=true
Name[en_US]=Docky
Name=Docky
Comment[en_US]=
Comment=

(IF YOU USE PLANK)

cd ~/.config/autostart
nano plank.desktop
add X-GNOME-Autostart-Delay=20

For example: cat ~/.config/autostart/plank.desktop

[Desktop Entry]
Type=Application
Exec=/usr/bin/plank
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=20
Name=Plank

Note: Still happens on Ubuntu 15.10


Here is a less-command method for fix this issue.
1.First you have to install unity tweak tool.
2.Then open it and go to "Security" tab under "System" section

unity tweak tool user interface

3.You can see that "User log out" option is checked, Unckeck it.

unity tweak tool Security tab

4.Restart your PC.