Skip to content

fix: restore Super key activation for tiling mode (regression from 64afeba)#506

Merged
domferr merged 1 commit intodomferr:v18.0from
liuxiaopai-ai:fix/super-key-tiling-activation
Mar 1, 2026
Merged

fix: restore Super key activation for tiling mode (regression from 64afeba)#506
domferr merged 1 commit intodomferr:v18.0from
liuxiaopai-ai:fix/super-key-tiling-activation

Conversation

@liuxiaopai-ai
Copy link

Problem

Fixes #485 — After updating from v17.2 to v17.3, pressing the Super key while dragging a window no longer triggers tiling mode.

Root Cause

Commit 64afeba (refactor: use Clutter.ModifierType as mask) introduced two issues:

  1. Wrong mask for Super key: Clutter.ModifierType.SUPER_MASK (bit 26, value 0x4000000) was used, but global.get_pointer() returns MOD4_MASK (bit 6, value 64) for the Super key. These are different bit positions in the modifier bitmask — SUPER_MASK is a GDK4-style semantic mask, while MOD4_MASK is what Clutter/Mutter actually reports at runtime.

  2. Overly strict comparison: The check was changed from (modifier & mask) !== 0 to (modifier & mask) === mask. The strict equality fails when additional modifier bits are set alongside the target key (which commonly happens with Super).

The old magic numbers (val = 2, 3, 6 as bit positions) happened to be correct: 1 << 6 = 64 = MOD4_MASK, which matches what global.get_pointer() returns for Super.

Fix

  • Use Clutter.ModifierType.MOD4_MASK instead of SUPER_MASK for the Super key
  • Restore !== 0 comparison for robustness (matches behavior of other modifier checks in the codebase, e.g., hoverLine.ts and layoutEditor.ts)

This preserves the intent of 64afeba (using named enum constants instead of magic numbers) while fixing the regression.

@domferr domferr changed the base branch from main to v18.0 March 1, 2026 09:31
@domferr
Copy link
Owner

domferr commented Mar 1, 2026

Hi, thanks a million!

@domferr domferr merged commit b44528c into domferr:v18.0 Mar 1, 2026
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.

Super key activation broken in v17.3

2 participants