Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected behavior of nested views in embedded separated component #279

Open
emmanueltouzery opened this issue Mar 19, 2021 · 2 comments
Open

Comments

@emmanueltouzery
Copy link
Contributor

relm 21 nested views are amazing!

I've used them in a greenfield project to add titlebar menus without any imperative code. in that project I have the titlebar directly in the main window component. This works without problems.

I now wanted to use the same pattern also in another project where the titlebar component is split from the window component, and it does not work well.

I made a repro github: https://github.com/emmanueltouzery/relm11issue

This is the main thing:

        gtk::Window {
            titlebar: Some(self.model.titlebar.widget())
        }

In the project where this works fine, I have directly the titlebar component nested within the window view, as is now possible with relm 21. But in this legacy project the titlebar component is so large that I'll keep it separate from the window component. But in this configuration I have trouble with nested views in the separate titlebar component.

If I run the project from this github, the titlebar is translucent, and I get the following GTK errors on the command-line:

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.630: gtk_window_get_default_widget: assertion 'GTK_IS_WINDOW (window)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.630: gtk_window_set_default: assertion 'GTK_IS_WINDOW (window)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.648: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.648: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.648: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.649: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.649: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.650: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.651: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:03.651: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.557: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.557: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.557: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.572: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.572: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.572: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.589: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.589: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.589: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.606: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.606: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.606: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.623: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.623: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.623: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.638: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.638: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.638: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.655: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.655: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.655: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.671: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.672: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.672: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.689: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.689: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.689: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.706: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.706: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.706: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.722: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.722: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.722: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.738: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.738: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.738: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.754: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.754: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.754: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.771: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.771: gtk_render_frame_gap: assertion 'xy1_gap <= height' failed

(relm11issue:55675): Gtk-CRITICAL **: 22:03:04.771: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed

@emmanueltouzery
Copy link
Contributor Author

and so in this sample project, just commenting this in the titlebar file fixes all the errors:

                // popover: view! {
                //     gtk:: Popover {
                //         gtk::Box {}
                //     }
                // }

@antoyo
Copy link
Owner

antoyo commented Mar 19, 2021

I don't understand right now what's happening.
I'll have to take a deeper look.

I wonder if there's something weird with Popover, because there's another weird issues that is related to Popover:
#266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants