Repository navigation
Conversation
…kspace The drag controller moves windows with absolute coordinates, which never changes the monitor or workspace Hyprland files them under. A window dropped on another monitor kept reporting its old monitor, so the overlay for that monitor hosted the controls at coordinates outside its screen and the buttons disappeared. When a drag finishes, MOUSE_FIRST.adopt now checks which monitor the window landed on and, if it changed, moves the window to that monitor's active workspace and re-applies the final geometry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After dragging a window to another monitor with the top-edge strip (or SUPER + drag), the minimize, maximize and close buttons disappear.
The drag controller moves windows with
hl.dsp.window.move({ x, y, relative = false }). That changes the window's position but not the monitor or workspace Hyprland files it under. So once the drag ends,win.monitorstill names the old monitor, andwinMonitorfalls back to it. The old monitor's overlay keeps hosting the controls at coordinates outside its own screen, so they can't be seen.Reproduced on Hyprland 0.56.2 with two monitors (DP-1 3440×1440 at 0,0 and DP-2 1920×1080 at 3440,0): a floating window moved to x=4000 still reported
monitor: DP-1,workspace: 1.Fix
src/lua/mousefirst.lua: newMOUSE_FIRST.adopt(address, x, y, w, h). It finds the monitor under the window's top-center point, using the same logical size calculation asmonitor_state. If that differs from the window's current monitor, it moves the window to that monitor's active workspace (follow = true) and re-applies the final size and position, because the workspace move shifts floating windows on its own.src/js/hypr.js:evalAdopt()builder.src/DragController.qml:_finish()calls it after the final move or snap. Both overlay drags and handed-over native drags go through this path.It does nothing when the window stays on the same monitor.
Testing
node --test tests/*.test.mjs: 18/18 pass.MOUSE_FIRST.adopt. Afterwards Hyprland reportedmonitor: DP-2,workspace: 2at the same position, andmousefirst statusshowed the active window on DP-2.🤖 Generated with Claude Code