I had your same issue, especially because Gnome shell’s titlebars are so huge. I installed the Unite extension to save more space at the top, which combined with Ubuntu dock (with hidden setting) can likely maximise your space.
E.g. using PyCharm the only thing you can see except for the window is the top bar.
You can also make the topbar thinner reducing the font size in Gnome Tweaks (this requires to go in the fonts tab, then reduce the scaling factor, but eventually increase the interface font if it gets too small, the latter doesn’t interfere with the top bar size).