window: correctly hide search bar when not in search mode

Search bar shows an annoying border when it should be hidden. This commit fixes it.

Fixes bug #739913.