mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 03:24:32 -05:00
Merge pull request #72877 from bruvzg/x11_on_top
[X11] Fix initial "on top" window state.
This commit is contained in:
commit
f84479fe5a
1 changed files with 16 additions and 0 deletions
|
@ -2057,6 +2057,22 @@ void DisplayServerX11::_validate_mode_on_map(WindowID p_window) {
|
||||||
} else if (wd.minimized && !_window_minimize_check(p_window)) {
|
} else if (wd.minimized && !_window_minimize_check(p_window)) {
|
||||||
_set_wm_minimized(p_window, true);
|
_set_wm_minimized(p_window, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wd.on_top) {
|
||||||
|
Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
|
||||||
|
Atom wm_above = XInternAtom(x11_display, "_NET_WM_STATE_ABOVE", False);
|
||||||
|
|
||||||
|
XClientMessageEvent xev;
|
||||||
|
memset(&xev, 0, sizeof(xev));
|
||||||
|
xev.type = ClientMessage;
|
||||||
|
xev.window = wd.x11_window;
|
||||||
|
xev.message_type = wm_state;
|
||||||
|
xev.format = 32;
|
||||||
|
xev.data.l[0] = _NET_WM_STATE_ADD;
|
||||||
|
xev.data.l[1] = wm_above;
|
||||||
|
xev.data.l[3] = 1;
|
||||||
|
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DisplayServerX11::window_is_maximize_allowed(WindowID p_window) const {
|
bool DisplayServerX11::window_is_maximize_allowed(WindowID p_window) const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue