GNOME Bugzilla – Bug 750741
Popover spawned from within another popover gets stacked behind the parent
Last modified: 2015-06-12 19:02:27 UTC
Created attachment 305010 [details] Test program When placing a GtkMenuButton spawning a popover inside another popover, the second popover gets drawn behind the first one. I wrote a small test program in GJS to expose the problem. Clicking the menubutton in the window will open a popover containing a second menubutton, the popover opened by the second menubutton will appear below the first one.
Created attachment 305145 [details] [review] window: Avoid rising the window of already shown popovers This breaks stacking, as popovers are repositioned sort of frequently (even more after show/hide animations).
Created attachment 305146 [details] [review] popover: Avoid hiding modal popovers if another popover is taking focus Due to popover modality itself, there's quite high chances the popover stealing focus has been triggered from within, so stay friendly to it. Hiding the popover here will only hide the grabbing popover too if this happens.
Note that there's still issues with non-modal popovers within modal popovers, as clicking on the former will be considered "outside" for the latter.
Review of attachment 305145 [details] [review]: makes sense
Review of attachment 305146 [details] [review]: tricky. but I guess it does the right thing. Might be good to have testcase for some of these tricky configurations somewhere in tests/ - maybe add some to testpopover...
(In reply to Matthias Clasen from comment #5) > Review of attachment 305146 [details] [review] [review]: > > tricky. but I guess it does the right thing. Yeah, the right check would potentially involve recursive checks around popovers/parents, as we eg. get grab_notify somewhat verbosely AFAIR, so this might happen on grandparent popovers too. This sort of relies on popovers being spawn from user interaction though. > Might be good to have testcase > for some of these tricky configurations somewhere in tests/ - maybe add some > to testpopover... Right, I'll make sure there's one.
Attachment 305145 [details] pushed as a0ff35f - window: Avoid rising the window of already shown popovers Attachment 305146 [details] pushed as a01fe14 - popover: Avoid hiding modal popovers if another popover is taking focus