提交 aeed4a3a 编写于 作者: K Kurt Kartaltepe

UI: Support DnD overlay in linuxbrowser

Add support for checking multiple source types in Drag n Drop callback
to support overlays for linuxbrowser users. Once the "browsersource" is
available on the platform it will have priority.
上级 1b3525e6
...@@ -91,6 +91,7 @@ void OBSBasic::AddDropSource(const char *data, DropType image) ...@@ -91,6 +91,7 @@ void OBSBasic::AddDropSource(const char *data, DropType image)
obs_data_t *settings = obs_data_create(); obs_data_t *settings = obs_data_create();
obs_source_t *source = nullptr; obs_source_t *source = nullptr;
const char *type = nullptr; const char *type = nullptr;
std::vector<const char *> types;
QString name; QString name;
obs_video_info ovi; obs_video_info ovi;
...@@ -133,15 +134,21 @@ void OBSBasic::AddDropSource(const char *data, DropType image) ...@@ -133,15 +134,21 @@ void OBSBasic::AddDropSource(const char *data, DropType image)
obs_data_set_int(settings, "width", ovi.base_width); obs_data_set_int(settings, "width", ovi.base_width);
obs_data_set_int(settings, "height", ovi.base_height); obs_data_set_int(settings, "height", ovi.base_height);
name = QUrl::fromLocalFile(QString(data)).fileName(); name = QUrl::fromLocalFile(QString(data)).fileName();
type = "browser_source"; types = {"browser_source", "linuxbrowser-source"};
break; break;
case DropType_Url: case DropType_Url:
AddDropURL(data, name, settings, ovi); AddDropURL(data, name, settings, ovi);
type = "browser_source"; types = {"browser_source", "linuxbrowser-source"};
break; break;
} }
if (!obs_source_get_display_name(type)) { for (char const *t : types) {
if (obs_source_get_display_name(t)) {
type = t;
break;
}
}
if (type == nullptr || !obs_source_get_display_name(type)) {
obs_data_release(settings); obs_data_release(settings);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册