Fix PhpStorm Not Focusing When Breakpoints Hit (Ubuntu 17.10 / Gnome Shell 3)

I recently upgraded my system from Ubuntu 16.04 with Unity to Ubuntu 17.10 with Gnome Shell 3. One of the "features" I found annoying was that my IDE PhpStorm was not popping to the front and receiving focus whenever breakpoints were hit. I eventually figured out a solution and wanted to document it in case others were also searching for a solution.

I first confirmed that "Focus application on breakpoint" was indeed enabled in my settings:

PhpStorm Settings: Focus application on breakpoint

It was indeed enabled but it still wasn't working.

After lots of Googling I eventually determined that Gnome 3 has a "helpful feature" which prevents windows from stealing focus - while this makes sense for overzealous applications which abuse that feature, it was also preventing my IDE from popping into focus whenever breakpoints were hit.

I eventually stumbled upon a fork of a Gnome extension called "Steal My Focus" which fixes this behavior in newer versions of Gnome Shell.

Installation was super easy:

  1. Download the repo to some temporary folder (either as a ZIP or with git clone - doesn't matter)
  2. Run make which installs it to the correct location
  3. Enable the extension

With this being installed, any time I'm browsing a site under development and a breakpoint is hit PhpStorm will immediately pop into view!

Did you find this helpful?

About Colin O'Dell

Colin O'Dell

Colin O'Dell is a Senior Software Engineer at SeatGeek. In addition to being an active member of the PHP League and maintainer of the league/commonmark project, Colin is also a PHP docs contributor, conference speaker, and author of the PHP 7 Migration Guide.