summaryrefslogtreecommitdiff
path: root/src/backends/meta-monitor-manager-dummy.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2017-02-15 16:06:46 +0800
committerJonas Ådahl <jadahl@gmail.com>2017-04-07 22:30:48 +0800
commitf25f14351c10e999f22a7c7ad172d5f0b8f2101e (patch)
tree9bd6addfa7cf00c2759abf6d0847293bdfd72550 /src/backends/meta-monitor-manager-dummy.c
parent691e7951ea9ef67497484504f16f74d4fa0840a1 (diff)
downloadmutter-f25f14351c10e999f22a7c7ad172d5f0b8f2101e.tar.gz
monitor-manager: Make max screen size optional
Make the concept of maximum screen size optional, as it is not necessarily a thing on all systems (e.g. when using the native backend and stage views). The meta_monitor_monitor_get_limits() function is replaced by a meta_monitor_manager_get_max_screen_size() which fails when no screen limit is available. Callers and other users of the previous max screen size fields are updated to deal with the fact that the limit is optional. The new D-Bus API is changed to move it to the properties bag, where its absence means there is no applicable limit. https://bugzilla.gnome.org/show_bug.cgi?id=777732
Diffstat (limited to 'src/backends/meta-monitor-manager-dummy.c')
-rw-r--r--src/backends/meta-monitor-manager-dummy.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c
index f5b993f24..8c8134bcc 100644
--- a/src/backends/meta-monitor-manager-dummy.c
+++ b/src/backends/meta-monitor-manager-dummy.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <meta/util.h>
+#include "backends/meta-backend-private.h"
#include "backends/meta-monitor-config-manager.h"
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
@@ -324,9 +325,6 @@ meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
tiled_monitors_str = g_getenv ("MUTTER_DEBUG_TILED_DUMMY_MONITORS");
tiled_monitors = g_strcmp0 (tiled_monitors_str, "1") == 0;
- manager->max_screen_width = 65535;
- manager->max_screen_height = 65535;
-
modes = g_array_sized_new (FALSE, TRUE, sizeof (MetaCrtcMode), MAX_MODES);
crtcs = g_array_sized_new (FALSE, TRUE, sizeof (MetaCrtc), MAX_CRTCS);
outputs = g_array_sized_new (FALSE, TRUE, sizeof (MetaOutput), MAX_OUTPUTS);
@@ -613,6 +611,20 @@ meta_monitor_manager_dummy_get_capabilities (MetaMonitorManager *manager)
return META_MONITOR_MANAGER_CAPABILITY_MIRRORING;
}
+static gboolean
+meta_monitor_manager_dummy_get_max_screen_size (MetaMonitorManager *manager,
+ int *max_width,
+ int *max_height)
+{
+ if (meta_is_stage_views_enabled ())
+ return FALSE;
+
+ *max_width = 65535;
+ *max_height = 65535;
+
+ return TRUE;
+}
+
static void
meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
{
@@ -626,6 +638,7 @@ meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
manager_class->calculate_monitor_mode_scale = meta_monitor_manager_dummy_calculate_monitor_mode_scale;
manager_class->get_supported_scales = meta_monitor_manager_dummy_get_supported_scales;
manager_class->get_capabilities = meta_monitor_manager_dummy_get_capabilities;
+ manager_class->get_max_screen_size = meta_monitor_manager_dummy_get_max_screen_size;
}
static void