Add error checks and harmonize behavior of the set_icon method.

This commit is contained in:
bruvzg 2023-06-19 16:18:39 +03:00
parent 46424488ed
commit 9c5a0c6c10
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
5 changed files with 138 additions and 108 deletions

View file

@ -4880,6 +4880,8 @@ void DisplayServerX11::set_icon(const Ref<Image> &p_icon) {
Atom net_wm_icon = XInternAtom(x11_display, "_NET_WM_ICON", False);
if (p_icon.is_valid()) {
ERR_FAIL_COND(p_icon->get_width() <= 0 || p_icon->get_height() <= 0);
Ref<Image> img = p_icon->duplicate();
img->convert(Image::FORMAT_RGBA8);