Fix the sliding window problem in linux occur due to reparenting of the window during the decoration via tracking the parent of the window
This commit is contained in:
parent
e684d126ed
commit
932afc3bf5
2 changed files with 11 additions and 0 deletions
|
@ -3510,6 +3510,15 @@ void DisplayServerX11::_window_changed(XEvent *event) {
|
||||||
wd.minimized = _window_minimize_check(window_id);
|
wd.minimized = _window_minimize_check(window_id);
|
||||||
wd.maximized = _window_maximize_check(window_id, "_NET_WM_STATE");
|
wd.maximized = _window_maximize_check(window_id, "_NET_WM_STATE");
|
||||||
|
|
||||||
|
// Readjusting the window position if the window is being reparented by the window manager for decoration
|
||||||
|
Window root, parent, *children;
|
||||||
|
unsigned int nchildren;
|
||||||
|
if (XQueryTree(x11_display, wd.x11_window, &root, &parent, &children, &nchildren) && wd.parent != parent) {
|
||||||
|
wd.parent = parent;
|
||||||
|
window_set_position(wd.position, window_id);
|
||||||
|
}
|
||||||
|
XFree(children);
|
||||||
|
|
||||||
{
|
{
|
||||||
//the position in xconfigure is not useful here, obtain it manually
|
//the position in xconfigure is not useful here, obtain it manually
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
@ -4994,6 +5003,7 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V
|
||||||
{
|
{
|
||||||
wd.x11_window = XCreateWindow(x11_display, RootWindow(x11_display, visualInfo.screen), win_rect.position.x, win_rect.position.y, win_rect.size.width > 0 ? win_rect.size.width : 1, win_rect.size.height > 0 ? win_rect.size.height : 1, 0, visualInfo.depth, InputOutput, visualInfo.visual, valuemask, &windowAttributes);
|
wd.x11_window = XCreateWindow(x11_display, RootWindow(x11_display, visualInfo.screen), win_rect.position.x, win_rect.position.y, win_rect.size.width > 0 ? win_rect.size.width : 1, win_rect.size.height > 0 ? win_rect.size.height : 1, 0, visualInfo.depth, InputOutput, visualInfo.visual, valuemask, &windowAttributes);
|
||||||
|
|
||||||
|
wd.parent = RootWindow(x11_display, visualInfo.screen);
|
||||||
XSetWindowAttributes window_attributes_ime = {};
|
XSetWindowAttributes window_attributes_ime = {};
|
||||||
window_attributes_ime.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask;
|
window_attributes_ime.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask;
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,7 @@ class DisplayServerX11 : public DisplayServer {
|
||||||
struct WindowData {
|
struct WindowData {
|
||||||
Window x11_window;
|
Window x11_window;
|
||||||
Window x11_xim_window;
|
Window x11_xim_window;
|
||||||
|
Window parent;
|
||||||
::XIC xic;
|
::XIC xic;
|
||||||
bool ime_active = false;
|
bool ime_active = false;
|
||||||
bool ime_in_progress = false;
|
bool ime_in_progress = false;
|
||||||
|
|
Loading…
Reference in a new issue