Add an XEmbed compatibility option

This commit is contained in:
Robbert van der Helm
2020-12-25 18:11:55 +01:00
parent 7da5ec113c
commit 49eeee99fa
5 changed files with 29 additions and 2 deletions
+6
View File
@@ -90,6 +90,12 @@ Configuration::Configuration(const fs::path& config_path,
} else {
invalid_options.push_back(key);
}
} else if (key == "editor_xembed") {
if (const auto parsed_value = value.as_boolean()) {
editor_xembed = parsed_value->get();
} else {
invalid_options.push_back(key);
}
} else if (key == "group") {
if (const auto parsed_value = value.as_string()) {
group = parsed_value->get();
+9
View File
@@ -101,6 +101,14 @@ class Configuration {
*/
bool editor_double_embed = false;
/**
* Use XEmbed instead of yabridge's normal editor embedding method. Wine's
* XEmbed support is not very polished yet and tends to lead to rendering
* issues, so this is disabled by default. Also, editor resizing won't work
* reliably when XEmbed is enabled.
*/
bool editor_xembed = false;
/**
* The name of the plugin group that should be used for the plugin this
* configuration object was created for. If not set, then the plugin should
@@ -135,6 +143,7 @@ class Configuration {
void serialize(S& s) {
s.value1b(cache_time_info);
s.value1b(editor_double_embed);
s.value1b(editor_xembed);
s.ext(group, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.text1b(v, 4096); });
s.ext(matched_file, bitsery::ext::StdOptional(),
+3
View File
@@ -160,6 +160,9 @@ class PluginBridge {
if (config.editor_double_embed) {
other_options.push_back("editor: double embed");
}
if (config.editor_xembed) {
other_options.push_back("editor: XEmbed");
}
if (!other_options.empty()) {
init_msg << join_quoted_strings(other_options) << std::endl;
} else {