On Sun, 18 Oct 2015, Anthony Walter wrote:

I wrote a class to support for global hotkeys on both Linux and Windows.

http://cache.getlazarus.org/video/colormix.mp4

In the video a color picker is activated anywhere when you press a global
hotkey allow you to freeze the screen and use the mouse pick a color from
any pixel on your display.

BUT there was a huge problem:

It seems near impossible for an app on my Ubuntu with Unity distro (and
possibly other Linux distros) to bring an application to the foreground
without direct interaction from the user.

Just to be clear, I was completely unable to programatically activate my
app and send it to the front. I had to reset to a nasty cheat to get what
you see in the video working (my app isn't actually activated after the
pick color hotkey is pressed).

So my question is, on a Linux system using recent Gtk libraries, what is
the definitive way to take the focus away from another application, show my
application window, and bring it to the foreground in an active and focused
state?

Roughly said:
There is none that is guaranteed to work. You are at the mercy of the window 
manager.
To my knowledge only the window manager, and it alone, can implement such 
shortcut keys.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to