Skip to content

Commit

Permalink
Reverted previous changes and added a hopeful solution for lack of wi…
Browse files Browse the repository at this point in the history
…ndow realization
  • Loading branch information
computerquip committed Jan 8, 2014
1 parent d3dab07 commit d7fd0b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions obs/wx-wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <wx/msgdlg.h>
#include <obs.h>
#include "wx-wrappers.hpp"
#include <wx/utils.h>

#ifdef __linux__
#include <gdk/gdkx.h>
Expand All @@ -28,16 +29,25 @@
#include <memory>
using namespace std;

gs_window WxToGSWindow(const wxWindow *wxwin)
gs_window WxToGSWindow(wxWindow *wxwin)
{
gs_window window;

#ifdef __APPLE__
window.view = (id)wxwin->GetHandle();
#elif _WIN32
window.hwnd = wxwin->GetHandle();
#else
window.id = gdk_x11_drawable_get_xid(gtk_widget_get_window(
wxwin->GetHandle()));
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...?");
}
#endif
return window;
}
Expand Down
2 changes: 1 addition & 1 deletion obs/wx-wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

struct gs_window;

gs_window WxToGSWindow(const wxWindow *window);
gs_window WxToGSWindow(wxWindow *window);
void OBSErrorBox(wxWindow *parent, const char *message, ...);

/* returns actual ID of menu item clicked rather than be forced to use
Expand Down

0 comments on commit d7fd0b4

Please sign in to comment.