How to Stop Ubuntu from Automatically Rotating the Screen

The Spinning Tablet

Ubuntu running on a 2-in-1 convertible laptop or a tablet with an accelerometer will automatically rotate the display orientation when the device is physically rotated. This is expected and useful when genuinely switching between laptop and tablet modes. However, the auto-rotation is overly sensitive on many devices: picking up the laptop to adjust its position on a desk, tilting the screen back slightly, or even vibrations from typing on a wobbly table can trigger a sudden 90-degree or 180-degree screen flip. The display rotates, your mouse cursor moves to an unexpected position, and open windows are violently resized to fit the new orientation — all from a momentary jiggle.

Locking the Screen Orientation

To stop Ubuntu from automatically rotating the screen based on accelerometer input, you must enable the orientation lock through the GNOME system settings or the Quick Settings panel.

The fastest method is via the Quick Settings panel. Click on the system tray area in the top-right corner of the screen (where the volume, network, and power icons are). In the drop-down Quick Settings panel, look for a button with a rotation lock icon (a padlock with a circular arrow). Click the Rotation Lock button to toggle it on. The screen will remain fixed in its current orientation regardless of how you physically move the device. Alternatively, open the Settings app and navigate to Displays. Look for a toggle labelled Rotation Lock and turn it on. For a command-line approach, run gsettings set org.gnome.settings-daemon.peripherals.touchscreen orientation-lock true. This persists across reboots and can be easily toggled back if you later want automatic rotation for a presentation or tablet-mode session.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.