I'm writing an app where I want a small window to open next to its launcher item. I can have it open at the mouse position (which will be near the launcher), but that isn't very precise or satisfying. How can I get the screen position of a launcher icon using python so I can set my Gtk.Window position? Thanks!
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
This is what I've been able to figure out, although it's not as satisfying as just getting x,y coordinates. You can get an ordered list of the launcher items currently in the panel, then find your launchers index in the list and multiply by the icon size + some padding for the top panel and icon spacing to give approximate y coordinate. See code below. I hope this helps anyone else who may be searching for a way to do this.
|
|||
|
|