elementary / installer

Installer front-end for Linux-based OSes
https://elementary.io
GNU General Public License v3.0
173 stars 48 forks source link

PartitionBar: make sure we get click events #765

Closed danirabbit closed 4 months ago

danirabbit commented 5 months ago

Fixes #763 Closes #767

I can't actually get the menu to popup in this branch or any previous commit since the last release, but this makes sure the gesture sends the event at least. Maybe the menu only works in an actual installer session for some reason?

vjr commented 5 months ago

@danirabbit

When I click I see a message like "gtk popover - assertion failed - GTK_IS_POPOVER is not a popover"...

I had tried to fix this issue - I also changed Box to EventBox and also re-added the button pressed mask. I had to move the gesture.connect (menu.popup) from the construct block up to the constructor, because apparently the block was being executed before the constructor where the menu was actually being created - this fixed the debug message about "GTK_IS_POPOVER not being a popover".

I also re-added the local/private method that called menu.popup () with a log statement that confirmed the click event is happening but menu.popup () does nothing.

Is there some sort of GTK setup required - like adding the widgets in a hierarchy so that the event from the eventbox (partitionbar) is propagated down to the partitionmenu widget?

hope what ive written here is not too much gibberish :-)

danirabbit commented 5 months ago

@vjr okay so this has multiple layers haha.

One layer is this: which means even when the menu does popup it's closed immediately https://github.com/elementary/installer/pull/767

vjr commented 5 months ago

@danirabbit so how do i test? do i need to apply both PRs or just #767 ?

danirabbit commented 5 months ago

@vjr At the very least we need #767, but I don't think the issue is fixed even with both of these applied. So to test #767 you can see that keyboard navigation is fixed after the keyboard layout selection view.

Then we have this issue which is the click event wasn't actually being sent, but with the eventbox it does send which is this branch

And then I think there might be a third thing which is I don't know that the menu is actually having all its widgets shown properly, but I can't really investigate it further because of the bug from #767. And it seems like there is some kind of issue with the menu ref being null between the constructor and the construct block. And it looks like we're supposed to be able to open the menu from the key widget as well but you can't because it's null. So there's a lot going on here :sweat_smile:

danirabbit commented 4 months ago

@vjr okay actually, it was simpler than I thought and it's now fixed in this branch. This can be rebase merged :)