Skip to content

Commit

Permalink
Fixes godotengine#55415 setup wm atom as dialog
Browse files Browse the repository at this point in the history
For dialogs and popups, this solution should work on all
tiling window managers.
  • Loading branch information
Amatrelan committed Aug 15, 2023
1 parent c495eb5 commit 127a32d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,14 @@ void DisplayServerX11::window_set_transient(WindowID p_window, WindowID p_parent
}
}
} else {
if (!wd_window.is_popup || !wd_window.no_focus) {
Atom type_atom = XInternAtom(x11_display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
Atom wt_atom = XInternAtom(x11_display, "_NET_WM_WINDOW_TYPE", False);

if (type_atom != None && wt_atom != None) {
XChangeProperty(x11_display, wd_window.x11_window, wt_atom, XA_ATOM, 32, PropModeReplace, (unsigned char *)&type_atom, 1);
}
}
ERR_FAIL_COND(!windows.has(p_parent));
ERR_FAIL_COND_MSG(prev_parent != INVALID_WINDOW_ID, "Window already has a transient parent");
WindowData &wd_parent = windows[p_parent];
Expand Down

0 comments on commit 127a32d

Please sign in to comment.