wlc: gtk3 applications crash when trying to open a GtkMenu
So after first submitting this issue on sway, I have tried and succeeded in reproducing it with orbment: When I open a menu in a gtk3 application (e.g. right click in a text view, pressing the hamburger button in Epiphany), the application terminates. This only happens with GtkMenus, not with the more recently added GtkPopovers. When using the gtk3 package from the official arch repositories, these crashes look like this:
(gedit:10785): Gdk-ERROR **: Error flushing display: Broken pipe
[1] 10785 trace trap (core dumped) LC_ALL=C gedit
Weirdly, when using gtk3 with the typeahead patch (gtk3-typeahead in AUR) I don’t get a core dump, and the error message looks different:
# LANG=en_US.utf8
Gdk-WARNING **: Lost connection to Wayland compositor.
# LANG=de_DE.utf8
Gdk-WARNING **: Error 71 (Protokollfehler) dispatching to Wayland display.
I’m about to rebuild the official gtk3 package with debug symbols to hopefully obtain a stack trace.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 43 (35 by maintainers)
Commits related to this issue
- Implemented skelet of xdg-positioner, responds to everything but no data is stored yet. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Using convert_from_wlc_resource instead of allocating positioner struct manually. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Fully implemented positioner and methods to get requested size & anchor. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Implemented all positioner-related getters. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Added wlc_popup_get_parent. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Fully implemented xdg-positioner and added getters for stored data. Fixes Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Updated example to use xdg-positioner and handle popup menus correctly. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Fully implemented xdg-positioner and added getters for stored data. Fixes Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
- Updated example to use xdg-positioner and handle popup menus correctly. Ref Cloudef/wlc#210 — committed to kozec/wlc by kozec 7 years ago
Here. With above, GTK menus are shown without crashing and compositor can display them correctly positioned.
@Drakulix Will get on this bit later today. I need to remind myself on the positioner details before I can answer well.
@Cloudef Because this issue is really annoying me in my daily use, I would like to try to tackle it.
I browsed through the source code and got some questions:
positionergetting exposed by the api? It seems like it should almost be a new handle type. Alternatively don’t expose it and just respect it’s settings in theset_geometrycall or stub it so it does not crash anymore.positionerbe a new resource insrc/resources/types? How would I allocate it in thecreate_positionercall? Looking at the rest of the code, I just usewlc_resource_createandwlc_resource_implement, right? Implementing it then seems pretty straight-forward.Nope, I was not aware of that.
//edit: Anyway, that only means that last commit is not needed, just using view_get_parent works. I can tidy rest up and make PR.
Here’s the
gdk_event_soure_preparefunction from my local version of the source, with the line of the error message marked: