1. sudo apt install gnome-tweak-tool
2. Gnome Tweak Tool > Windows > Titlebar Actions > Middle-Click = Toggle Maximize Vertically
3. Log in using Xorg ("Ubuntu") for it to work (not "Ubuntu on Wayland").
Step #3 sounds like an obvious bug. But #2 is seemingly also a bug because it interprets the middle click anywhere on the titlebar -- clicking on the maximize button is not considered a special area.
OK, so there are a few steps to fixing this bug:
1. sudo apt install gnome-tweak-tool
2. Gnome Tweak Tool > Windows > Titlebar Actions > Middle-Click = Toggle Maximize Vertically
3. Log in using Xorg ("Ubuntu") for it to work (not "Ubuntu on Wayland").
Step #3 sounds like an obvious bug. But #2 is seemingly also a bug because it interprets the middle click anywhere on the titlebar -- clicking on the maximize button is not considered a special area.