diff --git a/libobs-opengl/gl-x11.c b/libobs-opengl/gl-x11.c index 046676acd..78db45a9e 100644 --- a/libobs-opengl/gl-x11.c +++ b/libobs-opengl/gl-x11.c @@ -26,8 +26,6 @@ static const GLenum ctx_attribs[] = { None, }; -#define ERROR_TEXT_LEN 1024 - struct gl_windowinfo { uint32_t id; Display *display; @@ -38,16 +36,6 @@ struct gl_platform { struct gs_swap_chain swap; }; -static int GLXErrorHandler(Display *disp, XErrorEvent *error) -{ - char error_buf[ERROR_TEXT_LEN]; - - XGetErrorText(disp, error->error_code, error_buf, ERROR_TEXT_LEN); - blog(LOG_ERROR, "GLX error: %s\n", error_buf); - - return 0; -} - extern struct gs_swap_chain *gl_platform_getswap(struct gl_platform *platform) { return &platform->swap; @@ -59,6 +47,7 @@ extern struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info) memset(wi, 0, sizeof(struct gl_windowinfo)); wi->id = info->window.id; + /* wi->display = info->window.display; */ return wi; } @@ -118,8 +107,6 @@ struct gl_platform *gl_platform_create(device_t device, goto fail0; } - XSetErrorHandler(GLXErrorHandler); - /* We require glX version 1.4 */ { int major = 0, minor = 0; diff --git a/libobs/graphics/graphics.h b/libobs/graphics/graphics.h index 7f891f171..503fa47a2 100644 --- a/libobs/graphics/graphics.h +++ b/libobs/graphics/graphics.h @@ -415,7 +415,9 @@ struct gs_window { #elif defined(__APPLE__) __unsafe_unretained id view; #elif defined(__linux__) + /* I'm not sure how portable defining id to uint32_t is. */ uint32_t id; + void* display; #endif }; diff --git a/obs/wx-wrappers.cpp b/obs/wx-wrappers.cpp index bf2423fc3..94c1f9c66 100644 --- a/obs/wx-wrappers.cpp +++ b/obs/wx-wrappers.cpp @@ -39,16 +39,15 @@ gs_window WxToGSWindow(wxWindow *wxwin) window.hwnd = wxwin->GetHandle(); #else GtkWidget* hndl = wxwin->GetHandle(); - gtk_widget_realize(hndl); - GdkWindow* gdkwin = gtk_widget_get_window(hndl); - if (gdkwin) - window.id = GDK_DRAWABLE_XID(gdkwin); - else { - window.id = 0; - blog(LOG_ERROR, "Window is not realized...?"); - } + /* I don't really understand why wxWidgets doesn't do this during Show() */ + gtk_widget_realize(hndl); + + GdkWindow* gdkwin = gtk_widget_get_window(hndl); + window.id = GDK_DRAWABLE_XID(gdkwin); + window.display = GDK_DRAWABLE_XDISPLAY(gdkwin); #endif + return window; }