diff --git a/source/backend/utils/Windows.cpp b/source/backend/utils/Windows.cpp index e84e064ad..90cbbe04e 100644 --- a/source/backend/utils/Windows.cpp +++ b/source/backend/utils/Windows.cpp @@ -64,12 +64,14 @@ void carla_x11_move_window(uintptr_t winId, int x, int y) int* carla_x11_get_window_pos(uintptr_t winId) { - static int pos[2]; + static int pos[4]; if (winId == 0) { pos[0] = 0; pos[1] = 0; + pos[2] = 0; + pos[3] = 0; } #ifdef HAVE_X11 else if (::Display* const disp = XOpenDisplay(nullptr)) @@ -82,12 +84,16 @@ int* carla_x11_get_window_pos(uintptr_t winId) XCloseDisplay(disp); pos[0] = x - xwa.x; pos[1] = y - xwa.y; + pos[2] = xwa.x; + pos[3] = xwa.y; } #endif else { pos[0] = 0; pos[1] = 0; + pos[2] = 0; + pos[3] = 0; } return pos; diff --git a/source/carla_utils.py b/source/carla_utils.py index 5073e22b0..e69d3b2d0 100644 --- a/source/carla_utils.py +++ b/source/carla_utils.py @@ -347,7 +347,7 @@ class CarlaUtils(object): def x11_get_window_pos(self, winId): data = self.lib.carla_x11_get_window_pos(winId) - return (int(data[0]), int(data[1])) + return tuple(int(data[i]) for i in range(4)) def cocoa_get_window(self, winId): return self.lib.carla_cocoa_get_window(winId) diff --git a/source/native-plugins/resources/carla-plugin b/source/native-plugins/resources/carla-plugin index 9a915a39a..a5fb2db6c 100755 --- a/source/native-plugins/resources/carla-plugin +++ b/source/native-plugins/resources/carla-plugin @@ -436,7 +436,7 @@ if config_UseQt5 and LINUX: return self.fPos = pos self.move(pos[0], pos[1]) - gCarla.utils.x11_move_window(self.fWinId, 0, 0) + gCarla.utils.x11_move_window(self.fWinId, pos[2], pos[3]) def eventFilter(self, obj, ev): if isinstance(ev, QMouseEvent):