rem: if (amiga_window)
add: if (amiga_window && amiga_icon)
context: ui_create_window(void){  ULONG common_window_tags[] =    {      WA_ReportMouse,    g_sendmotion ? TRUE : FALSE,      WA_Activate,       TRUE,      WA_RMBTrap,        TRUE,      WA_ScreenTitle,    (ULONG) g_title,      WA_WindowName,     (ULONG) g_title,#ifdef __MORPHOS__      WA_ExtraGadget_Iconify, amiga_icon != NULL,#endif      WA_IDCMP,          (IDCMP_CLOSEWINDOW |			  IDCMP_GADGETUP |			  IDCMP_ACTIVEWINDOW |			  IDCMP_INACTIVEWINDOW |			  IDCMP_NEWSIZE |			  IDCMP_SIZEVERIFY |			  IDCMP_RAWKEY |			  IDCMP_MOUSEBUTTONS |			  (g_sendmotion ? IDCMP_MOUSEMOVE : 0)),      TAG_DONE    };    if( g_fullscreen )  {    amiga_screen = OpenScreenTags( NULL,                                   SA_Width,       g_width,                                   SA_Height,      g_height,                                   SA_Depth,       amiga_bpp,                                   SA_Title,       (ULONG) g_title,                                   SA_ShowTitle,   FALSE,                                   SA_Quiet,       TRUE,                                   SA_Type,        CUSTOMSCREEN,                                   SA_DisplayID,   amiga_screen_id,                                   SA_Interleaved, TRUE,                                   SA_AutoScroll,  TRUE,                                   SA_MinimizeISG, TRUE,                                   SA_SharePens,   TRUE,                                   TAG_DONE );    if( amiga_screen == NULL )    {      error( "ui_create_window: Unable to open screen.\n" );      return False;    }    amiga_window = OpenWindowTags( NULL,                                   WA_Left,           0,                                   WA_Top,            0,                                   WA_Width,          amiga_screen->Width,                                   WA_Height,         amiga_screen->Height,                                   WA_CustomScreen,   (ULONG) amiga_screen,                                   WA_Backdrop,       TRUE,                                   WA_Borderless,     TRUE,                                   WA_NoCareRefresh,  TRUE,                                   WA_SimpleRefresh,  TRUE,                                   TAG_MORE,          (ULONG) common_window_tags );  }  else  {    struct IntuiText it =      {	0, 0,	0,	0, 0,	amiga_pubscreen->Font, g_title,	NULL      };    // NOTE!! amiga_pubscreen is still valid!        WORD zoom[] = { ~0, ~0, 0,		    amiga_pubscreen->WBorTop + amiga_pubscreen->Font->ta_YSize + 1 };        zoom[ 2 ] = IntuiTextLength( &it ) + 128;        if( zoom[ 2 ] > amiga_pubscreen->Width )    {      zoom[ 2 ] = amiga_pubscreen->Width;    }    amiga_window = OpenWindowTags( NULL,                                   WA_Title,          (ULONG) g_title,                                   WA_DragBar,        TRUE,                                   WA_DepthGadget,    TRUE,                                   WA_CloseGadget,    TRUE,                                   WA_Left,           amiga_left,                                   WA_Top,            amiga_top,                                   WA_InnerWidth,     g_width,                                   WA_InnerHeight,    g_height,                                   WA_AutoAdjust,     FALSE,                                   WA_PubScreen,      (ULONG) amiga_pubscreen,                                   WA_Zoom,           (ULONG) zoom,                                   WA_SmartRefresh,   TRUE,                                   TAG_MORE,          (ULONG) common_window_tags );      // We don't need it anymore    UnlockPubScreen( NULL, amiga_pubscreen );    amiga_pubscreen = 0;#ifdef __amigaos4__    if (amiga_window)    {       uint32 size = (amiga_window->WScreen->Flags & SCREENHIRES ? SYSISIZE_MEDRES : SYSISIZE_LOWRES);       uint32 height = amiga_window->WScreen->Font->ta_YSize + amiga_window->WScreen->WBorTop + 1;       struct Image *idepth, *izoom;       amiga_DrInfo = GetScreenDrawInfo(amiga_window->WScreen);       idepth = (struct Image *)NewObject( NULL, "sysiclass",                                           SYSIA_Size, size,                                           SYSIA_DrawInfo, amiga_DrInfo,                                           SYSIA_Which, DEPTHIMAGE,                                           IA_Height, height,                                           TAG_DONE );       izoom = (struct Image *)NewObject( NULL, "sysiclass",                                          SYSIA_Size, size,                                          SYSIA_DrawInfo, amiga_DrInfo,                                          SYSIA_Which, ZOOMIMAGE,                                          IA_Height, height,                                          TAG_DONE );       amiga_IconifyImage = (struct Image *)NewObject( NULL, "sysiclass",                                                       SYSIA_Size, size,                                                       SYSIA_DrawInfo, amiga_DrInfo,                                                       SYSIA_Which, ICONIFYIMAGE,                                                       IA_Height, height,                                                       TAG_DONE );       if (amiga_IconifyImage && idepth && izoom)       {          int32 relright;          relright  = - amiga_IconifyImage->Width + 2;          relright -= idepth->Width - 1;          relright -= izoom->Width - 1;          amiga_IconifyGadget = (struct Gadget *)NewObject( NULL, "buttongclass",                                                            GA_Image, amiga_IconifyImage,                                                            GA_TopBorder, TRUE,                                                            GA_Titlebar, TRUE,                                                            GA_RelRight, relright,                                                            GA_Top, 0,                                                            GA_ID, ETI_Iconify,                                                            GA_RelVerify, TRUE,                                                            TAG_DONE );       }       if (idepth) DisposeObject((Object *)idepth);       if (izoom)  DisposeObject((Object *)izoom);       if (amiga_IconifyGadget)       {          AddGList( amiga_window, amiga_IconifyGadget, 0, 1, NULL);          RefreshGList( amiga_IconifyGadget, amiga_window, NULL, 1);       }    }#endif  }  if( amiga_window == NULL )  {    error( "ui_create_window: Unable to open window.\n" );    return False;  }  GetRGB32( amiga_window->WScreen->ViewPort.ColorMap,            16 + 1, 3, amiga_cursor_colors );  return True;}