fl_window_monitor_new: @window: the window being monitored. @on_configure: the function to call when the window changes size, position or stacking. @on_state_changed: the function to call when the window state changes. @on_is_active_notify: the function to call when the is-active property changes. @on_moved_to_rect: the function to call when a popup window is moved to a new position. @on_close: the function to call when the user requests the window to be closed. @on_destroy: the function to call when the window is destroyed.
Helper class to allow the Flutter engine to monitor a GtkWindow using FFI. Callbacks are called in the isolate this class was created with.
Returns: a new #FlWindowMonitor.
122 FlWindowMonitor*
self =
123 FL_WINDOW_MONITOR(g_object_new(fl_window_monitor_get_type(),
nullptr));
125 self->window = GTK_WINDOW(g_object_ref(window));
129 if (Dart_CurrentIsolate() !=
nullptr) {
132 self->on_configure = on_configure;
133 self->on_state_changed = on_state_changed;
134 self->on_is_active_notify = on_is_active_notify;
135 self->on_title_notify = on_title_notify;
136 self->on_moved_to_rect = on_moved_to_rect;
137 self->on_close = on_close;
138 self->on_destroy = on_destroy;
139 g_signal_connect_object(window,
"configure-event",
142 g_signal_connect_object(window,
"window-state-event",
145 g_signal_connect_object(window,
"notify::is-active",
148 g_signal_connect_object(window,
"notify::title", G_CALLBACK(
title_notify_cb),
149 self, G_CONNECT_SWAPPED);
150 g_signal_connect_object(window,
"realize", G_CALLBACK(
realize_cb),
self,
152 if (gtk_widget_get_realized(GTK_WIDGET(window))) {
155 g_signal_connect_object(window,
"delete-event", G_CALLBACK(
delete_event_cb),
156 self, G_CONNECT_SWAPPED);
157 g_signal_connect_object(window,
"destroy", G_CALLBACK(
destroy_cb),
self,
static void destroy_cb(FlWindowMonitor *self)
static void is_active_notify_cb(FlWindowMonitor *self)
static void title_notify_cb(FlWindowMonitor *self)
static void realize_cb(FlWindowMonitor *self)
static gboolean configure_event_cb(FlWindowMonitor *self, GdkEventConfigure *event)
static gboolean window_state_event_cb(FlWindowMonitor *self, GdkEventWindowState *event)
static gboolean delete_event_cb(FlWindowMonitor *self, GdkEvent *event)