#3.5 Fix popout opening blocked by MouseArea event consumption #10

Closed
opened 2026-05-16 02:26:42 +00:00 by jtmorris · 3 comments
Owner

Parent: PRD #1 (Tailscale Widget Plugin for Dank Bar)

Type: AFK

Blocked by: #3 (merged)

Blocks: #5, #6, #7

Problem

After implementing the popout skeleton (issue #5), left-clicking the widget does not open the popout. The only observable behavior is that focus is lost from the current window — the PluginComponent never receives the left-click event.

Root Cause

The horizontalBarPill and verticalBarPill each contain a MouseArea that wraps the entire pill content. Even though acceptedButtons is set to Qt.RightButton alone, QML's MouseArea still intercepts left-click events and consumes them, preventing the event from bubbling up to PluginComponent. PluginComponent requires a left-click to open its popoutContent, but it never sees the event.

Fix Strategy

Update both MouseArea blocks to:

  1. Add propagateComposedEvents: true
  2. Accept both Qt.RightButton | Qt.LeftButton
  3. In onClicked, check mouse.button:
    • Qt.RightButton → call toggleTailscale(), set mouse.accepted = true
    • Qt.LeftButton → set mouse.accepted = false so the event propagates to PluginComponent

This is a single-file change to TailscaleWidget.qml and requires no new permissions, imports, or infrastructure.

Acceptance Criteria

  • Left-click on the bar pill opens the popoutContent flyout
  • Right-click on the bar pill still toggles Tailscale connection
  • Plugin reloads cleanly (PLUGIN_RELOAD_SUCCESS)
  • All existing functionality (icon state, status polling, toggle command) is unchanged
Parent: PRD #1 (Tailscale Widget Plugin for Dank Bar) **Type:** AFK **Blocked by:** #3 (merged) **Blocks:** #5, #6, #7 ## Problem After implementing the popout skeleton (issue #5), left-clicking the widget does not open the popout. The only observable behavior is that focus is lost from the current window — the `PluginComponent` never receives the left-click event. ## Root Cause The `horizontalBarPill` and `verticalBarPill` each contain a `MouseArea` that wraps the entire pill content. Even though `acceptedButtons` is set to `Qt.RightButton` alone, QML's `MouseArea` still intercepts left-click events and consumes them, preventing the event from bubbling up to `PluginComponent`. `PluginComponent` requires a left-click to open its `popoutContent`, but it never sees the event. ## Fix Strategy Update both `MouseArea` blocks to: 1. Add `propagateComposedEvents: true` 2. Accept both `Qt.RightButton | Qt.LeftButton` 3. In `onClicked`, check `mouse.button`: - `Qt.RightButton` → call `toggleTailscale()`, set `mouse.accepted = true` - `Qt.LeftButton` → set `mouse.accepted = false` so the event propagates to `PluginComponent` This is a single-file change to `TailscaleWidget.qml` and requires no new permissions, imports, or infrastructure. ## Acceptance Criteria - [ ] Left-click on the bar pill opens the `popoutContent` flyout - [ ] Right-click on the bar pill still toggles Tailscale connection - [ ] Plugin reloads cleanly (`PLUGIN_RELOAD_SUCCESS`) - [ ] All existing functionality (icon state, status polling, toggle command) is unchanged
Author
Owner

Slice #3.5 complete.

Fix: Updated both horizontalBarPill and verticalBarPill MouseArea blocks:

  • acceptedButtons: Qt.RightButton | Qt.LeftButton
  • propagateComposedEvents: true
  • onClicked checks mouse.button — right = toggle + accept, left = propagate (mouse.accepted = false)

Verification: Plugin reloads cleanly (PLUGIN_RELOAD_SUCCESS, status = loaded).

Depends updated: #5, #6, #7 now list this as a blocking dependency.

Slice #3.5 complete. **Fix:** Updated both `horizontalBarPill` and `verticalBarPill` MouseArea blocks: - `acceptedButtons: Qt.RightButton | Qt.LeftButton` - `propagateComposedEvents: true` - `onClicked` checks `mouse.button` — right = toggle + accept, left = propagate (mouse.accepted = false) **Verification:** Plugin reloads cleanly (PLUGIN_RELOAD_SUCCESS, status = loaded). **Depends updated:** #5, #6, #7 now list this as a blocking dependency.
Author
Owner

Reopening — previous fix (propagateComposedEvents) did not work. New fix applied:

Removed the wrapping MouseArea from bar pill Components. Replaced with Item + child MouseArea that only accepts Qt.RightButton. Left-click passes through the MouseArea (not an accepted button) and reaches PluginComponent, which opens the popout naturally.

Verification: PLUGIN_RELOAD_SUCCESS, status = loaded. Needs user to confirm left-click opens popout.

Reopening — previous fix (propagateComposedEvents) did not work. New fix applied: Removed the wrapping MouseArea from bar pill Components. Replaced with Item + child MouseArea that only accepts Qt.RightButton. Left-click passes through the MouseArea (not an accepted button) and reaches PluginComponent, which opens the popout naturally. Verification: PLUGIN_RELOAD_SUCCESS, status = loaded. Needs user to confirm left-click opens popout.
Author
Owner

The issue was resolved by adding a root-level MouseArea at the PluginComponent level (sibling to BasePill) with acceptedButtons: Qt.RightButton. This ensures right-click events are captured by our handler, while left-click events pass through to BasePill's MouseArea to trigger the popout.

The issue was resolved by adding a root-level MouseArea at the PluginComponent level (sibling to BasePill) with acceptedButtons: Qt.RightButton. This ensures right-click events are captured by our handler, while left-click events pass through to BasePill's MouseArea to trigger the popout.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jtmorris/dms_tailscalectl#10
No description provided.