Skip to content

When the window is maximized, the menu is rendered at an incorrect position. It appears to be positioned based on calculations from the previous window size #780

@fjxfirst

Description

@fjxfirst

Description

When the window is maximized, the menu is rendered at an incorrect position. It appears to be positioned based on calculations from the previous window size

Reproduce

  1. Maximize the browser window.
  2. Restore the window to a non‑maximized state, then manually resize it.
  3. Move the mouse over the top menu bar multiple times, ensuring only mousemove events are triggered.
  4. Maximize the window again.
  5. Right‑click an element that should open a context menu (preferably an element in the main content area or a node in the left‑side tree).

Expected behavior

The context menu should always appear at the correct cursor position relative to the current window size and state.

Context

Root Cause Analysis:

In menu.ts, the transientCacheCounter increments during mousemove events but only decrements when a menu is rendered.

This leads to continuous accumulation of windowData entries while the window is in a non‑maximized state (during resize operations with mousemove events).

When the window is later maximized, the menu positioning logic incorrectly reads windowData values that correspond to the previous non‑maximized window state, resulting in misplaced menu rendering.

  • Operating System and version: win10 @lumino/widgets version 2.5.0
  • Browser and version:
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions