Fixed bug where, in some cases, branches with empty transactions were
committed and stored in the history. I.e., when undoing/redoing these
transactions, then nothing happens. The issue was when clicking on the
window frame where the window's bounds doesn't change but a branch is
still committed.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>