Skip to content

Commit

Permalink
Merge pull request #28557 from AndreaCatania/revfix
Browse files Browse the repository at this point in the history
Fixed game crash, regression of  #26977
  • Loading branch information
akien-mga authored May 1, 2019
2 parents 59b553b + 2684e81 commit 48d3163
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions platform/x11/os_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,9 +1190,12 @@ void OS_X11::set_window_position(const Point2 &p_position) {
unsigned long remaining;
unsigned char *data = NULL;
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
long *extents = (long *)data;
x = extents[0];
y = extents[2];
if (format == 32 && len == 4) {
long *extents = (long *)data;
x = extents[0];
y = extents[2];
}
XFree(data);
}
}
XMoveWindow(x11_display, x11_window, p_position.x - x, p_position.y - y);
Expand All @@ -1218,9 +1221,12 @@ Size2 OS_X11::get_real_window_size() const {
unsigned long remaining;
unsigned char *data = NULL;
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
long *extents = (long *)data;
w += extents[0] + extents[1]; // left, right
h += extents[2] + extents[3]; // top, bottom
if (format == 32 && len == 4) {
long *extents = (long *)data;
w += extents[0] + extents[1]; // left, right
h += extents[2] + extents[3]; // top, bottom
}
XFree(data);
}
return Size2(w, h);
}
Expand Down

0 comments on commit 48d3163

Please sign in to comment.