Fixed game crash, regression of #26977
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
parent
ae41e35191
commit
2684e81682
1 changed files with 12 additions and 6 deletions
|
@ -1190,10 +1190,13 @@ void OS_X11::set_window_position(const Point2 &p_position) {
|
||||||
unsigned long remaining;
|
unsigned long remaining;
|
||||||
unsigned char *data = NULL;
|
unsigned char *data = NULL;
|
||||||
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
||||||
|
if (format == 32 && len == 4) {
|
||||||
long *extents = (long *)data;
|
long *extents = (long *)data;
|
||||||
x = extents[0];
|
x = extents[0];
|
||||||
y = extents[2];
|
y = extents[2];
|
||||||
}
|
}
|
||||||
|
XFree(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
XMoveWindow(x11_display, x11_window, p_position.x - x, p_position.y - y);
|
XMoveWindow(x11_display, x11_window, p_position.x - x, p_position.y - y);
|
||||||
update_real_mouse_position();
|
update_real_mouse_position();
|
||||||
|
@ -1218,10 +1221,13 @@ Size2 OS_X11::get_real_window_size() const {
|
||||||
unsigned long remaining;
|
unsigned long remaining;
|
||||||
unsigned char *data = NULL;
|
unsigned char *data = NULL;
|
||||||
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
||||||
|
if (format == 32 && len == 4) {
|
||||||
long *extents = (long *)data;
|
long *extents = (long *)data;
|
||||||
w += extents[0] + extents[1]; // left, right
|
w += extents[0] + extents[1]; // left, right
|
||||||
h += extents[2] + extents[3]; // top, bottom
|
h += extents[2] + extents[3]; // top, bottom
|
||||||
}
|
}
|
||||||
|
XFree(data);
|
||||||
|
}
|
||||||
return Size2(w, h);
|
return Size2(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue