]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/xcb_apps.c
Revert "Add an automate variable to detect Android builb and use it to forbid build of"
[vlc] / modules / services_discovery / xcb_apps.c
index 01c9e688346e2acdba0b476bc87ce05434501051..682e9fc7f1bd0f696b7afbd083f3fb9ec5c28da8 100644 (file)
@@ -32,8 +32,10 @@ typedef xcb_atom_t Atom;
 #include <vlc_dialog.h>
 #include <vlc_charset.h>
 #include <vlc_plugin.h>
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#endif
 #include <poll.h>
-#include <search.h>
 
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
@@ -74,14 +76,14 @@ static int vlc_sd_probe_Open (vlc_object_t *obj)
 {
     vlc_probe_t *probe = (vlc_probe_t *)obj;
 
-    char *display = var_CreateGetNonEmptyString (obj, "x11-display");
+    char *display = var_InheritString (obj, "x11-display");
     xcb_connection_t *conn = xcb_connect (display, NULL);
     free (display);
     if (xcb_connection_has_error (conn))
         return VLC_PROBE_CONTINUE;
     xcb_disconnect (conn);
     return vlc_sd_probe_Add (probe, "xcb_apps{longname=\"Screen capture\"}",
-                             N_("Screen capture"), SD_CAT_MYCOMPUTER);
+                             N_("Screen capture"), SD_CAT_DEVICES);
 }
 
 /**
@@ -97,7 +99,7 @@ static int Open (vlc_object_t *obj)
     sd->p_sys = p_sys;
 
     /* Connect to X server */
-    char *display = var_CreateGetNonEmptyString (obj, "x11-display");
+    char *display = var_InheritString (obj, "x11-display");
     int snum;
     xcb_connection_t *conn = xcb_connect (display, &snum);
     free (display);
@@ -146,13 +148,11 @@ static int Open (vlc_object_t *obj)
     r = xcb_intern_atom_reply (conn, ncl, NULL);
     if (r == NULL || r->atom == 0)
     {
-        dialog_Fatal (sd, _("Application list failure"),
-                  _("Your window manager does not support application list."));
-        msg_Err (sd, "application list not support (_NET_CLIENT_LIST absent)");
-        free (r);
-        goto error;
+        dialog_Fatal (sd, _("Screen capture"),
+            _("Your window manager does not provide a list of applications."));
+        msg_Err (sd, "client list not supported (_NET_CLIENT_LIST absent)");
     }
-    p_sys->net_client_list = r->atom;
+    p_sys->net_client_list = r ? r->atom : 0;
     free (r);
     r = xcb_intern_atom_reply (conn, nwn, NULL);
     if (r != NULL)