Hi All, I want to implement a popup menu that can stack up and pops its stack based on the focus position.
for example, window 1,2,3,4, and click anywhere on 2 will close 3,4, click ‘open’ on 1 would open 2, and click 'open" on 2 will create 3 etc…
I originally thought i could achieve this functionality, but if I do the close in focus out event, i would not be able to keep window 1 when open window 2 since window 1 is out of focus.
if i do the close in the focus in event and maintain a stack of opened popups and pop the stack until it meets the clicked window, it would not work for cases that i clicked off the window. For example, i click on another application that should close 1,2,3,4, since this time, i am only receiving focus out event, but no focus in event since the window is another application. As a result, 1,2,3,4 won’t be closed even my application is out of focus.
The problem is when creating a new popup and giving it focus, there is a empty moment before the focus-in event that everything seems out of focus. For example, create w1, and create w2, and the event will be w1 out of focus, (everything out of focus here)w2 in focus.
The only way i can achieve this is to find out the _net_active_window and keep track of it so that when clicking off screen, I know the current active window is not one of my application(i will keep a map of windows i created), i will close all the popups. This is x11 specific.
I want to know if gtk has a way to do this without going the x11 route? I want to have a more general solution.
Can I have a parent window that will have focus if any of its child has focus?
Thanks for your help.