Merge pull request #3583 from nutty898/#4557

Optimize GUI lib