From 35c71383337e71653caf482b357db0f2433f6547 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 27 Dec 2020 14:24:50 +0100 Subject: [PATCH] Add a background brush to the window So the background always gets cleared out when the window resizes. --- CHANGELOG.md | 5 +++++ meson.build | 3 +++ src/wine-host/editor.cpp | 1 + 3 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 613f38d3..5c910094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,11 @@ TODO: Add an updates screenshot with some fancy VST3-only plugins to the readme and 5.8 required a change, but that change now breaks builds using Wine 6.0 and up, so this change has been reverted. +### Fixed + +- Added a background to the editor window to get rid of artifacts that could + occur when the plugin or the host don't resize the window correctly. + ### yabridgectl - Updated for the changes in yabridge 3.0. Yabridgectl now allows you to set up diff --git a/meson.build b/meson.build index cb033ff4..3165a5e4 100644 --- a/meson.build +++ b/meson.build @@ -188,6 +188,7 @@ bitsery_dep = subproject('bitsery', version : '5.2.0').get_variable('bitsery_dep function2_dep = subproject('function2', version : '4.1.0').get_variable('function2_dep') threads_dep = dependency('threads') tomlplusplus_dep = subproject('tomlplusplus', version : '2.1.0').get_variable('tomlplusplus_dep') +wine_gdi32_dep = declare_dependency(link_args : '-lgdi32') # The built in threads dependency does not know how to handle winegcc wine_threads_dep = declare_dependency(link_args : '-lpthread') xcb_dep = dependency('xcb') @@ -377,6 +378,7 @@ host_64bit_deps = [ bitsery_dep, function2_dep, tomlplusplus_dep, + wine_gdi32_dep, wine_threads_dep, xcb_dep, ] @@ -423,6 +425,7 @@ if with_bitbridge bitsery_dep, function2_dep, tomlplusplus_dep, + wine_gdi32_dep, wine_threads_dep, xcb_32bit_dep, ] diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index 5de2f913..ceb441f5 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -666,6 +666,7 @@ ATOM register_window_class(std::string window_class_name) { window_class.lpfnWndProc = window_proc; window_class.hInstance = GetModuleHandle(nullptr); window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.hbrBackground = CreateSolidBrush(RGB(32, 32, 32)); window_class.lpszClassName = window_class_name.c_str(); return RegisterClassEx(&window_class);