Skip to content

[BUG] Dragging dockable child windows on multi monitor setup draws drag shadow one screen off #16805

@dgtrapeze

Description

@dgtrapeze

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

On certain machines with multiple monitors, dragging and dropping any of the notepad++ dockable windows (eg the document list or function list) draws the drag shadow approximately one screen to the left of where the mouse is making it extremely difficult to use.

From what I can tell from the users who have reported the issue the following conditions need to be true

  • Windows multi-monitor is in use
  • A monitor other than monitor 1 is the 'main' monitor in windows
  • This 'main' monitor is not the left hand most monitor

What is weird about the issue is that the 'capture' that notepad++ does of the screen before drawing the drag shadow is of the correct portion of the screen (ie what is around the mouse cursor position), but when it actually draws the drag shadow, it appears to be one screen to the left of where it should be.

Steps To Reproduce

  1. Setup multiple monitors in windows
  2. Make a monitor other than monitor 1 the 'main monitor'
  3. Position the main monitor to the right of another monitor so that the 0x0 co-ordinate of the root desktop is not at the top left

However I cannot verify this is the complete list of conditions needed to replicate. From what I can tell, this set of steps will reliably produce the problem on Windows 11 machines, but Windows 10 and Windows Server (via remote desktop) may or may not exhibit the issue. So I fear there is another factor to the reproduction that I've been unable to work out.

Current Behavior

See the following for a demonstration of the issue. This was captured on a 3 screen setup (a laptop in a docking station). The laptop inbuilt monitor is monitor 1, and the 2 monitors connected to the docking station are monitors 2 and 3. Monitor 2 is to the left of monitor 3 but monitor 3 is defined as the 'main monitor' in this setup.

For the following demonstration, notepad++ is positioned on monitor 3. The boundary between monitor 2 and 3 is roughly in the middle of this screen capture.
Image

Expected Behavior

Drag shadows appear where the mouse is so you can see where you are positioning the windows when you try and move it.

Debug Information

Notepad++ v8.8.1   (64-bit)
Build time : May  3 2025 - 18:41:09
Scintilla/Lexilla included : 5.5.6/5.4.4
Boost Regex included : 1_85
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DEFAULT (0)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Enterprise (64-bit)
OS Version : 24H2
OS Build : 26100.2894
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)

Anything else?

notepad++ isn't the only application showing this same behaviour on the impacted machines. We have at least one other application which seems to have the same issue, so I assume they use the same technique as notepad++ to draw their drag shadows. From what I can tell from looking at the notepad++ source code, the responsible code is https://github.com/notepad-plus-plus/notepad-plus-plus/blob/45ce3418da1e6a906f2fd6c05124aee65ccec2a3/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp#L511 and it is using BitBlt to draw to the windows desktop window.

However other applications that are Qt based (TortoiseHg and another Qt based app) and Visual Studio which allow a similar style of child window drag and drop outside of their parent window work fine so whatever technique they use works in this setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions