Fix OSX build (#952)

This commit is contained in:
Murat Seker
2020-09-14 20:37:48 +02:00
committed by GitHub
parent 9b729f8913
commit 5e922be4d3
3 changed files with 20 additions and 7 deletions

View File

@@ -4,7 +4,10 @@ SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb)
find_package(XCB COMPONENTS SHM IMAGE RENDER RANDR REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5X11Extras REQUIRED)
if (NOT APPLE)
find_package(Qt5X11Extras REQUIRED)
endif()
include_directories(${XCB_INCLUDE_DIRS})
@@ -19,3 +22,6 @@ target_link_libraries(xcb-grabber
${XCB_LIBRARIES}
)
if (NOT APPLE)
target_link_libraries(xcb-grabber Qt5::X11Extras)
endif()

View File

@@ -7,7 +7,10 @@
#include <xcb/xcb_event.h>
#include <QCoreApplication>
#ifndef __APPLE__
#include <QX11Info>
#endif
#include <memory>
@@ -427,7 +430,11 @@ xcb_render_pictformat_t XcbGrabber::findFormatForVisual(xcb_visualid_t visual) c
if (formats == nullptr)
return {};
#ifdef __APPLE__
int screen = 0;
#else
int screen = QX11Info::appScreen();
#endif
xcb_render_pictscreen_iterator_t sit =
xcb_render_query_pict_formats_screens_iterator(formats.get());