UI: Remove x11info dependency
This moves X11 platform to the qt private functions, as x11info was removed from Qt6 so this is required for a clean Qt5/6 transition. This is the implementation of x11info::getdisplay so it should still work on older platforms. This "API" doesnt really guarantee anything though. Also clean up wayland only bits as we use them for all windowing systems now, and the name of the native pointer we want is the same on both platforms for now.
This commit is contained in:
parent
db7daa6eaf
commit
346e268a3d
@ -123,13 +123,17 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
elseif(UNIX)
|
||||
find_package(Qt5X11Extras REQUIRED)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
|
||||
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
|
||||
set(obs_PLATFORM_SOURCES
|
||||
platform-x11.cpp)
|
||||
|
||||
set(obs_PLATFORM_LIBRARIES
|
||||
Qt5::X11Extras)
|
||||
set(obs_PLATFORM_LIBRARIES
|
||||
${obs_PLATFORM_LIBRARIES}
|
||||
Qt5::Gui
|
||||
Qt5::GuiPrivate)
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
|
||||
list(APPEND obs_PLATFORM_LIBRARIES
|
||||
@ -396,16 +400,6 @@ if(WIN32)
|
||||
OUTPUT_NAME "obs${_output_suffix}")
|
||||
endif()
|
||||
|
||||
if (ENABLE_WAYLAND)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
|
||||
set(obs_PLATFORM_LIBRARIES
|
||||
${obs_PLATFORM_LIBRARIES}
|
||||
Qt5::Gui
|
||||
Qt5::GuiPrivate)
|
||||
endif()
|
||||
|
||||
target_link_libraries(obs
|
||||
libobs
|
||||
Qt5::Widgets
|
||||
|
@ -61,14 +61,9 @@
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
#include <obs-nix-platform.h>
|
||||
#include <QX11Info>
|
||||
|
||||
#ifdef ENABLE_WAYLAND
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "ui-config.h"
|
||||
@ -1398,27 +1393,23 @@ bool OBSApp::OBSInit()
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
obs_set_nix_platform(OBS_NIX_PLATFORM_X11_GLX);
|
||||
if (QApplication::platformName() == "xcb") {
|
||||
if (getenv("OBS_USE_EGL")) {
|
||||
blog(LOG_INFO, "Using EGL/X11");
|
||||
obs_set_nix_platform(OBS_NIX_PLATFORM_X11_EGL);
|
||||
}
|
||||
obs_set_nix_platform_display(QX11Info::display());
|
||||
if (QApplication::platformName() == "xcb" && getenv("OBS_USE_EGL")) {
|
||||
obs_set_nix_platform(OBS_NIX_PLATFORM_X11_EGL);
|
||||
blog(LOG_INFO, "Using EGL/X11");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND
|
||||
if (QApplication::platformName().contains("wayland")) {
|
||||
obs_set_nix_platform(OBS_NIX_PLATFORM_WAYLAND);
|
||||
QPlatformNativeInterface *native =
|
||||
QGuiApplication::platformNativeInterface();
|
||||
obs_set_nix_platform_display(
|
||||
native->nativeResourceForIntegration("display"));
|
||||
|
||||
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||
|
||||
blog(LOG_INFO, "Platform: Wayland");
|
||||
}
|
||||
#endif
|
||||
|
||||
QPlatformNativeInterface *native =
|
||||
QGuiApplication::platformNativeInterface();
|
||||
obs_set_nix_platform_display(
|
||||
native->nativeResourceForIntegration("display"));
|
||||
#endif
|
||||
|
||||
if (!StartupOBS(locale.c_str(), GetProfilerNameStore()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user