]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/xcb_apps.c
x264: use libx264 with 0-started pts values and scale them back
[vlc] / modules / services_discovery / xcb_apps.c
index ba9d4ad2cf16835f8935b4e67173871ee1b4e2e3..6e35f93b09b052c539c54391c7ff3c2fc84114cb 100644 (file)
@@ -68,6 +68,7 @@ struct services_discovery_sys_t
 static void *Run (void *);
 static void Update (services_discovery_t *);
 static void DelItem (void *);
+static void AddDesktopItem(services_discovery_t *);
 
 static int vlc_sd_probe_Open (vlc_object_t *obj)
 {
@@ -79,7 +80,8 @@ static int vlc_sd_probe_Open (vlc_object_t *obj)
     if (xcb_connection_has_error (conn))
         return VLC_PROBE_CONTINUE;
     xcb_disconnect (conn);
-    return vlc_sd_probe_Add (probe, "xcb_apps", N_("Screen capture"));
+    return vlc_sd_probe_Add (probe, "xcb_apps{longname=\"Screen capture\"}",
+                             N_("Screen capture"), SD_CAT_MYCOMPUTER);
 }
 
 /**
@@ -125,6 +127,9 @@ static int Open (vlc_object_t *obj)
         goto error;
     }
 
+    /* Add a permanent item for the entire desktop */
+    AddDesktopItem (sd);
+
     p_sys->root_window = scr->root;
     xcb_change_window_attributes (conn, scr->root, XCB_CW_EVENT_MASK,
                                &(uint32_t) { XCB_EVENT_MASK_PROPERTY_CHANGE });
@@ -141,13 +146,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)
@@ -337,3 +340,15 @@ static void Update (services_discovery_t *sd)
     tdestroy (oldnodes, DelItem);
     p_sys->nodes = newnodes;
 }
+
+static void AddDesktopItem(services_discovery_t *sd)
+{
+    input_item_t *item;
+
+    item = input_item_NewWithType (VLC_OBJECT (sd), "screen://", _("Desktop"),
+                                   0, NULL, 0, -1, ITEM_TYPE_CARD);
+    if (item == NULL)
+        return;
+
+    services_discovery_AddItem (sd, item, NULL);
+}