How to ensure a newly opened window is on top and has focus?

Hard to search for previous content on this topic.

I’ve just migrated from W10 to Ubuntu 24.04.3 LTS and I’m pleased with how the process went. All seems to be fine except I have a simple problem.

In W10 when I double click something that opens a new window (like file manager or browser) the focus goes to that new window automatically.

I’m finding in Ubuntu (gnome) sometimes when I double click an item a new window is opened, somewhere, but I gotta go find it. Focus does not go to it automatically (but, sometimes it does). How do I manage this so focus is proper every time?

Perhaps this has something to do with getting used to the multi (2) desktops functionality. I really don’t need or want the 2 desktops to cycle back and forth through either. Is there a way to stop this?

Thanks much
dp

To help make this thread more likely to catch the eye of someone who might be able to help, descriptive topic titles are preferred on this Discourse - so I’ve changed the topic title to be descriptive of the issue and added GNOME tag.

Other information that might help people help you:

  • What Ubuntu version are you using? (you can find it by running lsb_release -a in Terminal)
  • Are you using the X11/Xorg session type or the Wayland session type?
1 Like

Welcome. You didn’t say which version you are running. I’m running 25.10 and new windows don’t get focus (which I like). In older versions new windows would “steal the focus”. You might want to sudo apt install gnome-tweaks and run gnome-tweaks to see more options. Also, does echo $WAYLAND_DISPLAY give you anything?

I don’t see a relevant option in GNOME Tweaks.

However, I do in the GNOME extension “Just Perfection”. Open Just Perfection > Behaviour (tab at the very bottom) > Window Demands Attention Focus. This does the job, at least on my 24.04 machine.

Sorry for the delay. Gnome tweaks doesn’t help and $WAYLAND_DISPLAY results in

wayland-0: command not found

Thanks for that. I’ve installed the GNOME extension and set it as you suggest. I’ll see now how that performs.

FWIW … I also found how to reduce my system to a single (1) workspace instead of 2 (or more).

SETTINGS, Multitasking, Workspaces.
Click “Fixed Number of Workspaces”
Using the - / + keys set “Number of Workspaces” to 1 (or whatever you prefer).
dp

You don’t like multiple workspaces? I love them! They’ve been available on Android, iOS and Linux (and probably other systems) for decades. Windows adopted them relatively recently (in 2015).

I use the extension Workspace Matrix to let me have a 2D, instead of 1D, set of workspaces, along with Improved Workspace Indicator to help me keep track of where I am.

Perhaps I’ll eventually get used to them. I never liked / used them with Windows (I am SOOO glad to be off Windows, away from MS) . Getting used to Gnome / Ubuntu was my first task. I have been a Linux (Debian) user for years but on my Raspberry pi computers. Now my main equipment is Linux. I must say the migration to Ubuntu was impressively easy.

1 Like