Skip to content

Commit

Permalink
Merge pull request #53 from BtbN/fixes
Browse files Browse the repository at this point in the history
Fix gswindow display with Qt
  • Loading branch information
jp9000 committed Apr 3, 2014
2 parents c25f105 + a31e938 commit 7b0feec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
7 changes: 1 addition & 6 deletions libobs-opengl/gl-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ extern struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info)
{
struct gl_windowinfo *wi = bzalloc(sizeof(struct gl_windowinfo));
wi->id = info->window.id;
/* wi->display = info->window.display; */

/*
The above no longer works with Qt.
Let's hope it continues to work.
*/
wi->display = info->window.display;

return wi;
}
Expand Down
2 changes: 1 addition & 1 deletion libobs/util/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void def_log_handler(int log_level, const char *format,
char out[4096];
vsnprintf(out, sizeof(out), format, args);

if (log_level >= log_output_level) {
if (log_level <= log_output_level) {
switch (log_level) {
case LOG_DEBUG:
printf("debug: %s\n", out);
Expand Down
7 changes: 6 additions & 1 deletion obs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ elseif(APPLE)

add_definitions(-fobjc-arc)
elseif(UNIX)
find_package(Qt5X11Extras REQUIRED)

set(obs_PLATFORM_SOURCES
platform-x11.cpp)

Expand All @@ -44,6 +46,9 @@ elseif(UNIX)
set(obs_PLATFORM_LIBRARIES
${X11_LIBRARIES}
${X11_Xinerama_LIB})

set(obs_PLATFORM_QT_MODULES
X11Extras)
endif()

set(obs_SOURCES
Expand Down Expand Up @@ -87,7 +92,7 @@ add_executable(obs WIN32
${obs_UI_HEADERS}
${obs_QRC_SOURCES})

qt5_use_modules(obs Widgets)
qt5_use_modules(obs Widgets ${obs_PLATFORM_QT_MODULES})

if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down
5 changes: 5 additions & 0 deletions obs/qt-wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <QWidget>
#include <QMessageBox>

#if !defined(_WIN32) && !defined(__APPLE__)
#include <QX11Info>
#endif

static inline void OBSErrorBoxva(QWidget *parent, const char *msg, va_list args)
{
char full_message[4096];
Expand All @@ -44,5 +48,6 @@ void QTToGSWindow(WId windowId, gs_window &gswindow)
gswindow.view = (id)windowId;
#else
gswindow.id = windowId;
gswindow.display = QX11Info::display();
#endif
}

0 comments on commit 7b0feec

Please sign in to comment.