Add error checks and harmonize behavior of the set_icon method.
This commit is contained in:
parent
46424488ed
commit
9c5a0c6c10
5 changed files with 138 additions and 108 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue