width of beamercolorbox in background

How can I make a beamercolorbox in the background template take the whole width of the slide? The following doesn't work correctly (but it works for some other templates such as headline):

\documentclass{beamer}

\setbeamercolor{banner}{bg=green}

\setbeamertemplate{background}{
\begin{beamercolorbox}[wd=\paperwidth,ht=2cm]{banner}
\end{beamercolorbox}
}
\begin{document}
\begin{frame}
\frametitle{AA}
BB
\end{frame}
\end{document}

-
Add \hspace{1cm} just before the beamercolorbox. –  percusse Jul 25 '12 at 15:53
that works (as long as it is not followed by any non-%ed line breaks). Do you want to make it an answer? –  Simon Byrne Jul 26 '12 at 10:27
To make it slightly more general, you can also use \hspace{\beamer@leftmargin} –  Simon Byrne Jul 27 '12 at 14:05
Oh please write up the answer. I forgot to find where that 1cm comes from but since you've found that please make it an answer. –  percusse Jul 27 '12 at 14:59

It's due to the margin. Add some extra hspace and it all works (thanks @percusse).

\documentclass{beamer}

\setbeamercolor{banner}{bg=green}

\makeatletter
\setbeamertemplate{background}{
\hspace{\beamer@leftmargin}%
\begin{beamercolorbox}[wd=\paperwidth,ht=2cm]{banner}
\end{beamercolorbox}
}
\makeatother

\begin{document}
\begin{frame}
\frametitle{AA}
BB
\end{frame}
\end{document}

-