The Aggressive Snap
The GNOME desktop environment, which serves as the default graphical interface for Ubuntu, utilizes a window management feature commonly referred to as “Edge Tiling.” When you grab a window by its title bar and drag it towards the very top edge of your screen, Ubuntu assumes you want that application to take over your entire display and automatically maximizes the window. While this is a quick way to enlarge an application, it becomes highly frustrating when you simply want to move a small terminal window or a calculator near the top of your monitor to keep it out of the way, only to have it suddenly explode to fill your entire screen.
Disabling the Top-Edge Maximization
To regain precise control over your window placement and stop Ubuntu from automatically maximizing applications when they touch the top of your display, you must modify the internal GNOME Mutter settings.
This behavior cannot be disabled through the standard Settings application; you must use the GNOME Tweaks tool. If you do not have it installed, open your terminal and run sudo apt install gnome-tweaks. Once installed, open your application drawer and launch the Tweaks application. In the left-hand navigation sidebar, click on Windows. In the right-hand panel, look for the section detailing window actions. You will find a toggle switch labelled Edge Tiling. Click this toggle to turn it completely Off. The change is immediate. You can now drag windows freely around your desktop, even pushing them tight against the top panel, without them ever automatically snapping into a maximized state.