summaryrefslogtreecommitdiff
path: root/atspi
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2021-11-24 15:57:58 -0600
committerFederico Mena Quintero <federico@gnome.org>2021-12-13 16:36:39 -0600
commit1f455b5ba753a1cda27cc39f51308ec056f778e6 (patch)
tree99f732cd6d61f7cab9391844dae1b4278ffd3a85 /atspi
parent8a98d0963fdf9f485e9119771e3301cba9dd8a54 (diff)
downloadat-spi2-core-1f455b5ba753a1cda27cc39f51308ec056f778e6.tar.gz
spi_display_name() - make conditional on HAVE_X11
This function is only called by get_accessibility_bus_address_x11(), which is already conditional on HAVE_X11.
Diffstat (limited to 'atspi')
-rw-r--r--atspi/atspi-misc.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 7af46e9f..d896afbd 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -877,43 +877,6 @@ atspi_dbus_filter (DBusConnection *bus, DBusMessage *message, void *data)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-/*
- * Returns a 'canonicalized' value for DISPLAY,
- * with the screen number stripped off if present.
- *
- * TODO: Avoid having duplicate functions for this here and in at-spi2-atk
- */
-static gchar *
-spi_display_name (void)
-{
- char *canonical_display_name = NULL;
- const gchar *display_env = g_getenv ("AT_SPI_DISPLAY");
-
- if (!display_env)
- {
- display_env = g_getenv ("DISPLAY");
- if (!display_env || !display_env[0])
- return NULL;
- else
- {
- gchar *display_p, *screen_p;
- canonical_display_name = g_strdup (display_env);
- display_p = g_utf8_strrchr (canonical_display_name, -1, ':');
- screen_p = g_utf8_strrchr (canonical_display_name, -1, '.');
- if (screen_p && display_p && (screen_p > display_p))
- {
- *screen_p = '\0';
- }
- }
- }
- else
- {
- canonical_display_name = g_strdup (display_env);
- }
-
- return canonical_display_name;
-}
-
/**
* atspi_init:
*
@@ -1499,6 +1462,43 @@ _atspi_error_quark (void)
* Gets the IOR from the XDisplay.
*/
#ifdef HAVE_X11
+/*
+ * Returns a 'canonicalized' value for DISPLAY,
+ * with the screen number stripped off if present.
+ *
+ * TODO: Avoid having duplicate functions for this here and in at-spi2-atk
+ */
+static gchar *
+spi_display_name (void)
+{
+ char *canonical_display_name = NULL;
+ const gchar *display_env = g_getenv ("AT_SPI_DISPLAY");
+
+ if (!display_env)
+ {
+ display_env = g_getenv ("DISPLAY");
+ if (!display_env || !display_env[0])
+ return NULL;
+ else
+ {
+ gchar *display_p, *screen_p;
+ canonical_display_name = g_strdup (display_env);
+ display_p = g_utf8_strrchr (canonical_display_name, -1, ':');
+ screen_p = g_utf8_strrchr (canonical_display_name, -1, '.');
+ if (screen_p && display_p && (screen_p > display_p))
+ {
+ *screen_p = '\0';
+ }
+ }
+ }
+ else
+ {
+ canonical_display_name = g_strdup (display_env);
+ }
+
+ return canonical_display_name;
+}
+
static char *
get_accessibility_bus_address_x11 (void)
{