Don't process cursor changes until view is realized. (#164349)
For views created with fl_view_new_for_engine() the cursor processing was subscribed to before the window had realized. This caused the following warnings on startup: [+3105 ms] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL **: 13:00:35.501: gdk_window_get_display: assertion 'GDK_IS_WINDOW (window)' failed [ ] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL **: 13:00:35.501: gdk_cursor_new_from_name: assertion 'GDK_IS_DISPLAY (display)' failed [ ] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL **: 13:00:35.501: gdk_window_set_cursor: assertion 'GDK_IS_WINDOW (window)' failed Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
This commit is contained in:
@@ -491,6 +491,10 @@ static void realize_cb(FlView* self) {
|
||||
atk_plug_get_id(ATK_PLUG(self->view_accessible)));
|
||||
}
|
||||
|
||||
static void secondary_realize_cb(FlView* self) {
|
||||
setup_cursor(self);
|
||||
}
|
||||
|
||||
static gboolean render_cb(FlView* self, GdkGLContext* context) {
|
||||
if (gtk_gl_area_get_error(self->gl_area) != NULL) {
|
||||
return FALSE;
|
||||
@@ -776,7 +780,8 @@ G_MODULE_EXPORT FlView* fl_view_new_for_engine(FlEngine* engine) {
|
||||
|
||||
self->pointer_manager = fl_pointer_manager_new(self->view_id, engine);
|
||||
|
||||
setup_cursor(self);
|
||||
g_signal_connect_swapped(self->gl_area, "realize",
|
||||
G_CALLBACK(secondary_realize_cb), self);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user