| Flutter Linux Embedder |

Functions
fl_display_monitor.h File Reference
`#include <gdk/gdk.h>`
`#include "flutter/shell/platform/embedder/embedder.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"`

Go to the source code of this file.

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlDisplayMonitor, fl_display_monitor, FL, DISPLAY_MONITOR, GObject)
FlDisplayMonitor * | fl_display_monitor_new (FlEngine *engine, GdkDisplay *display)
void | fl_display_monitor_start (FlDisplayMonitor *monitor)
FlutterEngineDisplayId | fl_display_monitor_get_display_id (FlDisplayMonitor *monitor, GdkMonitor *gdk_monitor)

## Function Documentation

## ◆ fl_display_monitor_get_display_id()

FlutterEngineDisplayId fl_display_monitor_get_display_id | ( | FlDisplayMonitor * | monitor,
|  | GdkMonitor * | gdk_monitor
| ) |  |

fl_display_monitor_get_display_id: @monitor: an #FlDisplayMonitor. @gdk_monitor: GDK monitor to get display ID for.

Get the ID Flutter is using for a given monitor.

Returns: an ID or 0 if unknown.

Definition at line 115 of file fl_display_monitor.cc.

116 {
117 g_return_val_if_fail(FL_IS_DISPLAY_MONITOR(self), 0);
118 return GPOINTER_TO_INT(
119 g_hash_table_lookup(self->display_ids_by_monitor, monitor));
120 }
self
g_cond_signal & self
Definition: fl_compositor_software.cc:67

References self.

Referenced by handle_geometry_changed().

## ◆ fl_display_monitor_new()

FlDisplayMonitor* fl_display_monitor_new | ( | FlEngine * | engine,
|  | GdkDisplay * | display
| ) |  |

fl_display_monitor_new: @engine: engine to update. @display: display to monitor.

Creates a new object to keep the engine updated with the currently used displays. In GDK, a display is called a "monitor".

Returns: a new #FlDisplayMontior.

Definition at line 94 of file fl_display_monitor.cc.

95 {
96 FlDisplayMonitor* self =
97 FL_DISPLAY_MONITOR(g_object_new(fl_display_monitor_get_type(), nullptr));
98 g_weak_ref_init(&self->engine, engine);
99 self->display = GDK_DISPLAY(g_object_ref(display));
100 return self;
101 }

References self.

Referenced by fl_engine_init(), and TEST().

## ◆ fl_display_monitor_start()

void fl_display_monitor_start | ( | FlDisplayMonitor * | monitor | ) |

fl_display_monitor_start: @monitor: an #FlDisplayMonitor.

Start monitoring for display changes.

Definition at line 103 of file fl_display_monitor.cc.

103 {
104 g_return_if_fail(FL_IS_DISPLAY_MONITOR(self));
105
106 g_signal_connect_object(self->display, "monitor-added",
107 G_CALLBACK(monitor_added_cb), self,
108 G_CONNECT_SWAPPED);
109 g_signal_connect_object(self->display, "monitor-removed",
110 G_CALLBACK(monitor_removed_cb), self,
111 G_CONNECT_SWAPPED);
112 notify_display_update(self);
113 }
monitor_added_cb
static void monitor_added_cb(FlDisplayMonitor *self, GdkMonitor *monitor)
Definition: fl_display_monitor.cc:64
notify_display_update
static void notify_display_update(FlDisplayMonitor *self)
Definition: fl_display_monitor.cc:27
monitor_removed_cb
static void monitor_removed_cb(FlDisplayMonitor *self, GdkMonitor *monitor)
Definition: fl_display_monitor.cc:68

References monitor_added_cb(), monitor_removed_cb(), notify_display_update(), and self.

Referenced by fl_engine_start(), and TEST().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlDisplayMonitor | ,
|  | fl_display_monitor | ,
|  | FL | ,
|  | DISPLAY_MONITOR | ,
|  | GObject |
| ) |  |