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_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.
94 FlWindowMonitor*
self =
95 FL_WINDOW_MONITOR(g_object_new(fl_window_monitor_get_type(),
nullptr));
97 self->window = GTK_WINDOW(g_object_ref(window));
99 self->on_configure = on_configure;
100 self->on_state_changed = on_state_changed;
101 self->on_is_active_notify = on_is_active_notify;
102 self->on_title_notify = on_title_notify;
103 self->on_close = on_close;
104 self->on_destroy = on_destroy;
105 g_signal_connect_swapped(window,
"configure-event",
107 g_signal_connect_swapped(window,
"window-state-event",
109 g_signal_connect_swapped(window,
"notify::is-active",
111 g_signal_connect_swapped(window,
"notify::title", G_CALLBACK(
title_notify_cb),
113 g_signal_connect_swapped(window,
"delete-event", G_CALLBACK(
delete_event_cb),
115 g_signal_connect_swapped(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 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)