mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Only reset coordinates when resizing
This was the original idea. I though that to be extra safe, maybe we can do this all the time. And while that does work fine, most of the time, it does cause a lot of other fun issues especially when plugins fully redraw themselves that way.
This commit is contained in:
+12
-17
@@ -440,6 +440,18 @@ void Editor::resize(uint16_t width, uint16_t height) {
|
||||
value_mask, values.data());
|
||||
xcb_flush(x11_connection.get());
|
||||
|
||||
// Before lying to Wine about the window's coordinates, we do need to make
|
||||
// sure that the window is actually placed at (0, 0) coordinates. Otherwise
|
||||
// some plugins that rely on screen coordinates, like the Soundtoys plugins
|
||||
// and older PSPaudioware plugins, will draw their GUI at the wrong
|
||||
// location.
|
||||
logger.log_editor_trace([]() {
|
||||
return "DEBUG: Resetting Wine window position back to (0, 0)";
|
||||
});
|
||||
SetWindowPos(win32_window.handle, nullptr, 0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOCOPYBITS |
|
||||
SWP_NOOWNERZORDER | SWP_DEFERERASE);
|
||||
|
||||
// Make sure that after the resize the screen coordinates always match up
|
||||
// properly. Without this Soundtoys Crystallizer might appear choppy or skip
|
||||
// a frame during their resize animation (which somehow calls
|
||||
@@ -715,23 +727,6 @@ void Editor::fix_local_coordinates() const {
|
||||
return;
|
||||
}
|
||||
|
||||
// Before lying to Wine about the window's coordinates, we do need to make
|
||||
// sure that the window is actually placed at (0, 0) coordinates. Otherwise
|
||||
// some plugins that rely on screen coordinates, like the Soundtoys plugins
|
||||
// and older PSPaudioware plugins, will draw their GUI at the wrong
|
||||
// location. In case we have multiple `ConfiguratioNotify` events in a row,
|
||||
// we'll only need to do this once.
|
||||
RECT current_pos{};
|
||||
if (GetWindowRect(win32_window.handle, ¤t_pos) ||
|
||||
current_pos.left != 0 || current_pos.top != 0) {
|
||||
logger.log_editor_trace([]() {
|
||||
return "DEBUG: Resetting Wine window position back to (0, 0)";
|
||||
});
|
||||
SetWindowPos(win32_window.handle, nullptr, 0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOREDRAW | SWP_NOACTIVATE |
|
||||
SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_DEFERERASE);
|
||||
}
|
||||
|
||||
// We're purposely not using XEmbed here. This has the consequence that wine
|
||||
// still thinks that any X and Y coordinates are relative to the x11 window
|
||||
// root instead of the parent window provided by the DAW, causing all sorts
|
||||
|
||||
Reference in New Issue
Block a user