[Lazarus] Video: Color Picker ... and a question

Anthony Walter sysrpl at gmail.com
Sun Oct 18 10:33:19 CEST 2015


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?

Application.BringToFront didn't work for me on my system.
gtk_window_present didn't work for me on my system.
A lot of other things didn't work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151018/3533f3dd/attachment-0002.html>


More information about the Lazarus mailing list