GNOME Bugzilla – Bug 743437
GtkPopover attached to GtkCellEditable is misplaced
Last modified: 2018-05-02 16:22:52 UTC
Created attachment 295314 [details] Test case If a GtkPopover is attached to an editable cell in a GtkTreeView when the cell is opened for editing, the GtkPopover is not drawn at that cell. When the popover is attached in an editing-started signal handler, the GtkCellEditable (which is a GtkEntry) has not yet been added to a container widget. When it is added to a container, the hierarchy-changed signal is emitted, and the following functions are called: _gtk_popover_parent_hierarchy_changed() gtk_popover_update_position() _gtk_window_set_popover_position() But _gtk_window_set_popover_position() does not update the position of any GdkWindow. That's done in popover_size_allocate() in gtkwindow.c. It's tempting to try to fix the bug by calling popover_size_allocate() from _gtk_window_set_popover_position(), but that would result in infinite recursive function calls: _gtk_window_set_popover_position() popover_size_allocate() gtk_popover_update_position() _gtk_window_set_popover_position() ........... The test case also shows a second bug. When the editing is finished, and the GtkEntry is unmapped, warnings such as these are printed: (example:2861): Gtk-WARNING **: GtkWindow 0x802230 is mapped but visible child GtkPopover 0x8679f0 is not mapped They come from gtk_widget_verify_invariants().
Some things have changed since I filed this bug. The popover is still misplaced, but the warning messages have changed. No warning is printed when the editing is finished. Instead several warnings such as this one are printed while the popover is shown: (example:3599): Gtk-WARNING **: GtkPopover 0x224e400 is drawn without a current allocation. This should not happen. This warning has recently been added to gtk_widget_draw_internal().
As of now, I see no warnings, but the popover still stays pointing at the top-left corner of the column containing the relevant editables.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/528.