[Tex/LaTex] width of beamercolorbox in background

backgroundsbeamer

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}

Best Answer

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}