Shell extension: How to know a window got focus

Hi, I want to create a highlight focus extension. It should extra highlight the window that just got focus by adding a colored border to the window.

How can my extension know a window got focus?

Mutter has a focus signal, but this signal is missing in shell-wm.c of gnome-shell. Is it possible to subscribe directly to mutter signals? Or can you recommend an alternative method?


It doesn’t matter where a signal is defined: If you have access to an object, you can connect to its signals.

However I suspect that tracking global.display.focus_window is less cumbersome than connecting to a signal on every window (and make sure to carefully disconnect them as necessary).

1 Like

Thanks, your help got me on track again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.