core: Add a debug control override to disable the a11y manager ACL
This commit adds another way how to disable the a11y manager ACL in development. Setting the unsafe mode might not be as straightforward as setting an environment variable for the session, and you can control it invidually too. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
This commit is contained in:
parent
1c34794b13
commit
a817d7c137
@ -12,7 +12,7 @@
|
|||||||
<property name="SessionManagementProtocol" type="b" access="readwrite" />
|
<property name="SessionManagementProtocol" type="b" access="readwrite" />
|
||||||
<property name="InhibitHwCursor" type="b" access="readwrite" />
|
<property name="InhibitHwCursor" type="b" access="readwrite" />
|
||||||
<property name="CursorShapeProtocol" type="b" access="readwrite" />
|
<property name="CursorShapeProtocol" type="b" access="readwrite" />
|
||||||
|
<property name="A11yManagerWithoutAccessControl" type="b" access="readwrite" />
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
</node>
|
</node>
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "backends/meta-a11y-manager.h"
|
#include "backends/meta-a11y-manager.h"
|
||||||
#include "backends/meta-dbus-access-checker.h"
|
#include "backends/meta-dbus-access-checker.h"
|
||||||
|
#include "core/meta-debug-control-private.h"
|
||||||
#include "meta/meta-backend.h"
|
#include "meta/meta-backend.h"
|
||||||
#include "meta/meta-context.h"
|
#include "meta/meta-context.h"
|
||||||
#include "meta/util.h"
|
#include "meta/util.h"
|
||||||
@ -191,8 +192,15 @@ check_access (GDBusInterfaceSkeleton *skeleton,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MetaA11yManager *a11y_manager = META_A11Y_MANAGER (user_data);
|
MetaA11yManager *a11y_manager = META_A11Y_MANAGER (user_data);
|
||||||
|
MetaContext *context =
|
||||||
|
meta_backend_get_context (a11y_manager->backend);
|
||||||
const char *sender =
|
const char *sender =
|
||||||
g_dbus_method_invocation_get_sender (invocation);
|
g_dbus_method_invocation_get_sender (invocation);
|
||||||
|
MetaDebugControl *debug_control =
|
||||||
|
meta_context_get_debug_control (context);
|
||||||
|
|
||||||
|
if (meta_debug_control_is_a11y_manager_without_access_control (debug_control))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
if (!meta_dbus_access_checker_is_sender_allowed (a11y_manager->access_checker,
|
if (!meta_dbus_access_checker_is_sender_allowed (a11y_manager->access_checker,
|
||||||
sender))
|
sender))
|
||||||
|
@ -33,3 +33,5 @@ gboolean meta_debug_control_is_session_management_protocol_enabled (MetaDebugCon
|
|||||||
gboolean meta_debug_control_is_hw_cursor_inhibited (MetaDebugControl *debug_control);
|
gboolean meta_debug_control_is_hw_cursor_inhibited (MetaDebugControl *debug_control);
|
||||||
|
|
||||||
gboolean meta_debug_control_is_cursor_shape_protocol_enabled (MetaDebugControl *debug_control);
|
gboolean meta_debug_control_is_cursor_shape_protocol_enabled (MetaDebugControl *debug_control);
|
||||||
|
|
||||||
|
gboolean meta_debug_control_is_a11y_manager_without_access_control (MetaDebugControl *debug_control);
|
||||||
|
@ -173,6 +173,7 @@ meta_debug_control_init (MetaDebugControl *debug_control)
|
|||||||
gboolean session_management_protocol;
|
gboolean session_management_protocol;
|
||||||
gboolean cursor_shape_protocol;
|
gboolean cursor_shape_protocol;
|
||||||
gboolean inhibit_hw_cursor;
|
gboolean inhibit_hw_cursor;
|
||||||
|
gboolean a11y_manager_without_access_control;
|
||||||
|
|
||||||
color_management_protocol =
|
color_management_protocol =
|
||||||
g_strcmp0 (getenv ("MUTTER_DEBUG_COLOR_MANAGEMENT_PROTOCOL"), "1") == 0;
|
g_strcmp0 (getenv ("MUTTER_DEBUG_COLOR_MANAGEMENT_PROTOCOL"), "1") == 0;
|
||||||
@ -203,6 +204,11 @@ meta_debug_control_init (MetaDebugControl *debug_control)
|
|||||||
g_strcmp0 (getenv ("MUTTER_DEBUG_CURSOR_SHAPE_PROTOCOL"), "1") == 0;
|
g_strcmp0 (getenv ("MUTTER_DEBUG_CURSOR_SHAPE_PROTOCOL"), "1") == 0;
|
||||||
meta_dbus_debug_control_set_cursor_shape_protocol (dbus_debug_control,
|
meta_dbus_debug_control_set_cursor_shape_protocol (dbus_debug_control,
|
||||||
cursor_shape_protocol);
|
cursor_shape_protocol);
|
||||||
|
|
||||||
|
a11y_manager_without_access_control =
|
||||||
|
g_strcmp0 (getenv ("MUTTER_DEBUG_A11Y_MANAGER_WITHOUT_ACCESS_CONTROL"), "1") == 0;
|
||||||
|
meta_dbus_debug_control_set_a11y_manager_without_access_control (dbus_debug_control,
|
||||||
|
a11y_manager_without_access_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -295,3 +301,12 @@ meta_debug_control_is_cursor_shape_protocol_enabled (MetaDebugControl *debug_con
|
|||||||
|
|
||||||
return meta_dbus_debug_control_get_cursor_shape_protocol (dbus_debug_control);
|
return meta_dbus_debug_control_get_cursor_shape_protocol (dbus_debug_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_debug_control_is_a11y_manager_without_access_control (MetaDebugControl *debug_control)
|
||||||
|
{
|
||||||
|
MetaDBusDebugControl *dbus_debug_control =
|
||||||
|
META_DBUS_DEBUG_CONTROL (debug_control);
|
||||||
|
|
||||||
|
return meta_dbus_debug_control_get_a11y_manager_without_access_control (dbus_debug_control);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user