瀏覽代碼

linux-capture: Add xcb connection to source data

Add a xcb connection to the source data for the xshm capture for later
use in the porting process.
fryshorts 10 年之前
父節點
當前提交
53ee22ae5a
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      plugins/linux-capture/xshm-input.c

+ 9 - 0
plugins/linux-capture/xshm-input.c

@@ -40,6 +40,9 @@ struct xshm_data {
 	Display *dpy;
 	/** Xlib screen object */
 	Screen *screen;
+
+	xcb_connection_t *xcb;
+
 	/** user setting - the server name to capture from */
 	char *server;
 	/** user setting - the id of the screen that should be captured */
@@ -195,6 +198,9 @@ static void xshm_capture_start(struct xshm_data *data)
 		goto fail;
 	}
 
+	XSetEventQueueOwner(data->dpy, XCBOwnsEventQueue);
+	data->xcb = XGetXCBConnection(data->dpy);
+
 	if (!XShmQueryExtension(data->dpy)) {
 		blog(LOG_ERROR, "XShm extension not found !");
 		goto fail;
@@ -296,6 +302,9 @@ static bool xshm_server_changed(obs_properties_t *props,
 		return true;
 	}
 
+	XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
+	xcb_connection_t *xcb = XGetXCBConnection(dpy);
+
 	struct dstr screen_info;
 	dstr_init(&screen_info);
 	bool xinerama = xinerama_is_active(dpy);