sidebery icon indicating copy to clipboard operation
sidebery copied to clipboard

feat: open window (from drag) under mouse

Open rebelonion opened this issue 1 year ago • 1 comments

This PR makes new windows opened by dragging a tab from sidebery to outside the container open directly under the mouse.

The new window will open with an offset relative to where the user's mouse was inside the original window, mimicking Firefox's default tab behavior.

Tested on 1080p, 1440p, and multi-window.

Before

Before

After

After

rebelonion avatar Jun 26 '24 15:06 rebelonion

since maximized may not be combined with left, top, width, or height, to get a new window to open maximized on the correct screen/monitor, it needs to be opened with the normal state with the correct left and top, then maximized.

An odd behavior I found was if the initial window was maximized, the new window would always open maximized first before shrinking, even when given a normal state. This would ruin the new x and y for the new screen. I got around this by forcing a width and height of the new window before maximizing it. Idk why Firefox always maximizes first. Almost seems like a bug on their side.

rebelonion avatar Jun 26 '24 18:06 rebelonion

I no longer use this extension, so if someone else wants to use this as a starting point, go ahead.

rebelonion avatar Feb 28 '25 23:02 rebelonion