I have created my own GUI program (that only takes up a small fraction of the screen space) whose use is such that it should "always be on top" (if I have a terminal, Firefox, GIMP and my program open, it should always be in the foreground - this "always on top" is achieved by right-clicking on the menu bar and checking "Always On Top"). It must be able to gain focus on mouse clicks (default behaviour).

Because of its use, it is more convenient for me and users if it is not possible to alt+tab to it (if I have a terminal, Firefox, GIMP and my program open, it should only cycle through the terminal, Firefox and GIMP).

How can I prevent alt+tab from cycling through my program?

A "dev-only" solution is welcome (obscure changes made only to my workstation that most end-users will not make/know how to make, but solves my problem). (Added 16.04 tag because that is the only version that the solution must work on - right now, I don't care about the other versions)

If it matters, it is mainly written in C and built using GTK. I am able to edit and recompile from source.

  • I'm not sure if wmctrl works with unity, but it might be helpful – Xen2050 Oct 21 '18 at 4:50
  • wmctrl wil work with Unity and indeed allows to set the skip_taskbar property. – vanadium Oct 21 '18 at 6:11
  • @vanadium Thanks for pointing me in the right direction. wmctrl -r WINDOW_TITLE -b add,skip_taskbar works on my development machine. I will test it out on where it will be deployed soon. – tfstwbbnb Oct 21 '18 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.