Skip to content
Commits on Source (49)
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
Foundation, Inc.
Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
......@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX 'make' updates targets which have the same time stamps as their
HP-UX 'make' updates targets which have the same timestamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
......
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# Makefile.in generated by automake 1.16.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -173,9 +173,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build-aux/compile \
......@@ -262,6 +259,8 @@ COMPIZCONFIG_CONFIG_DIR = @COMPIZCONFIG_CONFIG_DIR@
COMPIZCONFIG_UPGRADES_DIR = @COMPIZCONFIG_UPGRADES_DIR@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
......@@ -278,6 +277,7 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
END_SESSION_DIALOG_CFLAGS = @END_SESSION_DIALOG_CFLAGS@
END_SESSION_DIALOG_LIBS = @END_SESSION_DIALOG_LIBS@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GDBUS_CODEGEN = @GDBUS_CODEGEN@
......@@ -638,7 +638,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
......
Version 3.42.0
==============
- Changes/fixes to monitor manager from mutter.
- Updated translations.
Version 3.40.0
==============
- Fix background drawing when using spanned or wallpaper option. (#66)
......
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
# generated automatically by aclocal 1.16.4 -*- Autoconf -*-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2020 Free Software Foundation, Inc.
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.3], [],
m4_if([$1], [1.16.4], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
......@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.3])dnl
[AM_AUTOMAKE_VERSION([1.16.4])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -400,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -464,7 +464,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
......@@ -516,6 +516,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
AC_SUBST([CTAGS])
if test -z "$ETAGS"; then
ETAGS=etags
fi
AC_SUBST([ETAGS])
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
......@@ -597,7 +611,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -618,7 +632,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2020 Free Software Foundation, Inc.
# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -640,7 +654,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -675,7 +689,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -718,7 +732,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -752,7 +766,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -781,7 +795,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -828,7 +842,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -847,7 +861,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -928,7 +942,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2020 Free Software Foundation, Inc.
# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -988,7 +1002,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1016,7 +1030,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2020 Free Software Foundation, Inc.
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1035,7 +1049,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2020 Free Software Foundation, Inc.
# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# Makefile.in generated by automake 1.16.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -252,8 +252,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
......@@ -286,6 +284,8 @@ COMPIZCONFIG_CONFIG_DIR = @COMPIZCONFIG_CONFIG_DIR@
COMPIZCONFIG_UPGRADES_DIR = @COMPIZCONFIG_UPGRADES_DIR@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
......@@ -302,6 +302,7 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
END_SESSION_DIALOG_CFLAGS = @END_SESSION_DIALOG_CFLAGS@
END_SESSION_DIALOG_LIBS = @END_SESSION_DIALOG_LIBS@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GDBUS_CODEGEN = @GDBUS_CODEGEN@
......@@ -972,7 +973,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
......
......@@ -42,6 +42,9 @@ struct _GfBackendClass
GfMonitorManager * (* create_monitor_manager) (GfBackend *backend,
GError **error);
gboolean (* is_lid_closed) (GfBackend *self);
};
GfOrientationManager *gf_backend_get_orientation_manager (GfBackend *backend);
......@@ -50,6 +53,8 @@ GfSettings *gf_backend_get_settings (GfBackend *backend);
void gf_backend_monitors_changed (GfBackend *backend);
gboolean gf_backend_is_lid_closed (GfBackend *self);
void gf_backend_add_gpu (GfBackend *self,
GfGpu *gpu);
......
......@@ -39,11 +39,16 @@ typedef struct
GfMonitorManager *monitor_manager;
guint upower_watch_id;
GDBusProxy *upower_proxy;
gboolean lid_is_closed;
GList *gpus;
} GfBackendPrivate;
enum
{
LID_IS_CLOSED_CHANGED,
GPU_ADDED,
LAST_SIGNAL
......@@ -66,6 +71,124 @@ create_monitor_manager (GfBackend *backend,
return GF_BACKEND_GET_CLASS (backend)->create_monitor_manager (backend, error);
}
static void
upower_properties_changed_cb (GDBusProxy *proxy,
GVariant *changed_properties,
GStrv invalidated_properties,
GfBackend *self)
{
GfBackendPrivate *priv;
GVariant *v;
gboolean lid_is_closed;
priv = gf_backend_get_instance_private (self);
v = g_variant_lookup_value (changed_properties,
"LidIsClosed",
G_VARIANT_TYPE_BOOLEAN);
if (v == NULL)
return;
lid_is_closed = g_variant_get_boolean (v);
g_variant_unref (v);
if (priv->lid_is_closed == lid_is_closed)
return;
priv->lid_is_closed = lid_is_closed;
g_signal_emit (self,
backend_signals[LID_IS_CLOSED_CHANGED],
0,
priv->lid_is_closed);
}
static void
upower_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error;
GDBusProxy *proxy;
GfBackend *self;
GfBackendPrivate *priv;
GVariant *v;
error = NULL;
proxy = g_dbus_proxy_new_finish (res, &error);
if (proxy == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to create UPower proxy: %s", error->message);
g_error_free (error);
return;
}
self = GF_BACKEND (user_data);
priv = gf_backend_get_instance_private (self);
priv->upower_proxy = proxy;
g_signal_connect (proxy,
"g-properties-changed",
G_CALLBACK (upower_properties_changed_cb),
self);
v = g_dbus_proxy_get_cached_property (proxy, "LidIsClosed");
if (v == NULL)
return;
priv->lid_is_closed = g_variant_get_boolean (v);
g_variant_unref (v);
if (priv->lid_is_closed)
{
g_signal_emit (self,
backend_signals[LID_IS_CLOSED_CHANGED],
0,
priv->lid_is_closed);
}
}
static void
upower_appeared_cb (GDBusConnection *connection,
const char *name,
const char *name_owner,
gpointer user_data)
{
GfBackend *self;
self = GF_BACKEND (user_data);
g_dbus_proxy_new (connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
"org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.UPower",
NULL,
upower_ready_cb,
self);
}
static void
upower_vanished_cb (GDBusConnection *connection,
const char *name,
gpointer user_data)
{
GfBackend *self;
GfBackendPrivate *priv;
self = GF_BACKEND (user_data);
priv = gf_backend_get_instance_private (self);
g_clear_object (&priv->upower_proxy);
}
static gboolean
gf_backend_initable_init (GInitable *initable,
GCancellable *cancellable,
......@@ -93,6 +216,39 @@ initable_iface_init (GInitableIface *initable_iface)
initable_iface->init = gf_backend_initable_init;
}
static gboolean
gf_backend_real_is_lid_closed (GfBackend *self)
{
GfBackendPrivate *priv;
priv = gf_backend_get_instance_private (self);
return priv->lid_is_closed;
}
static void
gf_backend_constructed (GObject *object)
{
GfBackend *self;
GfBackendClass *self_class;
GfBackendPrivate *priv;
self = GF_BACKEND (object);
self_class = GF_BACKEND_GET_CLASS (self);
priv = gf_backend_get_instance_private (self);
if (self_class->is_lid_closed != gf_backend_real_is_lid_closed)
return;
priv->upower_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
"org.freedesktop.UPower",
G_BUS_NAME_WATCHER_FLAGS_NONE,
upower_appeared_cb,
upower_vanished_cb,
self,
NULL);
}
static void
gf_backend_dispose (GObject *object)
{
......@@ -118,6 +274,14 @@ gf_backend_finalize (GObject *object)
self = GF_BACKEND (object);
priv = gf_backend_get_instance_private (self);
if (priv->upower_watch_id != 0)
{
g_bus_unwatch_name (priv->upower_watch_id);
priv->upower_watch_id = 0;
}
g_clear_object (&priv->upower_proxy);
g_list_free_full (priv->gpus, g_object_unref);
G_OBJECT_CLASS (gf_backend_parent_class)->finalize (object);
......@@ -140,10 +304,24 @@ gf_backend_class_init (GfBackendClass *backend_class)
object_class = G_OBJECT_CLASS (backend_class);
object_class->constructed = gf_backend_constructed;
object_class->dispose = gf_backend_dispose;
object_class->finalize = gf_backend_finalize;
backend_class->post_init = gf_backend_real_post_init;
backend_class->is_lid_closed = gf_backend_real_is_lid_closed;
backend_signals[LID_IS_CLOSED_CHANGED] =
g_signal_new ("lid-is-closed-changed",
G_TYPE_FROM_CLASS (backend_class),
G_SIGNAL_RUN_LAST,
0,
NULL,
NULL,
NULL,
G_TYPE_NONE,
1,
G_TYPE_BOOLEAN);
backend_signals[GPU_ADDED] =
g_signal_new ("gpu-added",
......@@ -237,6 +415,12 @@ gf_backend_monitors_changed (GfBackend *backend)
{
}
gboolean
gf_backend_is_lid_closed (GfBackend *self)
{
return GF_BACKEND_GET_CLASS (self)->is_lid_closed (self);
}
void
gf_backend_add_gpu (GfBackend *self,
GfGpu *gpu)
......
......@@ -52,8 +52,12 @@ GfMonitorsConfig *gf_monitor_config_manager_create_fallback (GfM
GfMonitorsConfig *gf_monitor_config_manager_create_suggested (GfMonitorConfigManager *config_manager);
GfMonitorsConfig *gf_monitor_config_manager_create_for_orientation (GfMonitorConfigManager *config_manager,
GfMonitorsConfig *base_config,
GfMonitorTransform transform);
GfMonitorsConfig *gf_monitor_config_manager_create_for_builtin_orientation (GfMonitorConfigManager *config_manager,
GfMonitorsConfig *base_config);
GfMonitorsConfig *gf_monitor_config_manager_create_for_rotate_monitor (GfMonitorConfigManager *config_manager);
GfMonitorsConfig *gf_monitor_config_manager_create_for_switch_config (GfMonitorConfigManager *config_manager,
......
This diff is collapsed.
......@@ -1239,11 +1239,14 @@ gf_finish_monitors_config_migration (GfMonitorManager *monitor_manager,
{
GfMonitorConfigManager *config_manager;
GfMonitorConfigStore *config_store;
GfLogicalMonitorLayoutMode layout_mode;
GList *l;
config_manager = monitor_manager->config_manager;
config_store = gf_monitor_config_manager_get_store (config_manager);
layout_mode = gf_monitor_manager_get_default_layout_mode (monitor_manager);
for (l = config->logical_monitor_configs; l; l = l->next)
{
GfLogicalMonitorConfig *logical_monitor_config;
......@@ -1268,12 +1271,15 @@ gf_finish_monitors_config_migration (GfMonitorManager *monitor_manager,
return FALSE;
}
scale = gf_monitor_calculate_mode_scale (monitor, monitor_mode);
scale = gf_monitor_manager_calculate_monitor_mode_scale (monitor_manager,
layout_mode,
monitor,
monitor_mode);
logical_monitor_config->scale = scale;
}
config->layout_mode = gf_monitor_manager_get_default_layout_mode (monitor_manager);
config->layout_mode = layout_mode;
config->flags &= ~GF_MONITORS_CONFIG_FLAG_MIGRATED;
if (!gf_verify_monitors_config (config, monitor_manager, error))
......
......@@ -110,9 +110,10 @@ gf_monitor_manager_kms_is_transform_handled (GfMonitorManager *manager,
}
static gfloat
gf_monitor_manager_kms_calculate_monitor_mode_scale (GfMonitorManager *manager,
GfMonitor *monitor,
GfMonitorMode *monitor_mode)
gf_monitor_manager_kms_calculate_monitor_mode_scale (GfMonitorManager *manager,
GfLogicalMonitorLayoutMode layout_mode,
GfMonitor *monitor,
GfMonitorMode *monitor_mode)
{
return 1.0;
}
......
......@@ -26,7 +26,6 @@
#define GF_MONITOR_MANAGER_PRIVATE_H
#include <libgnome-desktop/gnome-pnp-ids.h>
#include <libupower-glib/upower.h>
#include "gf-backend-private.h"
#include "gf-dbus-display-config.h"
......@@ -70,8 +69,6 @@ struct _GfMonitorManager
GfMonitorConfigManager *config_manager;
GnomePnpIds *pnp_ids;
UpClient *up_client;
gboolean lid_is_closed;
GfMonitorSwitchConfigType current_switch_config;
};
......@@ -83,8 +80,6 @@ typedef struct
GBytes * (* read_edid) (GfMonitorManager *manager,
GfOutput *output);
gboolean (* is_lid_closed) (GfMonitorManager *manager);
void (* read_current_state) (GfMonitorManager *manager);
void (* ensure_initial_config) (GfMonitorManager *manager);
......@@ -126,6 +121,7 @@ typedef struct
GfMonitorTransform transform);
gfloat (* calculate_monitor_mode_scale) (GfMonitorManager *manager,
GfLogicalMonitorLayoutMode layout_mode,
GfMonitor *monitor,
GfMonitorMode *monitor_mode);
......@@ -191,9 +187,8 @@ GfMonitorsConfig *gf_monitor_manager_ensure_configured (GfM
void gf_monitor_manager_update_logical_state_derived (GfMonitorManager *manager,
GfMonitorsConfig *config);
gboolean gf_monitor_manager_is_lid_closed (GfMonitorManager *manager);
gfloat gf_monitor_manager_calculate_monitor_mode_scale (GfMonitorManager *manager,
GfLogicalMonitorLayoutMode layout_mode,
GfMonitor *monitor,
GfMonitorMode *monitor_mode);
......@@ -227,6 +222,9 @@ GfPowerSave gf_monitor_manager_get_power_save_mode (GfM
void gf_monitor_manager_power_save_mode_changed (GfMonitorManager *manager,
GfPowerSave mode);
gboolean gf_monitor_manager_is_monitor_visible (GfMonitorManager *manager,
GfMonitor *monitor);
G_END_DECLS
#endif
......@@ -64,9 +64,6 @@ struct _GfMonitorManagerXrandr
GHashTable *tiled_monitor_atoms;
Time last_xrandr_set_timestamp;
gfloat *supported_scales;
gint n_supported_scales;
};
typedef struct
......@@ -76,97 +73,6 @@ typedef struct
G_DEFINE_TYPE (GfMonitorManagerXrandr, gf_monitor_manager_xrandr, GF_TYPE_MONITOR_MANAGER)
static void
add_supported_scale (GArray *supported_scales,
gfloat scale)
{
guint i;
for (i = 0; i < supported_scales->len; i++)
{
gfloat supported_scale;
supported_scale = g_array_index (supported_scales, gfloat, i);
if (scale == supported_scale)
return;
}
g_array_append_val (supported_scales, scale);
}
static gint
compare_scales (gconstpointer a,
gconstpointer b)
{
gfloat f = *(gfloat *) a - *(gfloat *) b;
if (f < 0)
return -1;
if (f > 0)
return 1;
return 0;
}
static void
ensure_supported_monitor_scales (GfMonitorManager *manager)
{
GfMonitorManagerXrandr *xrandr;
GfMonitorScalesConstraint constraints;
GArray *supported_scales;
GList *l;
xrandr = GF_MONITOR_MANAGER_XRANDR (manager);
if (xrandr->supported_scales)
return;
constraints = GF_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
supported_scales = g_array_new (FALSE, FALSE, sizeof (gfloat));
for (l = manager->monitors; l; l = l->next)
{
GfMonitor *monitor;
GfMonitorMode *monitor_mode;
gfloat *monitor_scales;
gint n_monitor_scales;
gint i;
monitor = l->data;
monitor_mode = gf_monitor_get_preferred_mode (monitor);
monitor_scales = gf_monitor_calculate_supported_scales (monitor,
monitor_mode,
constraints,
&n_monitor_scales);
for (i = 0; i < n_monitor_scales; i++)
{
add_supported_scale (supported_scales, monitor_scales[i]);
}
g_array_sort (supported_scales, compare_scales);
g_free (monitor_scales);
}
xrandr->supported_scales = (gfloat *) supported_scales->data;
xrandr->n_supported_scales = supported_scales->len;
g_array_free (supported_scales, FALSE);
}
static void
gf_monitor_manager_xrandr_rebuild_derived (GfMonitorManager *manager,
GfMonitorsConfig *config)
{
GfMonitorManagerXrandr *xrandr;
xrandr = GF_MONITOR_MANAGER_XRANDR (manager);
g_clear_pointer (&xrandr->supported_scales, g_free);
gf_monitor_manager_rebuild_derived (manager, config);
}
static gboolean
xrandr_set_crtc_config (GfMonitorManagerXrandr *xrandr,
GfCrtc *crtc,
......@@ -728,18 +634,6 @@ gf_monitor_manager_xrandr_dispose (GObject *object)
G_OBJECT_CLASS (gf_monitor_manager_xrandr_parent_class)->dispose (object);
}
static void
gf_monitor_manager_xrandr_finalize (GObject *object)
{
GfMonitorManagerXrandr *xrandr;
xrandr = GF_MONITOR_MANAGER_XRANDR (object);
g_clear_pointer (&xrandr->supported_scales, g_free);
G_OBJECT_CLASS (gf_monitor_manager_xrandr_parent_class)->finalize (object);
}
static GBytes *
gf_monitor_manager_xrandr_read_edid (GfMonitorManager *manager,
GfOutput *output)
......@@ -827,7 +721,7 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
if (!config)
{
gf_monitor_manager_xrandr_rebuild_derived (manager, NULL);
gf_monitor_manager_rebuild_derived (manager, NULL);
return TRUE;
}
......@@ -861,7 +755,7 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
}
else
{
gf_monitor_manager_xrandr_rebuild_derived (manager, config);
gf_monitor_manager_rebuild_derived (manager, config);
}
}
......@@ -1048,11 +942,16 @@ gf_monitor_manager_xrandr_is_transform_handled (GfMonitorManager *manager,
}
static gfloat
gf_monitor_manager_xrandr_calculate_monitor_mode_scale (GfMonitorManager *manager,
GfMonitor *monitor,
GfMonitorMode *monitor_mode)
gf_monitor_manager_xrandr_calculate_monitor_mode_scale (GfMonitorManager *manager,
GfLogicalMonitorLayoutMode layout_mode,
GfMonitor *monitor,
GfMonitorMode *monitor_mode)
{
return gf_monitor_calculate_mode_scale (monitor, monitor_mode);
GfMonitorScalesConstraint constraints;
constraints = GF_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
return gf_monitor_calculate_mode_scale (monitor, monitor_mode, constraints);
}
static gfloat *
......@@ -1062,15 +961,14 @@ gf_monitor_manager_xrandr_calculate_supported_scales (GfMonitorManager
GfMonitorMode *monitor_mode,
gint *n_supported_scales)
{
GfMonitorManagerXrandr *xrandr;
xrandr = GF_MONITOR_MANAGER_XRANDR (manager);
GfMonitorScalesConstraint constraints;
ensure_supported_monitor_scales (manager);
constraints = GF_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
*n_supported_scales = xrandr->n_supported_scales;
return g_memdup2 (xrandr->supported_scales,
xrandr->n_supported_scales * sizeof (gfloat));
return gf_monitor_calculate_supported_scales (monitor,
monitor_mode,
constraints,
n_supported_scales);
}
static GfMonitorManagerCapability
......@@ -1113,7 +1011,6 @@ gf_monitor_manager_xrandr_class_init (GfMonitorManagerXrandrClass *xrandr_class)
object_class->constructed = gf_monitor_manager_xrandr_constructed;
object_class->dispose = gf_monitor_manager_xrandr_dispose;
object_class->finalize = gf_monitor_manager_xrandr_finalize;
manager_class->read_edid = gf_monitor_manager_xrandr_read_edid;
manager_class->read_current_state = gf_monitor_manager_xrandr_read_current_state;
......@@ -1192,7 +1089,7 @@ gf_monitor_manager_xrandr_handle_xevent (GfMonitorManagerXrandr *xrandr,
config = gf_monitor_config_manager_get_current (config_manager);
}
gf_monitor_manager_xrandr_rebuild_derived (manager, config);
gf_monitor_manager_rebuild_derived (manager, config);
}
return TRUE;
......
This diff is collapsed.
......@@ -157,8 +157,11 @@ gf_monitor_normal_get_suggested_position (GfMonitor *monitor,
if (output_info->suggested_x < 0 && output_info->suggested_y < 0)
return FALSE;
*x = output_info->suggested_x;
*y = output_info->suggested_y;
if (x != NULL)
*x = output_info->suggested_x;
if (y != NULL)
*y = output_info->suggested_y;
return TRUE;
}
......
......@@ -204,7 +204,8 @@ void gf_monitor_calculate_crtc_pos (GfMonitor
gint *out_y);
gfloat gf_monitor_calculate_mode_scale (GfMonitor *monitor,
GfMonitorMode *monitor_mode);
GfMonitorMode *monitor_mode,
GfMonitorScalesConstraint constraints);
gfloat *gf_monitor_calculate_supported_scales (GfMonitor *monitor,
GfMonitorMode *monitor_mode,
......
......@@ -36,6 +36,8 @@ struct _GfMonitorSpec
GfMonitorSpec *gf_monitor_spec_clone (GfMonitorSpec *spec);
guint gf_monitor_spec_hash (gconstpointer key);
gboolean gf_monitor_spec_equals (GfMonitorSpec *spec,
GfMonitorSpec *other_spec);
......
......@@ -41,6 +41,17 @@ gf_monitor_spec_clone (GfMonitorSpec *spec)
return new_spec;
}
guint
gf_monitor_spec_hash (gconstpointer key)
{
const GfMonitorSpec *monitor_spec = key;
return (g_str_hash (monitor_spec->connector) +
g_str_hash (monitor_spec->vendor) +
g_str_hash (monitor_spec->product) +
g_str_hash (monitor_spec->serial));
}
gboolean
gf_monitor_spec_equals (GfMonitorSpec *spec,
GfMonitorSpec *other_spec)
......
......@@ -18,6 +18,29 @@
#include "config.h"
#include "gf-monitor-transform.h"
GfMonitorTransform
gf_monitor_transform_from_orientation (GfOrientation orientation)
{
switch (orientation)
{
case GF_ORIENTATION_BOTTOM_UP:
return GF_MONITOR_TRANSFORM_180;
case GF_ORIENTATION_LEFT_UP:
return GF_MONITOR_TRANSFORM_90;
case GF_ORIENTATION_RIGHT_UP:
return GF_MONITOR_TRANSFORM_270;
case GF_ORIENTATION_UNDEFINED:
case GF_ORIENTATION_NORMAL:
default:
break;
}
return GF_MONITOR_TRANSFORM_NORMAL;
}
GfMonitorTransform
gf_monitor_transform_invert (GfMonitorTransform transform)
{
......
......@@ -21,6 +21,8 @@
#include <glib-object.h>
#include "gf-orientation-manager-private.h"
G_BEGIN_DECLS
typedef enum
......@@ -50,10 +52,12 @@ gf_monitor_transform_is_flipped (GfMonitorTransform transform)
return (transform >= GF_MONITOR_TRANSFORM_FLIPPED);
}
GfMonitorTransform gf_monitor_transform_invert (GfMonitorTransform transform);
GfMonitorTransform gf_monitor_transform_from_orientation (GfOrientation orientation);
GfMonitorTransform gf_monitor_transform_invert (GfMonitorTransform transform);
GfMonitorTransform gf_monitor_transform_transform (GfMonitorTransform transform,
GfMonitorTransform other);
GfMonitorTransform gf_monitor_transform_transform (GfMonitorTransform transform,
GfMonitorTransform other);
G_END_DECLS
......