labwc/include
tokyo4j 41aa7e1a7d IME: fix stuck Ctrl when pressed Ctrl+F in Firefox with Fcitx5
683f67b7 introduced another regression that the modifier state (Ctrl) is
stuck when Ctrl+F is pressed in some applications like Firefox while
Fcitx5 is running. This caused mouse scrolls to zoom in/out the UI.

Let me explain the cause in detail. When Ctrl+F is pressed, an input box
is opened in the application and Fcitx5 creates a new virtual keyboard
(VK), whose initial modifiers is empty. Then prior to 683f67b7, the
key/modifiers events flowed like this:

- The compositor detects F key-release
  - Modifiers (Ctrl pressed) are notified via _set_keyboard()
  - F key-release is forwarded to IM
- IM sends modifiers (Ctrl) back to the compositor via VK
  - **The modifiers on VK is updated (empty->Ctrl)**
  - **Modifers (Ctrl) are notified to the app**
- IM sends F key-release back to the compositor via VK
  - F key-release is notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is forwarded to IM
  - Modifiers (empty) are forwarded to IM
- IM sends Ctrl key-release back to the compsitor via VK
  - Ctrl key-release is notified to IM
- IM sends modifiers (empty) back to the compositor via VK
  - **The modifiers on VK is updated again (Ctrl->empty)**
  - **Modifiers (empty) are notified to the app**

Thus, the final modifiers (empty) is notified to the application as
expected. However, after 683f67b7, the key/modifiers events flowed like
this:

- The compositor detects F key-release
  - F key-release is directly notified to the app
  - The modifiers (Ctrl) is also notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is directly notified to the app
  - Modifiers (empty) are forwarded to IM
- IM sends modifiers (empty) back to the compositor via VK
  - **Modifier on VK is not updated (empty->empty)**
  - **The compositor ignores it**

So the final modifier (empty) is never notified to the application, which
causes stuck Ctrl modifier.

This commit fixes this by not forwarding the modifiers when it hasn't been
updated since it was forwarded previously. So after this commit, the
key/modifiers events flow like this:

- The compositor detects F key-release
  - F key-release is directly notified to the app
  - The modifiers (Ctrl) is also notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is directly notified to the app
  - The modifiers are directly notified to the app because the modifiers
    (empty) are the same as the last forwarded modifier (empty).
2025-01-07 19:31:56 +00:00
..
common scaled_{img,scene}_buffer: add architecture graph 2025-01-06 04:39:09 +01:00
config Add default Alt-Shift-Tab keybind for PreviousWindow 2025-01-03 10:51:26 +09:00
img img: rename lab_img_cache to lab_img_data 2025-01-06 04:39:09 +01:00
input IME: fix stuck Ctrl when pressed Ctrl+F in Firefox with Fcitx5 2025-01-07 19:31:56 +00:00
menu menu: support pipemenu with the toplevel <menu> element 2025-01-03 04:41:25 +01:00
protocols ext-workspace protocol implementation 2024-12-23 04:14:53 +01:00
action.h Refactor the logic of placing client-menu with ShowMenu action 2024-09-21 18:07:34 +01:00
buffer.h ssd: rework titlebar button rendering 2024-12-23 18:11:32 +09:00
debug.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
decorations.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
desktop-entry.h ssd: rework titlebar button rendering 2024-12-23 18:11:32 +09:00
dnd.h chase (dnd): refactor to use wlroot's scene_drag_icon 2023-12-03 18:24:26 +00:00
edges.h snap: cache and ignore last-snapped edge when growing or shrinking 2024-04-10 23:30:28 +01:00
foreign-toplevel-internal.h foreign-toplevel: add ext-toplevel-list support 2024-11-09 20:06:19 +00:00
foreign-toplevel.h foreign-toplevel: create generic abstraction 2024-11-09 20:06:19 +00:00
idle.h Add support for ext_idle_notify_v1.. 2023-07-09 08:26:33 +01:00
labwc.h osd: make window switcher more Openbox-like in terms of key precessing 2025-01-03 10:51:26 +09:00
layers.h layer: update pointer focus on popup destruction 2024-12-20 00:43:06 +09:00
magnifier.h backend/drm: Implement support for renderer loss recovery 2024-07-23 14:44:31 +02:00
meson.build Make xwayland support optional 2020-12-30 10:29:21 +00:00
node.h node: add node_scaled_scene_buffer_from_node 2024-12-23 18:11:32 +09:00
osd.h osd: refactor to not write server->osd_state outside osd.c 2024-12-30 18:07:45 +09:00
output-state.h output: remove ported wlr_output functions 2024-10-29 21:39:19 +00:00
output-virtual.h Add optional headless fallback output 2024-03-08 13:54:13 +01:00
overlay.h overlay: allow to draw both/either of filled/outlined rectangle 2024-04-22 19:22:23 +01:00
placement.h view: honor automatic placement when adjusting floating geometry 2023-12-30 16:50:09 +00:00
regions.h overlay: add snap-to-edge overlay (PR #1652) 2024-04-05 04:35:31 +02:00
resistance.h interactive: allow moving horizontally/vertically maximized window 2024-08-26 20:30:22 +02:00
resize-indicator.h Replace _ with - in source file names 2024-05-22 07:10:51 +01:00
resize-outlines.h Implement <resize><drawContents> 2024-06-15 21:17:01 +01:00
session-lock.h session-lock: restore focused view on unlock 2024-07-07 15:48:32 +09:00
snap-constraints.h snap: cache and ignore last-snapped edge when growing or shrinking 2024-04-10 23:30:28 +01:00
snap.h snap: cache and ignore last-snapped edge when growing or shrinking 2024-04-10 23:30:28 +01:00
ssd-internal.h img: fix UAF on Reconfigure by refcounting 2025-01-04 09:10:02 +01:00
ssd.h query: support additional conditions for matching clients 2024-10-30 14:30:26 -04:00
theme.h theme: use 'labwc' directory 2025-01-06 20:15:26 +00:00
view-impl-common.h view: commonize sub-view logic in view_move_to_front/back() 2023-10-21 15:40:56 +01:00
view.h Make enum three_state public 2024-12-31 16:23:47 +00:00
window-rules.h Revert "keyboard: add window rule to send release-events (#2377)" 2024-12-29 16:27:34 +09:00
workspaces.h ext-workspace protocol integration 2024-12-23 04:14:53 +01:00
xwayland.h xwayland: set initial geometry in map_request handler 2024-07-19 22:40:43 +01:00