Skip to content
Commits on Source (22)
......@@ -184,8 +184,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \
ChangeLog INSTALL NEWS README build-aux/compile \
build-aux/config.guess build-aux/config.rpath \
build-aux/config.sub build-aux/depcomp build-aux/install-sh \
build-aux/ltmain.sh build-aux/missing
build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \
build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -290,6 +290,7 @@ GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNOME_FLASHBACK_CFLAGS = @GNOME_FLASHBACK_CFLAGS@
GNOME_FLASHBACK_LIBS = @GNOME_FLASHBACK_LIBS@
GNOME_KEYBINDINGS_KEYSDIR = @GNOME_KEYBINDINGS_KEYSDIR@
GNOME_PANEL_LAYOUTS_DIR = @GNOME_PANEL_LAYOUTS_DIR@
GNOME_PANEL_MODULES_DIR = @GNOME_PANEL_MODULES_DIR@
GREP = @GREP@
......@@ -327,6 +328,8 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEDIA_KEYS_CFLAGS = @MEDIA_KEYS_CFLAGS@
MEDIA_KEYS_LIBS = @MEDIA_KEYS_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......
Version 3.43.1
==============
- Changes/fixes to monitor manager from mutter.
- Add media keys manager (to restore screenshot keybindings).
- Updated translations.
Version 3.42.1
==============
- Fix crash in monitor manager. (!41)
......
......@@ -315,6 +315,7 @@ GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNOME_FLASHBACK_CFLAGS = @GNOME_FLASHBACK_CFLAGS@
GNOME_FLASHBACK_LIBS = @GNOME_FLASHBACK_LIBS@
GNOME_KEYBINDINGS_KEYSDIR = @GNOME_KEYBINDINGS_KEYSDIR@
GNOME_PANEL_LAYOUTS_DIR = @GNOME_PANEL_LAYOUTS_DIR@
GNOME_PANEL_MODULES_DIR = @GNOME_PANEL_MODULES_DIR@
GREP = @GREP@
......@@ -352,6 +353,8 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEDIA_KEYS_CFLAGS = @MEDIA_KEYS_CFLAGS@
MEDIA_KEYS_LIBS = @MEDIA_KEYS_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......
......@@ -676,10 +676,25 @@ static const _ExtendedGDBusPropertyInfo _gf_dbus_display_config_property_info_pa
TRUE
};
static const _ExtendedGDBusPropertyInfo _gf_dbus_display_config_property_info_apply_monitors_config_allowed =
{
{
-1,
(gchar *) "ApplyMonitorsConfigAllowed",
(gchar *) "b",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"apply-monitors-config-allowed",
FALSE,
TRUE
};
static const GDBusPropertyInfo * const _gf_dbus_display_config_property_info_pointers[] =
{
&_gf_dbus_display_config_property_info_power_save_mode.parent_struct,
&_gf_dbus_display_config_property_info_panel_orientation_managed.parent_struct,
&_gf_dbus_display_config_property_info_apply_monitors_config_allowed.parent_struct,
NULL
};
......@@ -725,6 +740,7 @@ gf_dbus_display_config_override_properties (GObjectClass *klass, guint property_
{
g_object_class_override_property (klass, property_id_begin++, "power-save-mode");
g_object_class_override_property (klass, property_id_begin++, "panel-orientation-managed");
g_object_class_override_property (klass, property_id_begin++, "apply-monitors-config-allowed");
return property_id_begin - 1;
}
......@@ -745,6 +761,7 @@ gf_dbus_display_config_override_properties (GObjectClass *klass, guint property_
* @handle_get_current_state: Handler for the #GfDBusDisplayConfig::handle-get-current-state signal.
* @handle_get_resources: Handler for the #GfDBusDisplayConfig::handle-get-resources signal.
* @handle_set_crtc_gamma: Handler for the #GfDBusDisplayConfig::handle-set-crtc-gamma signal.
* @get_apply_monitors_config_allowed: Getter for the #GfDBusDisplayConfig:apply-monitors-config-allowed property.
* @get_panel_orientation_managed: Getter for the #GfDBusDisplayConfig:panel-orientation-managed property.
* @get_power_save_mode: Getter for the #GfDBusDisplayConfig:power-save-mode property.
* @monitors_changed: Handler for the #GfDBusDisplayConfig::monitors-changed signal.
......@@ -766,7 +783,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.GetResources">GetResources()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_resources() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_resources() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -791,7 +808,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.ChangeBacklight">ChangeBacklight()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_change_backlight() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_change_backlight() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -815,7 +832,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.GetCrtcGamma">GetCrtcGamma()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_crtc_gamma() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_crtc_gamma() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -842,7 +859,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.SetCrtcGamma">SetCrtcGamma()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_set_crtc_gamma() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_set_crtc_gamma() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -864,7 +881,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.GetCurrentState">GetCurrentState()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_current_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_get_current_state() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -890,7 +907,7 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-DisplayConfig.ApplyMonitorsConfig">ApplyMonitorsConfig()</link> D-Bus method.
*
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_apply_monitors_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
* If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gf_dbus_display_config_complete_apply_monitors_config() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
*/
......@@ -943,6 +960,15 @@ gf_dbus_display_config_default_init (GfDBusDisplayConfigIface *iface)
*/
g_object_interface_install_property (iface,
g_param_spec_boolean ("panel-orientation-managed", "PanelOrientationManaged", "PanelOrientationManaged", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GfDBusDisplayConfig:apply-monitors-config-allowed:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-gnome-Mutter-DisplayConfig.ApplyMonitorsConfigAllowed">"ApplyMonitorsConfigAllowed"</link>.
*
* Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
*/
g_object_interface_install_property (iface,
g_param_spec_boolean ("apply-monitors-config-allowed", "ApplyMonitorsConfigAllowed", "ApplyMonitorsConfigAllowed", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
/**
......@@ -1007,6 +1033,37 @@ gf_dbus_display_config_set_panel_orientation_managed (GfDBusDisplayConfig *objec
g_object_set (G_OBJECT (object), "panel-orientation-managed", value, NULL);
}
/**
* gf_dbus_display_config_get_apply_monitors_config_allowed: (skip)
* @object: A #GfDBusDisplayConfig.
*
* Gets the value of the <link linkend="gdbus-property-org-gnome-Mutter-DisplayConfig.ApplyMonitorsConfigAllowed">"ApplyMonitorsConfigAllowed"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: The property value.
*/
gboolean
gf_dbus_display_config_get_apply_monitors_config_allowed (GfDBusDisplayConfig *object)
{
return GF_DBUS_DISPLAY_CONFIG_GET_IFACE (object)->get_apply_monitors_config_allowed (object);
}
/**
* gf_dbus_display_config_set_apply_monitors_config_allowed: (skip)
* @object: A #GfDBusDisplayConfig.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-gnome-Mutter-DisplayConfig.ApplyMonitorsConfigAllowed">"ApplyMonitorsConfigAllowed"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
gf_dbus_display_config_set_apply_monitors_config_allowed (GfDBusDisplayConfig *object, gboolean value)
{
g_object_set (G_OBJECT (object), "apply-monitors-config-allowed", value, NULL);
}
/**
* gf_dbus_display_config_emit_monitors_changed:
* @object: A #GfDBusDisplayConfig.
......@@ -1938,7 +1995,7 @@ gf_dbus_display_config_proxy_get_property (GObject *object,
{
const _ExtendedGDBusPropertyInfo *info;
GVariant *variant;
g_assert (prop_id != 0 && prop_id - 1 < 2);
g_assert (prop_id != 0 && prop_id - 1 < 3);
info = (const _ExtendedGDBusPropertyInfo *) _gf_dbus_display_config_property_info_pointers[prop_id - 1];
variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
if (info->use_gvariant)
......@@ -1985,7 +2042,7 @@ gf_dbus_display_config_proxy_set_property (GObject *object,
{
const _ExtendedGDBusPropertyInfo *info;
GVariant *variant;
g_assert (prop_id != 0 && prop_id - 1 < 2);
g_assert (prop_id != 0 && prop_id - 1 < 3);
info = (const _ExtendedGDBusPropertyInfo *) _gf_dbus_display_config_property_info_pointers[prop_id - 1];
variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
g_dbus_proxy_call (G_DBUS_PROXY (object),
......@@ -2097,6 +2154,21 @@ gf_dbus_display_config_proxy_get_panel_orientation_managed (GfDBusDisplayConfig
return value;
}
static gboolean
gf_dbus_display_config_proxy_get_apply_monitors_config_allowed (GfDBusDisplayConfig *object)
{
GfDBusDisplayConfigProxy *proxy = GF_DBUS_DISPLAY_CONFIG_PROXY (object);
GVariant *variant;
gboolean value = 0;
variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ApplyMonitorsConfigAllowed");
if (variant != NULL)
{
value = g_variant_get_boolean (variant);
g_variant_unref (variant);
}
return value;
}
static void
gf_dbus_display_config_proxy_init (GfDBusDisplayConfigProxy *proxy)
{
......@@ -2136,6 +2208,7 @@ gf_dbus_display_config_proxy_iface_init (GfDBusDisplayConfigIface *iface)
{
iface->get_power_save_mode = gf_dbus_display_config_proxy_get_power_save_mode;
iface->get_panel_orientation_managed = gf_dbus_display_config_proxy_get_panel_orientation_managed;
iface->get_apply_monitors_config_allowed = gf_dbus_display_config_proxy_get_apply_monitors_config_allowed;
}
/**
......@@ -2584,7 +2657,7 @@ gf_dbus_display_config_skeleton_finalize (GObject *object)
{
GfDBusDisplayConfigSkeleton *skeleton = GF_DBUS_DISPLAY_CONFIG_SKELETON (object);
guint n;
for (n = 0; n < 2; n++)
for (n = 0; n < 3; n++)
g_value_unset (&skeleton->priv->properties[n]);
g_free (skeleton->priv->properties);
g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
......@@ -2602,7 +2675,7 @@ gf_dbus_display_config_skeleton_get_property (GObject *object,
GParamSpec *pspec G_GNUC_UNUSED)
{
GfDBusDisplayConfigSkeleton *skeleton = GF_DBUS_DISPLAY_CONFIG_SKELETON (object);
g_assert (prop_id != 0 && prop_id - 1 < 2);
g_assert (prop_id != 0 && prop_id - 1 < 3);
g_mutex_lock (&skeleton->priv->lock);
g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
g_mutex_unlock (&skeleton->priv->lock);
......@@ -2721,7 +2794,7 @@ gf_dbus_display_config_skeleton_set_property (GObject *object,
{
const _ExtendedGDBusPropertyInfo *info;
GfDBusDisplayConfigSkeleton *skeleton = GF_DBUS_DISPLAY_CONFIG_SKELETON (object);
g_assert (prop_id != 0 && prop_id - 1 < 2);
g_assert (prop_id != 0 && prop_id - 1 < 3);
info = (const _ExtendedGDBusPropertyInfo *) _gf_dbus_display_config_property_info_pointers[prop_id - 1];
g_mutex_lock (&skeleton->priv->lock);
g_object_freeze_notify (object);
......@@ -2748,9 +2821,10 @@ gf_dbus_display_config_skeleton_init (GfDBusDisplayConfigSkeleton *skeleton)
g_mutex_init (&skeleton->priv->lock);
skeleton->priv->context = g_main_context_ref_thread_default ();
skeleton->priv->properties = g_new0 (GValue, 2);
skeleton->priv->properties = g_new0 (GValue, 3);
g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN);
g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
}
static gint
......@@ -2775,6 +2849,17 @@ gf_dbus_display_config_skeleton_get_panel_orientation_managed (GfDBusDisplayConf
return value;
}
static gboolean
gf_dbus_display_config_skeleton_get_apply_monitors_config_allowed (GfDBusDisplayConfig *object)
{
GfDBusDisplayConfigSkeleton *skeleton = GF_DBUS_DISPLAY_CONFIG_SKELETON (object);
gboolean value;
g_mutex_lock (&skeleton->priv->lock);
value = g_value_get_boolean (&(skeleton->priv->properties[2]));
g_mutex_unlock (&skeleton->priv->lock);
return value;
}
static void
gf_dbus_display_config_skeleton_class_init (GfDBusDisplayConfigSkeletonClass *klass)
{
......@@ -2807,6 +2892,7 @@ gf_dbus_display_config_skeleton_iface_init (GfDBusDisplayConfigIface *iface)
iface->monitors_changed = _gf_dbus_display_config_on_signal_monitors_changed;
iface->get_power_save_mode = gf_dbus_display_config_skeleton_get_power_save_mode;
iface->get_panel_orientation_managed = gf_dbus_display_config_skeleton_get_panel_orientation_managed;
iface->get_apply_monitors_config_allowed = gf_dbus_display_config_skeleton_get_apply_monitors_config_allowed;
}
/**
......
......@@ -70,6 +70,8 @@ struct _GfDBusDisplayConfigIface
GVariant *arg_green,
GVariant *arg_blue);
gboolean (*get_apply_monitors_config_allowed) (GfDBusDisplayConfig *object);
gboolean (*get_panel_orientation_managed) (GfDBusDisplayConfig *object);
gint (*get_power_save_mode) (GfDBusDisplayConfig *object);
......@@ -294,6 +296,9 @@ void gf_dbus_display_config_set_power_save_mode (GfDBusDisplayConfig *object, gi
gboolean gf_dbus_display_config_get_panel_orientation_managed (GfDBusDisplayConfig *object);
void gf_dbus_display_config_set_panel_orientation_managed (GfDBusDisplayConfig *object, gboolean value);
gboolean gf_dbus_display_config_get_apply_monitors_config_allowed (GfDBusDisplayConfig *object);
void gf_dbus_display_config_set_apply_monitors_config_allowed (GfDBusDisplayConfig *object, gboolean value);
/* ---- */
......
......@@ -26,29 +26,39 @@
G_BEGIN_DECLS
typedef struct
{
gboolean enable_dbus;
} GfMonitorConfigPolicy;
#define GF_TYPE_MONITOR_CONFIG_STORE (gf_monitor_config_store_get_type ())
G_DECLARE_FINAL_TYPE (GfMonitorConfigStore, gf_monitor_config_store,
GF, MONITOR_CONFIG_STORE, GObject)
GfMonitorConfigStore *gf_monitor_config_store_new (GfMonitorManager *monitor_manager);
GfMonitorConfigStore *gf_monitor_config_store_new (GfMonitorManager *monitor_manager);
GfMonitorsConfig *gf_monitor_config_store_lookup (GfMonitorConfigStore *config_store,
GfMonitorsConfigKey *key);
void gf_monitor_config_store_add (GfMonitorConfigStore *config_store,
GfMonitorsConfig *config);
GfMonitorsConfig *gf_monitor_config_store_lookup (GfMonitorConfigStore *config_store,
GfMonitorsConfigKey *key);
void gf_monitor_config_store_remove (GfMonitorConfigStore *config_store,
GfMonitorsConfig *config);
void gf_monitor_config_store_add (GfMonitorConfigStore *config_store,
GfMonitorsConfig *config);
gboolean gf_monitor_config_store_set_custom (GfMonitorConfigStore *config_store,
const gchar *read_path,
const gchar *write_path,
GfMonitorsConfigFlag flags,
GError **error);
void gf_monitor_config_store_remove (GfMonitorConfigStore *config_store,
GfMonitorsConfig *config);
gint gf_monitor_config_store_get_config_count (GfMonitorConfigStore *config_store);
gboolean gf_monitor_config_store_set_custom (GfMonitorConfigStore *config_store,
const gchar *read_path,
const gchar *write_path,
GError **error);
GfMonitorManager *gf_monitor_config_store_get_monitor_manager (GfMonitorConfigStore *config_store);
gint gf_monitor_config_store_get_config_count (GfMonitorConfigStore *config_store);
void gf_monitor_config_store_reset (GfMonitorConfigStore *config_store);
GfMonitorManager *gf_monitor_config_store_get_monitor_manager (GfMonitorConfigStore *config_store);
const GfMonitorConfigPolicy *gf_monitor_config_store_get_policy (GfMonitorConfigStore *config_store);
G_END_DECLS
......
This diff is collapsed.
......@@ -33,6 +33,7 @@
#include "gf-crtc-private.h"
#include "gf-logical-monitor-private.h"
#include "gf-monitor-config-manager-private.h"
#include "gf-monitor-config-store-private.h"
#include "gf-monitor-manager-private.h"
#include "gf-monitor-normal-private.h"
#include "gf-monitor-private.h"
......@@ -1989,6 +1990,8 @@ gf_monitor_manager_handle_apply_monitors_config (GfDBusDisplayConfig *skeleton
GVariant *properties_variant,
GfMonitorManager *manager)
{
GfMonitorConfigStore *config_store;
const GfMonitorConfigPolicy *policy;
GfMonitorManagerCapability capabilities;
GVariant *layout_mode_variant;
GfLogicalMonitorLayoutMode layout_mode;
......@@ -2005,6 +2008,17 @@ gf_monitor_manager_handle_apply_monitors_config (GfDBusDisplayConfig *skeleton
return TRUE;
}
config_store = gf_monitor_config_manager_get_store (manager->config_manager);
policy = gf_monitor_config_store_get_policy (config_store);
if (!policy->enable_dbus)
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_ACCESS_DENIED,
"Monitor configuration via D-Bus is disabled");
return TRUE;
}
capabilities = gf_monitor_manager_get_capabilities (manager);
layout_mode_variant = NULL;
logical_monitor_configs = NULL;
......@@ -2465,6 +2479,8 @@ gf_monitor_manager_setup (GfMonitorManager *manager)
{
GfMonitorManagerPrivate *priv;
GfMonitorManagerClass *manager_class;
GfMonitorConfigStore *config_store;
const GfMonitorConfigPolicy *policy;
priv = gf_monitor_manager_get_instance_private (manager);
manager_class = GF_MONITOR_MANAGER_GET_CLASS (manager);
......@@ -2476,6 +2492,12 @@ gf_monitor_manager_setup (GfMonitorManager *manager)
gf_monitor_manager_read_current_state (manager);
manager_class->ensure_initial_config (manager);
config_store = gf_monitor_config_manager_get_store (manager->config_manager);
policy = gf_monitor_config_store_get_policy (config_store);
gf_dbus_display_config_set_apply_monitors_config_allowed (manager->display_config,
policy->enable_dbus);
priv->in_init = FALSE;
}
......
......@@ -231,6 +231,13 @@
-->
<property name="PanelOrientationManaged" type="b" access="read" />
<!--
ApplyMonitorsConfigAllowed:
Whether calling the ApplyMonitorsConfig method is allowed.
-->
<property name="ApplyMonitorsConfigAllowed" type="b" access="read" />
<!--
MonitorsChanged:
......
This diff is collapsed.
This diff is collapsed.
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for gnome-flashback 3.42.1.
# Generated by GNU Autoconf 2.71 for gnome-flashback 3.43.1.
#
# Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-flashback>.
#
......@@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gnome-flashback'
PACKAGE_TARNAME='gnome-flashback'
PACKAGE_VERSION='3.42.1'
PACKAGE_STRING='gnome-flashback 3.42.1'
PACKAGE_VERSION='3.43.1'
PACKAGE_STRING='gnome-flashback 3.43.1'
PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-flashback'
PACKAGE_URL=''
 
......@@ -672,6 +672,7 @@ SYSTEM_INDICATORS_LIBS
SYSTEM_INDICATORS_CFLAGS
GNOME_PANEL_MODULES_DIR
GNOME_PANEL_LAYOUTS_DIR
GNOME_KEYBINDINGS_KEYSDIR
HIDDEN_UNDER_SYSTEMD
ENABLE_SYSTEMD_SESSION_FALSE
ENABLE_SYSTEMD_SESSION_TRUE
......@@ -697,6 +698,8 @@ POLKIT_LIBS
POLKIT_CFLAGS
NOTIFICATIONS_LIBS
NOTIFICATIONS_CFLAGS
MEDIA_KEYS_LIBS
MEDIA_KEYS_CFLAGS
INPUT_SOURCES_LIBS
INPUT_SOURCES_CFLAGS
INPUT_SETTINGS_LIBS
......@@ -940,6 +943,8 @@ INPUT_SETTINGS_CFLAGS
INPUT_SETTINGS_LIBS
INPUT_SOURCES_CFLAGS
INPUT_SOURCES_LIBS
MEDIA_KEYS_CFLAGS
MEDIA_KEYS_LIBS
NOTIFICATIONS_CFLAGS
NOTIFICATIONS_LIBS
POLKIT_CFLAGS
......@@ -1510,7 +1515,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gnome-flashback 3.42.1 to adapt to many kinds of systems.
\`configure' configures gnome-flashback 3.43.1 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1581,7 +1586,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gnome-flashback 3.42.1:";;
short | recursive ) echo "Configuration of gnome-flashback 3.43.1:";;
esac
cat <<\_ACEOF
 
......@@ -1701,6 +1706,10 @@ Some influential environment variables:
C compiler flags for INPUT_SOURCES, overriding pkg-config
INPUT_SOURCES_LIBS
linker flags for INPUT_SOURCES, overriding pkg-config
MEDIA_KEYS_CFLAGS
C compiler flags for MEDIA_KEYS, overriding pkg-config
MEDIA_KEYS_LIBS
linker flags for MEDIA_KEYS, overriding pkg-config
NOTIFICATIONS_CFLAGS
C compiler flags for NOTIFICATIONS, overriding pkg-config
NOTIFICATIONS_LIBS
......@@ -1808,7 +1817,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gnome-flashback configure 3.42.1
gnome-flashback configure 3.43.1
generated by GNU Autoconf 2.71
 
Copyright (C) 2021 Free Software Foundation, Inc.
......@@ -2107,7 +2116,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by gnome-flashback $as_me 3.42.1, which was
It was created by gnome-flashback $as_me 3.43.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
 
$ $0$ac_configure_args_raw
......@@ -6420,7 +6429,7 @@ fi
 
# Define the identity of the package.
PACKAGE='gnome-flashback'
VERSION='3.42.1'
VERSION='3.43.1'
 
 
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
......@@ -20414,6 +20423,131 @@ printf "%s\n" "yes" >&6; }
fi
 
 
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
" >&5
printf %s "checking for
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
... " >&6; }
if test -n "$MEDIA_KEYS_CFLAGS"; then
pkg_cv_MEDIA_KEYS_CFLAGS="$MEDIA_KEYS_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"
glib-2.0 >= \$GLIB_REQUIRED
gtk+-3.0 >= \$GTK_REQUIRED
\""; } >&5
($PKG_CONFIG --exists --print-errors "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_MEDIA_KEYS_CFLAGS=`$PKG_CONFIG --cflags "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$MEDIA_KEYS_LIBS"; then
pkg_cv_MEDIA_KEYS_LIBS="$MEDIA_KEYS_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"
glib-2.0 >= \$GLIB_REQUIRED
gtk+-3.0 >= \$GTK_REQUIRED
\""; } >&5
($PKG_CONFIG --exists --print-errors "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_MEDIA_KEYS_LIBS=`$PKG_CONFIG --libs "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
MEDIA_KEYS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
" 2>&1`
else
MEDIA_KEYS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$MEDIA_KEYS_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
) were not met:
$MEDIA_KEYS_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables MEDIA_KEYS_CFLAGS
and MEDIA_KEYS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables MEDIA_KEYS_CFLAGS
and MEDIA_KEYS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
MEDIA_KEYS_CFLAGS=$pkg_cv_MEDIA_KEYS_CFLAGS
MEDIA_KEYS_LIBS=$pkg_cv_MEDIA_KEYS_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
fi
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
......@@ -21938,6 +22072,10 @@ fi
 
 
 
GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
GNOME_PANEL_LAYOUTS_DIR=`$PKG_CONFIG --variable=layoutsdir libgnome-panel`
GNOME_PANEL_LAYOUTS_DIR=$GNOME_PANEL_LAYOUTS_DIR
 
......@@ -22309,7 +22447,7 @@ REQUIRED_COMPNENTS_GSD=" \
 
 
 
ac_config_files="$ac_config_files Makefile backends/Makefile data/Makefile data/applications/Makefile data/autostart/Makefile data/compizconfig/Makefile data/directories/Makefile data/gnome-panel/Makefile data/menus/Makefile data/schemas/Makefile data/sessions/Makefile data/systemd/Makefile data/theme/Makefile data/theme/Adwaita/Makefile data/theme/HighContrast/Makefile data/theme/Yaru/Makefile data/ui/Makefile data/xsessions/Makefile dbus/Makefile daemons/Makefile daemons/clipboard/Makefile gnome-flashback/Makefile gnome-flashback/liba11y-keyboard/Makefile gnome-flashback/libaudio-device-selection/Makefile gnome-flashback/libautomount-manager/Makefile gnome-flashback/libcommon/Makefile gnome-flashback/libdesktop/Makefile gnome-flashback/libend-session-dialog/Makefile gnome-flashback/libidle-monitor/Makefile gnome-flashback/libinput-settings/Makefile gnome-flashback/libinput-sources/Makefile gnome-flashback/libnotifications/Makefile gnome-flashback/libpolkit/Makefile gnome-flashback/libroot-background/Makefile gnome-flashback/libscreencast/Makefile gnome-flashback/libscreensaver/Makefile gnome-flashback/libscreenshot/Makefile gnome-flashback/libshell/Makefile gnome-flashback/libstatus-notifier-watcher/Makefile gvc/Makefile system-indicators/Makefile po/Makefile.in"
ac_config_files="$ac_config_files Makefile backends/Makefile data/Makefile data/applications/Makefile data/autostart/Makefile data/compizconfig/Makefile data/directories/Makefile data/gnome-panel/Makefile data/keybindings/Makefile data/menus/Makefile data/schemas/Makefile data/sessions/Makefile data/systemd/Makefile data/theme/Makefile data/theme/Adwaita/Makefile data/theme/HighContrast/Makefile data/theme/Yaru/Makefile data/ui/Makefile data/xsessions/Makefile dbus/Makefile daemons/Makefile daemons/clipboard/Makefile daemons/media-keys/Makefile gnome-flashback/Makefile gnome-flashback/liba11y-keyboard/Makefile gnome-flashback/libaudio-device-selection/Makefile gnome-flashback/libautomount-manager/Makefile gnome-flashback/libcommon/Makefile gnome-flashback/libdesktop/Makefile gnome-flashback/libend-session-dialog/Makefile gnome-flashback/libidle-monitor/Makefile gnome-flashback/libinput-settings/Makefile gnome-flashback/libinput-sources/Makefile gnome-flashback/libnotifications/Makefile gnome-flashback/libpolkit/Makefile gnome-flashback/libroot-background/Makefile gnome-flashback/libscreencast/Makefile gnome-flashback/libscreensaver/Makefile gnome-flashback/libscreenshot/Makefile gnome-flashback/libshell/Makefile gnome-flashback/libstatus-notifier-watcher/Makefile gvc/Makefile system-indicators/Makefile po/Makefile.in"
 
 
cat >confcache <<\_ACEOF
......@@ -22851,7 +22989,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gnome-flashback $as_me 3.42.1, which was
This file was extended by gnome-flashback $as_me 3.43.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -22919,7 +23057,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
gnome-flashback config.status 3.42.1
gnome-flashback config.status 3.43.1
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
 
......@@ -23350,6 +23488,7 @@ do
"data/compizconfig/Makefile") CONFIG_FILES="$CONFIG_FILES data/compizconfig/Makefile" ;;
"data/directories/Makefile") CONFIG_FILES="$CONFIG_FILES data/directories/Makefile" ;;
"data/gnome-panel/Makefile") CONFIG_FILES="$CONFIG_FILES data/gnome-panel/Makefile" ;;
"data/keybindings/Makefile") CONFIG_FILES="$CONFIG_FILES data/keybindings/Makefile" ;;
"data/menus/Makefile") CONFIG_FILES="$CONFIG_FILES data/menus/Makefile" ;;
"data/schemas/Makefile") CONFIG_FILES="$CONFIG_FILES data/schemas/Makefile" ;;
"data/sessions/Makefile") CONFIG_FILES="$CONFIG_FILES data/sessions/Makefile" ;;
......@@ -23363,6 +23502,7 @@ do
"dbus/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/Makefile" ;;
"daemons/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/Makefile" ;;
"daemons/clipboard/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/clipboard/Makefile" ;;
"daemons/media-keys/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/media-keys/Makefile" ;;
"gnome-flashback/Makefile") CONFIG_FILES="$CONFIG_FILES gnome-flashback/Makefile" ;;
"gnome-flashback/liba11y-keyboard/Makefile") CONFIG_FILES="$CONFIG_FILES gnome-flashback/liba11y-keyboard/Makefile" ;;
"gnome-flashback/libaudio-device-selection/Makefile") CONFIG_FILES="$CONFIG_FILES gnome-flashback/libaudio-device-selection/Makefile" ;;
......
......@@ -3,7 +3,7 @@ dnl Define version info
dnl **************************************************************************
m4_define([gf_major_version], [3])
m4_define([gf_minor_version], [42])
m4_define([gf_minor_version], [43])
m4_define([gf_micro_version], [1])
m4_define([gf_version], [gf_major_version.gf_minor_version.gf_micro_version])
......@@ -192,6 +192,11 @@ PKG_CHECK_MODULES([INPUT_SOURCES], [
xkeyboard-config
])
PKG_CHECK_MODULES([MEDIA_KEYS], [
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
])
PKG_CHECK_MODULES([NOTIFICATIONS], [
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
......@@ -303,6 +308,13 @@ AS_IF([test "x$enable_systemd_session" = "xyes"], [
AM_CONDITIONAL([ENABLE_SYSTEMD_SESSION], [test "x$enable_systemd_session" = "xyes"])
AC_SUBST([HIDDEN_UNDER_SYSTEMD])
dnl **************************************************************************
dnl Keybindings
dnl **************************************************************************
GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
AC_SUBST([GNOME_KEYBINDINGS_KEYSDIR])
dnl **************************************************************************
dnl System indicators
dnl **************************************************************************
......@@ -417,6 +429,7 @@ AC_CONFIG_FILES([
data/compizconfig/Makefile
data/directories/Makefile
data/gnome-panel/Makefile
data/keybindings/Makefile
data/menus/Makefile
data/schemas/Makefile
data/sessions/Makefile
......@@ -432,6 +445,7 @@ AC_CONFIG_FILES([
daemons/Makefile
daemons/clipboard/Makefile
daemons/media-keys/Makefile
gnome-flashback/Makefile
gnome-flashback/liba11y-keyboard/Makefile
......
......@@ -2,6 +2,7 @@ NULL =
SUBDIRS = \
clipboard \
media-keys \
$(NULL)
-include $(top_srcdir)/git.mk
......@@ -257,6 +257,7 @@ GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNOME_FLASHBACK_CFLAGS = @GNOME_FLASHBACK_CFLAGS@
GNOME_FLASHBACK_LIBS = @GNOME_FLASHBACK_LIBS@
GNOME_KEYBINDINGS_KEYSDIR = @GNOME_KEYBINDINGS_KEYSDIR@
GNOME_PANEL_LAYOUTS_DIR = @GNOME_PANEL_LAYOUTS_DIR@
GNOME_PANEL_MODULES_DIR = @GNOME_PANEL_MODULES_DIR@
GREP = @GREP@
......@@ -294,6 +295,8 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEDIA_KEYS_CFLAGS = @MEDIA_KEYS_CFLAGS@
MEDIA_KEYS_LIBS = @MEDIA_KEYS_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......@@ -405,6 +408,7 @@ top_srcdir = @top_srcdir@
NULL =
SUBDIRS = \
clipboard \
media-keys \
$(NULL)
all: all-recursive
......
......@@ -270,6 +270,7 @@ GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNOME_FLASHBACK_CFLAGS = @GNOME_FLASHBACK_CFLAGS@
GNOME_FLASHBACK_LIBS = @GNOME_FLASHBACK_LIBS@
GNOME_KEYBINDINGS_KEYSDIR = @GNOME_KEYBINDINGS_KEYSDIR@
GNOME_PANEL_LAYOUTS_DIR = @GNOME_PANEL_LAYOUTS_DIR@
GNOME_PANEL_MODULES_DIR = @GNOME_PANEL_MODULES_DIR@
GREP = @GREP@
......@@ -307,6 +308,8 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEDIA_KEYS_CFLAGS = @MEDIA_KEYS_CFLAGS@
MEDIA_KEYS_LIBS = @MEDIA_KEYS_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......
NULL =
libexec_PROGRAMS = \
gnome-flashback-media-keys \
$(NULL)
gnome_flashback_media_keys_CPPFLAGS = \
-DG_LOG_DOMAIN=\"gnome-flashback-media-keys\" \
-DG_LOG_USE_STRUCTURED=1 \
-I$(top_srcdir) \
$(NULL)
gnome_flashback_media_keys_CFLAGS = \
$(MEDIA_KEYS_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
gnome_flashback_media_keys_SOURCES = \
gf-media-keys-main.c \
gf-media-keys.c \
gf-media-keys.h \
gsd-media-keys-manager.c \
gsd-media-keys-manager.h \
gsd-screenshot-utils.c \
gsd-screenshot-utils.h \
media-keys.h \
shell-action-modes.h \
shortcuts-list.h \
$(NULL)
gnome_flashback_media_keys_LDFLAGS = \
$(WARN_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
gnome_flashback_media_keys_LDADD = \
$(top_builddir)/dbus/libdbus.la \
$(MEDIA_KEYS_LIBS) \
$(NULL)
-include $(top_srcdir)/git.mk
This diff is collapsed.
/*
* Copyright (C) 2022 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib-unix.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include "dbus/gf-session-manager-gen.h"
#include "dbus/gf-sm-client-private-gen.h"
#include "gf-media-keys.h"
static char *startup_id = NULL;
static GMainLoop *loop = NULL;
static GfSmClientPrivateGen *client_private = NULL;
static gboolean
on_term_signal (gpointer user_data)
{
g_main_loop_quit (loop);
return G_SOURCE_REMOVE;
}
static gboolean
on_int_signal (gpointer user_data)
{
g_main_loop_quit (loop);
return G_SOURCE_REMOVE;
}
static void
respond_to_end_session (void)
{
gf_sm_client_private_gen_call_end_session_response (client_private,
TRUE,
"",
NULL,
NULL,
NULL);
}
static void
end_session_cb (GfSmClientPrivateGen *object,
guint flags,
gpointer user_data)
{
respond_to_end_session ();
}
static void
query_end_session_cb (GfSmClientPrivateGen *object,
guint flags,
gpointer user_data)
{
respond_to_end_session ();
}
static void
stop_cb (GfSmClientPrivateGen *object,
gpointer user_data)
{
g_main_loop_quit (loop);
}
static void
client_private_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error;
error = NULL;
client_private = gf_sm_client_private_gen_proxy_new_for_bus_finish (res,
&error);
if (error != NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to get a client private proxy: %s", error->message);
g_error_free (error);
return;
}
g_signal_connect (client_private,
"end-session",
G_CALLBACK (end_session_cb),
NULL);
g_signal_connect (client_private,
"query-end-session",
G_CALLBACK (query_end_session_cb),
NULL);
g_signal_connect (client_private,
"stop",
G_CALLBACK (stop_cb),
NULL);
}
static void
register_client_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error;
char *client_id;
error = NULL;
gf_session_manager_gen_call_register_client_finish (GF_SESSION_MANAGER_GEN (source_object),
&client_id,
res,
&error);
if (error != NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to register client: %s", error->message);
g_error_free (error);
return;
}
gf_sm_client_private_gen_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
"org.gnome.SessionManager",
client_id,
NULL,
client_private_ready_cb,
NULL);
g_free (client_id);
}
static void
session_manager_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error;
GfSessionManagerGen *session_manager;
error = NULL;
session_manager = gf_session_manager_gen_proxy_new_for_bus_finish (res,
&error);
if (error != NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to get session manager proxy: %s", error->message);
g_error_free (error);
return;
}
gf_session_manager_gen_call_register_client (session_manager,
"gnome-flashback-media-keys",
startup_id,
NULL,
register_client_cb,
NULL);
g_object_unref (session_manager);
}
int
main (int argc,
char *argv[])
{
const char *autostart_id;
GfMediaKeys *media_keys;
autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
startup_id = g_strdup (autostart_id != NULL ? autostart_id : "");
g_unsetenv ("DESKTOP_AUTOSTART_ID");
gtk_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
media_keys = gf_media_keys_new ();
g_unix_signal_add (SIGTERM, on_term_signal, NULL);
g_unix_signal_add (SIGINT, on_int_signal, NULL);
gf_session_manager_gen_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
"org.gnome.SessionManager",
"/org/gnome/SessionManager",
NULL,
session_manager_ready_cb,
NULL);
g_main_loop_run (loop);
g_main_loop_unref (loop);
g_object_unref (media_keys);
g_clear_object (&client_private);
g_free (startup_id);
return EXIT_SUCCESS;
}