gpt4 book ai didi

ubuntu - SDL_WINDOWEVENT_SHOWN 还是 SDL_WINDOWEVENT_EXPOSED?

转载 作者:行者123 更新时间:2023-12-04 18:31:19 24 4
gpt4 key购买 nike

这两种窗口事件类型有什么区别?我看过 this documentation ,但没有给出非常详细的描述。我试图让 SDL 应用程序在未最小化后重绘自身,而我当前的解决方案是同时处理这两种事件类型。只处理 SDL_WINDOWEVENT_EXPOSED不适用于 Ubuntu MATE 1.24.0。

最佳答案

使用 Xorg 时,SDL_WINDOWEVENT_SHOWN至少在以下 cases 中由 SDL 生成:

  • 当一个 MapNotify从 X 服务器接收到事件;
  • 当窗口失去 SDL_WINDOW_HIDDEN旗帜;
  • 当窗口获得SDL_WINDOW_FULLSCREEN旗帜;

  • 关于案例 2 和 3,SDL 源代码中的注释 mentions :

    ...Compositing window managers can alter visibility of windows withoutever mapping / unmapping them, so we handle that here ...


    根据 X Window System Glossary从未显示未映射的窗口:

    A window is said to be mapped if a map call has been performed on it.Unmapped windows and their inferiors are never viewable or visible.

    SDL_WINDOWEVENT_EXPOSED SDL 在收到 Expose 时生成事件。来自 X 服务器的事件。
    X Window System Glossary关于“暴露”事件是这样说的:

    Servers do not guarantee to preserve the contents of windows whenwindows are obscured or reconfigured. Exposure events are sent toclients to inform them when contents of regions of windows have beenlost.


    根据这些数据, SDL_WINDOWEVENT_SHOWN每当窗口将状态从隐藏变为可见并且 SDL_WINDOWEVENT_EXPOSED 将生成事件。当窗口的任何部分变得模糊时,将生成事件。

    关于ubuntu - SDL_WINDOWEVENT_SHOWN 还是 SDL_WINDOWEVENT_EXPOSED?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65582842/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com