Linux: Mouse Hover to Auto-Raise Window

By Xah Lee. Date: . Last updated: .

A great feature is window auto-raise. Just move mouse cursor to a window, and after a delay, that window will come to front. This save you a lot clicks. But takes some time to get used to.


For Linux, you can set it in the Window Manager Preference. Exact steps depends on which desktop (gnome, kde, ubuntu unity, xfce, lxde, etc) you are using. 〔➤see Linux: How to Switch to LXDE, Xfce

linux openbox window manager raise window on focus
Linux LXDE OpenBox window manager obconf, raise window on focus.
linux xfce window manager raise window on focus
Linux Xfce Window Manager preference settings for auto-raise.

On Linux, be sure to make the delay time at least 0.5 second. Because, otherwise you'll often switch windows by mistake.

The Xfce preference setting doesn't indicate exact timing. But you can adjust it by editing the file ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml

<property name="focus_delay" type="int" value="500"/>
<property name="raise_delay" type="int" value="5"/>

Microsoft Windows

There's no graphical user interface to do this in Microsoft Windows 10.

In Windows 7 or Vista:

  1. go to “Control Panel”
  2. double click “Ease of Access Center”
  3. click “Make the mouse easier to use”
  4. checkbox “Activate a window by hovering over it with a mouse.”
  5. click Save.

Push Mouse to Window Edge to Switch Windows

You can set your apps so that each touches a edge on the screen. This way, you just nudge your mouse to switch. This is much faster and convenient than 【Alt+Tab ↹】.

xah Linux desktop 2013-06-02
Linux Xfce desktop

The most frequently used app for me are: Emacs, Firefox, Chrome, terminal. Each's window has a visible area on screen, usually on one edge of the screen. So i just hover to it to activate.

Also, you should set up a key to switch window within the same app. For example, in terminal, you might have several terminal windows. Once you push mouse to activate a terminal, you can press the key to switch to other terminal windows.

Don't Move Mouse Needlessly

One problem is that if you moved your mouse carelessly, some background window pops to the front. You can quickly go back to your previous window by【Alt+Tab ↹】. However, it is especially annoying when the window you are working on is a small dialog that just popped up while you are moving the mouse. You can't switch back to the dialog because it's not a window or app.

So, you'll get into the habit of not moving the mouse needlessly. Leave hand off the mouse when not actually moving pointer.

Auto-raise is especially good if you are a trackball or trackpad user. Because trackball are less likely to move the pointer unnecessarily. For best trackball, see Best Trackballs 2017.

Single Key to Switch App

Sometimes you have too many apps/windows open but you only have 4 screen edge. So, i recommend setting up a F key to Switch to {Firefox, Emacs, Terminal}.

How to Set Key to Switch to Browser

If you use a full sized keyboard with numberpad, the numberpad keys is best used to switch apps, tabs, window. For detail and how-to, see How to Program Numeric Keypad as Function Keys.

Mouse topic

  1. Linux: Mouse Hover to Auto-Raise Window
  2. Linux: Mouse Hover-Click
  3. Linux: Set Mouse Single-Click to Open File
  4. Linux: How to Set Mouse Speed
  5. Linux: How to Swap Mouse Buttons
  6. Linux: Set Trackball/Mouse Do Scroll
  7. Linux: Setup Accelerated Scroll and AutoScroll
  8. Linux: X11 Mouse Button Numbering