-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一个页面带有gif控件,关闭这个页面时,有时在屏幕留下残影 #857
Comments
为什么打开之后马上就关闭? |
为了篇幅,我把中间部分程序省掉了,你可以在中间加一个usleep 500ms,但当你连续点击多次按钮,短时间多次触发该事件,就有可能在屏幕上留下残影。我发现这种情况下ret = window_close(busying_win)的ret为0,说明界面是关闭成功了。那么这个残影是怎么导致的?
|
PC上能重现不,如果能重现,发给我看看。如果不能,你在微信群里问下。 |
你指的是发个短视频给你看看? |
160ff9d42d43ce4b199abc8317a16f58.online-video-cutter.com.1.mp4 |
你帖子上面的 popup 的背景被设置为 #00000000,这个就是透明的意思啊,你这个白色窗口又是什么意思呢?你把上面的 popup 的背景色设为 #FFFFFFFF 吗? |
你好,可不可以通过先销毁子控件(比如GIF),再关闭界面的方式消除残影问题?如果是,我发现widget destroy这方面的函数好像都是异步销毁(idle add函数),请问有没有同步销毁控件的函数 |
重点不在控件上面,是机制上面: |
我在一个项目上应用gif控件,一个xml文件
![image](https://private-user-images.githubusercontent.com/93625836/278367234-2478220e-0b05-45b2-aa37-eda69f6f7a1c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMTY0MjcsIm5iZiI6MTcyNjAxNjEyNywicGF0aCI6Ii85MzYyNTgzNi8yNzgzNjcyMzQtMjQ3ODIyMGUtMGIwNS00NWIyLWFhMzctZWRhNjlmNmY3YTFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFp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X2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4tFtpSU5xlEQZZToTbYUFMrUoblKbJxWwTmuWHZ6yGQ)
然后设计一个按钮,点击它触发一个事件, 就是先打开这个界面,然后又关闭, 如下图程序所示
busying_win = window_open("ui_busying_page"); window_close(busying_win);
但这样会产生一个现象,快速点击会在屏幕留下残影,如下图所示》转圈圈
经分析源码发现可能是异步导致,推测是,关闭界面时没有及时销毁GIF控件,留下残影,然后修改代码如下图所示就没有出现上述情况
busying_win = window_open("ui_busying_page");
widget_destroy(gif),
usleep(20000),
window_close(busying_win);
现在我的问题是如果不用这个延迟usleep(20000),有什么办法解决
谢谢
The text was updated successfully, but these errors were encountered: