[mutter] backend: Make the getter use the cached ui scale
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backend: Make the getter use the cached ui scale
- Date: Fri, 26 May 2017 07:19:33 +0000 (UTC)
commit 43cdf81f6b942d129be465a409f23708c8c360bb
Author: Jonas Ådahl <jadahl gmail com>
Date: Mon Apr 10 17:33:45 2017 +0800
backend: Make the getter use the cached ui scale
The cached ui scale is kept up to date, so don't recalculate it
everytime meta_backend_get_ui_scaling() is called.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
src/backends/meta-backend.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 9d1d310..5741207 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -114,6 +114,9 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaBackend, meta_backend, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
initable_iface_init));
+static int
+meta_backend_calculate_ui_scaling_factor (MetaBackend *backend);
+
static void
meta_backend_finalize (GObject *object)
{
@@ -163,7 +166,7 @@ meta_backend_update_ui_scaling_factor (MetaBackend *backend)
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
int ui_scaling_factor;
- ui_scaling_factor = meta_backend_get_ui_scaling_factor (backend);
+ ui_scaling_factor = meta_backend_calculate_ui_scaling_factor (backend);
if (ui_scaling_factor != priv->ui_scaling_factor)
{
@@ -1156,8 +1159,8 @@ calculate_ui_scaling_factor (MetaBackend *backend)
return max_scale;
}
-int
-meta_backend_get_ui_scaling_factor (MetaBackend *backend)
+static int
+meta_backend_calculate_ui_scaling_factor (MetaBackend *backend)
{
if (meta_is_stage_views_scaled ())
{
@@ -1172,6 +1175,14 @@ meta_backend_get_ui_scaling_factor (MetaBackend *backend)
}
}
+int
+meta_backend_get_ui_scaling_factor (MetaBackend *backend)
+{
+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
+
+ return priv->ui_scaling_factor;
+}
+
void
meta_backend_notify_ui_scaling_factor_changed (MetaBackend *backend)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]