Skip to content

Conversation

@wengxt
Copy link
Member

@wengxt wengxt commented Oct 30, 2024

Right now both virtual keyboard & classicui want SNI, but when transition
between two UI, sni is disabled and then re-enabled which is causing XCB
tray window being show/hide immediately.

This change try to simplify the xcb tray window logic:

  1. hide, if suspend()
  2. If SNI addon is not available. show on resume
    If SNI addon is available, defer 1sec and check SNI status.

SNI enable/disable logic is updated to allow multiple enable/disable by
using a reference counter. disable() is deferred with event dispatcher,
to avoid enable/disable causing register/unregistration.

… between two UI

Right now both virtual keyboard and classicui want SNI. When transition
between two UI, sni is disabled and then re-enabled which is causing XCB
tray window being show/hide immediately.

This change try to simplify the xcb tray window logic:
1. hide, if suspend()
2. If SNI addon is not available. show on resume
   If SNI addon is available, defer 1sec and check SNI status.

SNI enable/disable logic is updated to allow multiple enable/disable by
using a reference counter. disable() is deferred with event dispatcher,
to avoid enable/disable causing register/unregistration.
@kingysu
Copy link
Contributor

kingysu commented Oct 31, 2024

@wengxt 如果有连续disable的话,则会向消息循环发送多个事件。这个可以优化一下

@wengxt
Copy link
Member Author

wengxt commented Oct 31, 2024

@wengxt 如果有连续disable的话,则会向消息循环发送多个事件。这个可以优化一下

不太重要,而且改成引用计数就需要多次

@hantengc
Copy link
Contributor

fcitx5启动,默认使用了classic ui,此时enable sni;
等到切换virtual keyboard是,classic ui 先disable sni,然后virtual keyboard再enable sni.

目前的逻辑没办法规避这一点吧

@hantengc
Copy link
Contributor

fcitx5启动,默认使用了classic ui,此时enable sni; 等到切换virtual keyboard是,classic ui 先disable sni,然后virtual keyboard再enable sni.

目前的逻辑没办法规避这一点吧

导致托盘图标退了一下又重新出现 怪难接受的

@wengxt
Copy link
Member Author

wengxt commented Oct 31, 2024

@hantengc 可以,因为disable延迟到event loop下一个处理了

现在第二个enable会在之前的disable起作用前执行

@wengxt wengxt merged commit 42f847f into master Nov 3, 2024
4 checks passed
@wengxt wengxt deleted the sni-transition branch November 3, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants