Browse Source

Fix embed UI covering window controls under certain hosts

Fixes #725
tags/v1.9.11
falkTX 7 years ago
parent
commit
84151c5e20
3 changed files with 9 additions and 3 deletions
  1. +7
    -1
      source/backend/utils/Windows.cpp
  2. +1
    -1
      source/carla_utils.py
  3. +1
    -1
      source/native-plugins/resources/carla-plugin

+ 7
- 1
source/backend/utils/Windows.cpp View File

@@ -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) int* carla_x11_get_window_pos(uintptr_t winId)
{ {
static int pos[2];
static int pos[4];


if (winId == 0) if (winId == 0)
{ {
pos[0] = 0; pos[0] = 0;
pos[1] = 0; pos[1] = 0;
pos[2] = 0;
pos[3] = 0;
} }
#ifdef HAVE_X11 #ifdef HAVE_X11
else if (::Display* const disp = XOpenDisplay(nullptr)) else if (::Display* const disp = XOpenDisplay(nullptr))
@@ -82,12 +84,16 @@ int* carla_x11_get_window_pos(uintptr_t winId)
XCloseDisplay(disp); XCloseDisplay(disp);
pos[0] = x - xwa.x; pos[0] = x - xwa.x;
pos[1] = y - xwa.y; pos[1] = y - xwa.y;
pos[2] = xwa.x;
pos[3] = xwa.y;
} }
#endif #endif
else else
{ {
pos[0] = 0; pos[0] = 0;
pos[1] = 0; pos[1] = 0;
pos[2] = 0;
pos[3] = 0;
} }


return pos; return pos;


+ 1
- 1
source/carla_utils.py View File

@@ -347,7 +347,7 @@ class CarlaUtils(object):


def x11_get_window_pos(self, winId): def x11_get_window_pos(self, winId):
data = self.lib.carla_x11_get_window_pos(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): def cocoa_get_window(self, winId):
return self.lib.carla_cocoa_get_window(winId) return self.lib.carla_cocoa_get_window(winId)


+ 1
- 1
source/native-plugins/resources/carla-plugin View File

@@ -436,7 +436,7 @@ if config_UseQt5 and LINUX:
return return
self.fPos = pos self.fPos = pos
self.move(pos[0], pos[1]) 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): def eventFilter(self, obj, ev):
if isinstance(ev, QMouseEvent): if isinstance(ev, QMouseEvent):


Loading…
Cancel
Save