Reverted previous changes and added a hopeful solution for lack of window realization
parent
13fc0b536c
commit
350c34881a
|
@ -19,6 +19,7 @@
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
#include <obs.h>
|
#include <obs.h>
|
||||||
#include "wx-wrappers.hpp"
|
#include "wx-wrappers.hpp"
|
||||||
|
#include <wx/utils.h>
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
@ -28,16 +29,25 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
gs_window WxToGSWindow(const wxWindow *wxwin)
|
gs_window WxToGSWindow(wxWindow *wxwin)
|
||||||
{
|
{
|
||||||
gs_window window;
|
gs_window window;
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
window.view = (id)wxwin->GetHandle();
|
window.view = (id)wxwin->GetHandle();
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
window.hwnd = wxwin->GetHandle();
|
window.hwnd = wxwin->GetHandle();
|
||||||
#else
|
#else
|
||||||
window.id = gdk_x11_drawable_get_xid(gtk_widget_get_window(
|
GtkWidget* hndl = wxwin->GetHandle();
|
||||||
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...?");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
struct gs_window;
|
struct gs_window;
|
||||||
|
|
||||||
gs_window WxToGSWindow(const wxWindow *window);
|
gs_window WxToGSWindow(wxWindow *window);
|
||||||
void OBSErrorBox(wxWindow *parent, const char *message, ...);
|
void OBSErrorBox(wxWindow *parent, const char *message, ...);
|
||||||
|
|
||||||
/* returns actual ID of menu item clicked rather than be forced to use
|
/* returns actual ID of menu item clicked rather than be forced to use
|
||||||
|
|
Loading…
Reference in New Issue