[mutter] monitor: Add API to check whether the monitor is virtual or not
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor: Add API to check whether the monitor is virtual or not
- Date: Thu, 1 Sep 2022 14:52:09 +0000 (UTC)
commit 972e393fc07f7250991cefe079fefd80b4ba880c
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Oct 27 22:57:31 2021 +0200
monitor: Add API to check whether the monitor is virtual or not
As for the types of monitor, X11 and KMS are currently assumed to always be
physical, while the virtual ones are assumed to be virtual. In theory
X11 ones could be virtual, but lets not bother. KMS ones can be virtual
in the case of virtual KMS, but we typically use that for testing as if
it was physical, so lets leave it as such.
Will later be used to feed correct information to colord.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
src/backends/meta-monitor.c | 9 +++++++++
src/backends/meta-monitor.h | 2 ++
src/backends/meta-output.h | 2 ++
src/backends/native/meta-output-virtual.c | 2 ++
4 files changed, 15 insertions(+)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 0dca085ea6..96e2b1aa61 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -386,6 +386,15 @@ meta_monitor_is_laptop_panel (MetaMonitor *monitor)
}
}
+gboolean
+meta_monitor_is_virtual (MetaMonitor *monitor)
+{
+ const MetaOutputInfo *output_info =
+ meta_monitor_get_main_output_info (monitor);
+
+ return output_info->is_virtual;
+}
+
gboolean
meta_monitor_is_same_as (MetaMonitor *monitor,
MetaMonitor *other_monitor)
diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h
index 17c4ff3b3a..5d924b07b5 100644
--- a/src/backends/meta-monitor.h
+++ b/src/backends/meta-monitor.h
@@ -123,6 +123,8 @@ gboolean meta_monitor_get_max_bpc (MetaMonitor *monitor,
gboolean meta_monitor_is_laptop_panel (MetaMonitor *monitor);
+gboolean meta_monitor_is_virtual (MetaMonitor *monitor);
+
gboolean meta_monitor_is_same_as (MetaMonitor *monitor,
MetaMonitor *other_monitor);
diff --git a/src/backends/meta-output.h b/src/backends/meta-output.h
index 02ec0fa092..f87a625e65 100644
--- a/src/backends/meta-output.h
+++ b/src/backends/meta-output.h
@@ -80,6 +80,8 @@ typedef struct _MetaOutputInfo
{
grefcount ref_count;
+ gboolean is_virtual;
+
char *name;
char *vendor;
char *product;
diff --git a/src/backends/native/meta-output-virtual.c b/src/backends/native/meta-output-virtual.c
index 12efb33388..d276d3c6e1 100644
--- a/src/backends/native/meta-output-virtual.c
+++ b/src/backends/native/meta-output-virtual.c
@@ -45,6 +45,8 @@ meta_output_virtual_new (uint64_t id,
output_info = meta_output_info_new ();
output_info->name = g_strdup_printf ("Meta-%" G_GUINT64_FORMAT, id);
+ output_info->is_virtual = TRUE;
+
output_info->n_possible_crtcs = 1;
output_info->possible_crtcs = g_new0 (MetaCrtc *, 1);
output_info->possible_crtcs[0] = META_CRTC (crtc_virtual);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]