[at-spi2-core: 2/32] spi_display_name() - make conditional on HAVE_X11
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core: 2/32] spi_display_name() - make conditional on HAVE_X11
- Date: Tue, 14 Dec 2021 22:30:56 +0000 (UTC)
commit 1f455b5ba753a1cda27cc39f51308ec056f778e6
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 24 15:57:58 2021 -0600
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.
atspi/atspi-misc.c | 74 +++++++++++++++++++++++++++---------------------------
1 file 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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]