Is it possible to create a window that acts as an overlay on top of another window, say, an icon that you can display in the window's title bar or status bar?
Assume for the purposes of this question that:
- The window is a foreign window (not owned by my application)
- The overlay is 16x16 pixels and has a transparent background
- The overlay is displayed very close to the top-right of the window, and should stay positioned relative to the window's top-right border.
- The overlay is interested in processing the left-click on the mouse and no other input.
- The overlay should never have input focus, it should only know when it has been clicked on.
If it is possible, how can it be done? I have tried to create a window and display it in the correct spot, but I never see it; it is as if it doesn't exist. I do get the Window handle, and can even convert it into a GdkWindow object, but I can't get to the point of seeing it.
ETA: An example of what I want to do can be found online, first without what I'm trying to do, and again with it. In this case, look at the menubar, to the right. I'd like to do that for any arbitrary application and have the user be able to click on that little icon to “dock” the window.