obs-StreamFX/source/ui/ui-obs-browser-widget.hpp
Michael Fabian 'Xaymar' Dirks d073889126 ui/obs-browser-widget: Prevent unwanted crashes or corruptions on Wayland
The obs-browser module does not work well on Wayland, so removing it there appears to be the best option for now.
2023-04-05 19:08:29 +02:00

52 lines
1 KiB
C++

// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include "util/util-library.hpp"
#include "warning-disable.hpp"
#include <QHBoxLayout>
#include <QSharedPointer>
#include <QUrl>
#include <QWidget>
#include "warning-enable.hpp"
namespace streamfx::ui {
class obs_browser_cef {
std::shared_ptr<::streamfx::util::library> _module;
void* _cef;
void* _cookie;
private:
obs_browser_cef();
public:
~obs_browser_cef();
void* cef();
void* cookie_manager();
public: // Singleton
static std::shared_ptr<obs_browser_cef> instance();
};
class obs_browser_widget : public QWidget {
Q_OBJECT
std::shared_ptr<obs_browser_cef> _cef;
QWidget* _widget;
QHBoxLayout* _layout;
public:
obs_browser_widget(QUrl url, QWidget* parent = nullptr);
virtual ~obs_browser_widget();
void set_url(QUrl url);
public:
static bool is_available();
};
} // namespace streamfx::ui