Merge pull request #28784 from bruvzg/x11_check_extents_atoms
X11: Check if "_NET_FRAME_EXTENTS" atom is supported.
This commit is contained in:
commit
7112a45d99
|
@ -1184,18 +1184,20 @@ void OS_X11::set_window_position(const Point2 &p_position) {
|
||||||
//exclude window decorations
|
//exclude window decorations
|
||||||
XSync(x11_display, False);
|
XSync(x11_display, False);
|
||||||
Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
|
Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
|
||||||
Atom type;
|
if (prop != None) {
|
||||||
int format;
|
Atom type;
|
||||||
unsigned long len;
|
int format;
|
||||||
unsigned long remaining;
|
unsigned long len;
|
||||||
unsigned char *data = NULL;
|
unsigned long remaining;
|
||||||
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
unsigned char *data = NULL;
|
||||||
if (format == 32 && len == 4) {
|
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
||||||
long *extents = (long *)data;
|
if (format == 32 && len == 4) {
|
||||||
x = extents[0];
|
long *extents = (long *)data;
|
||||||
y = extents[2];
|
x = extents[0];
|
||||||
|
y = extents[2];
|
||||||
|
}
|
||||||
|
XFree(data);
|
||||||
}
|
}
|
||||||
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);
|
||||||
|
@ -1215,18 +1217,20 @@ Size2 OS_X11::get_real_window_size() const {
|
||||||
int w = xwa.width;
|
int w = xwa.width;
|
||||||
int h = xwa.height;
|
int h = xwa.height;
|
||||||
Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
|
Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
|
||||||
Atom type;
|
if (prop != None) {
|
||||||
int format;
|
Atom type;
|
||||||
unsigned long len;
|
int format;
|
||||||
unsigned long remaining;
|
unsigned long len;
|
||||||
unsigned char *data = NULL;
|
unsigned long remaining;
|
||||||
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
unsigned char *data = NULL;
|
||||||
if (format == 32 && len == 4) {
|
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
|
||||||
long *extents = (long *)data;
|
if (format == 32 && len == 4) {
|
||||||
w += extents[0] + extents[1]; // left, right
|
long *extents = (long *)data;
|
||||||
h += extents[2] + extents[3]; // top, bottom
|
w += extents[0] + extents[1]; // left, right
|
||||||
|
h += extents[2] + extents[3]; // top, bottom
|
||||||
|
}
|
||||||
|
XFree(data);
|
||||||
}
|
}
|
||||||
XFree(data);
|
|
||||||
}
|
}
|
||||||
return Size2(w, h);
|
return Size2(w, h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue