Add the special win32-dpi-aware feature on Windows
This commit is contained in:
parent
9267a8371c
commit
79ab0cd7ed
2 changed files with 12 additions and 4 deletions
|
@ -137,9 +137,8 @@ pub trait ClapPlugin: Plugin {
|
|||
const CLAP_DESCRIPTION: &'static str;
|
||||
/// Arbitrary keywords describing the plugin. See the CLAP specification for examples:
|
||||
/// <https://github.com/free-audio/clap/blob/main/include/clap/plugin.h>.
|
||||
//
|
||||
// TODO: CLAP mentions that `win32-dpi-aware` is a special keyword that informs the host that
|
||||
// the plugin is DPI aware, can and should we have special handling for this?
|
||||
///
|
||||
/// On windows `win32-dpi-aware` is automatically added.
|
||||
const CLAP_FEATURES: &'static [&'static str];
|
||||
/// A URL to the plugin's manual, CLAP does not specify what to do when there is none.
|
||||
//
|
||||
|
|
|
@ -60,7 +60,16 @@ impl<P: ClapPlugin> Default for PluginDescriptor<P> {
|
|||
_phantom: PhantomData,
|
||||
};
|
||||
|
||||
// The keyword list is an environ-like list of char pointers terminated by a null pointer
|
||||
// The keyword list is an environ-like list of char pointers terminated by a null pointer.
|
||||
// On Windows `win32-dpi-aware` is a special value informing the host that the plugin is
|
||||
// DPI-aware.
|
||||
// TODO: Is this actually what we want? What happens if we don't add it? If this means that
|
||||
// we need to do our own DPI handling instead of the host passing a scale then we
|
||||
// don't want that of course.
|
||||
#[cfg(target_os = "windows")]
|
||||
descriptor
|
||||
.clap_features
|
||||
.push(CString::new("win32-dpi-aware").unwrap());
|
||||
let mut clap_features_ptrs: Vec<*const c_char> = descriptor
|
||||
.clap_features
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Reference in a new issue