Improve tab reordering#1293
Conversation
The old implementation didn't correctly detect the end of dragging if the left mouse button was released out of the tab bar. Sometimes, tabs were highlighted unintentionally. Or even crashes occurred. * Use SetCapture()/ReleaseCapture() to detect the end of dragging. * Change the mouse cursor while dragging. * Change the tab order in real-time.
|
Thank you very much for handling issues that I hadn't noticed, and improving more. |
|
When I use gVim, the tab is highlighted in pale blue when the mouse cursor hovers over it. |
|
Not sure whether we're talking about the same thing, and how vim would be involved. |
This is because I was referring to Vim's code when I implemented this PR:
In my implementation, tabs are reordered soon if the mouse cursor goes over another tab. So, there might be no chance to set the background color. If we set a threshold for it, setting the color might be possible. |
|
I have reactived dynamic tab highlighting. First I fixed the crash condition, then I adapted the approach to the new paradigm of dropping tabs right away while dragging. The dynamic colouring is a substitute of dynamic visual tab placement as other applications (browsers) do. Colour could be chosen to something different, see comments after line 360. |
|
I've tried your latest commit. It works fine. Thank you for revising my PR. |
| } | ||
| else if (HIWORD(lp) == WM_LBUTTONUP) { | ||
| // drop tab while dragging for tab reordering | ||
| if (abs(p.x - xpos) > GetSystemMetrics(SM_CXDRAG)) { |
There was a problem hiding this comment.
For better high DPI support, it might be better to use pGetSystemMetricsForDpi() instead of GetSystemMetrics().
There was a problem hiding this comment.
Sounds proper in theory but it doesn't seem to make a difference. Checking my previous use of the Dpi version I did some tests with it but it's currently not in use anywhere in mintty.
There was a problem hiding this comment.
Sounds proper in theory but it doesn't seem to make a difference.
GetSystemMetrics(SM_CXDRAG) normally returns a small value (e.g. 3). Even if the value is multiplied by the DPI ratio, it will be still small. So, it might be difficult to notice the difference.
|
I added the value to the debug output (winmain.c line 3071) and values were the same for me (switching between 125% and 175% zoom factor). |
|
Oh, you are correct. I didn't know that some values are unaffected by the DPI ratio. |
|
I've further enhanced tab dragging by swiping the tab button. Comments welcome. |
|
I also changed the tab colour while dragging. Planning a release this weekend. |
|
Released 3.7.7. |
merge from b9e097b commit b9e097b Dec 26 2024 fix overhang rendering for some characters, clipped in 3.7.7 (mintty#1304) commit 392b44a Dec 21 2024 3.7.7 commit 34db7bc Dec 21 2024 commit 8ffad55 Dec 19 2024 virtual transparency: fix background offset with options Scrollbar=left or BorderStyle=frame/void (mintty#1296) commit b8148bb Dec 19 2024 swipe visualisation of tab reorder dragging (~mintty#1293) commit fce7f18 Dec 17 2024 image background: enhance updating when desktop background is changed (mintty#1296) commit 02e2266 Dec 16 2024 image background: keep updated while moving/resizing commit eb6ead7 Dec 15 2024 virtual transparency: fix desktop background offset, adjust brush (mintty#1296) commit d227ec8 Dec 15 2024 wiki: describe tweaked emoji width mode commit e0d8b4e Dec 15 2024 wiki: hints on Paste protection (mintty#777) commit e6b69f0 Dec 11 2024 fix distinction of ZWJ emoji vs other occurence commit c2e2d35 Dec 10 2024 tweak debug_win_text_invocation commit f2ee904 Dec 5 2024 VT52 emulation absolute position keeps row/column if out-of-bounds (mintty#1299) commit 995c45d Dec 2 2024 neutralise mysterious compilation bug since gcc 14
merge from b9e097b commit b9e097b Dec 26 2024 fix overhang rendering for some characters, clipped in 3.7.7 (mintty#1304) commit 392b44a Dec 21 2024 3.7.7 commit 34db7bc Dec 21 2024 commit 8ffad55 Dec 19 2024 virtual transparency: fix background offset with options Scrollbar=left or BorderStyle=frame/void (mintty#1296) commit b8148bb Dec 19 2024 swipe visualisation of tab reorder dragging (~mintty#1293) commit fce7f18 Dec 17 2024 image background: enhance updating when desktop background is changed (mintty#1296) commit 02e2266 Dec 16 2024 image background: keep updated while moving/resizing commit eb6ead7 Dec 15 2024 virtual transparency: fix desktop background offset, adjust brush (mintty#1296) commit d227ec8 Dec 15 2024 wiki: describe tweaked emoji width mode commit e0d8b4e Dec 15 2024 wiki: hints on Paste protection (mintty#777) commit e6b69f0 Dec 11 2024 fix distinction of ZWJ emoji vs other occurence commit c2e2d35 Dec 10 2024 tweak debug_win_text_invocation commit f2ee904 Dec 5 2024 VT52 emulation absolute position keeps row/column if out-of-bounds (mintty#1299) commit 995c45d Dec 2 2024 neutralise mysterious compilation bug since gcc 14
merge from b9e097b commit b9e097b Dec 26 2024 fix overhang rendering for some characters, clipped in 3.7.7 (mintty#1304) commit 392b44a Dec 21 2024 3.7.7 commit 34db7bc Dec 21 2024 commit 8ffad55 Dec 19 2024 virtual transparency: fix background offset with options Scrollbar=left or BorderStyle=frame/void (mintty#1296) commit b8148bb Dec 19 2024 swipe visualisation of tab reorder dragging (~mintty#1293) commit fce7f18 Dec 17 2024 image background: enhance updating when desktop background is changed (mintty#1296) commit 02e2266 Dec 16 2024 image background: keep updated while moving/resizing commit eb6ead7 Dec 15 2024 virtual transparency: fix desktop background offset, adjust brush (mintty#1296) commit d227ec8 Dec 15 2024 wiki: describe tweaked emoji width mode commit e0d8b4e Dec 15 2024 wiki: hints on Paste protection (mintty#777) commit e6b69f0 Dec 11 2024 fix distinction of ZWJ emoji vs other occurence commit c2e2d35 Dec 10 2024 tweak debug_win_text_invocation commit f2ee904 Dec 5 2024 VT52 emulation absolute position keeps row/column if out-of-bounds (mintty#1299) commit 995c45d Dec 2 2024 neutralise mysterious compilation bug since gcc 14
merge from b9e097b commit b9e097b Dec 26 2024 fix overhang rendering for some characters, clipped in 3.7.7 (mintty#1304) commit 392b44a Dec 21 2024 3.7.7 commit 34db7bc Dec 21 2024 commit 8ffad55 Dec 19 2024 virtual transparency: fix background offset with options Scrollbar=left or BorderStyle=frame/void (mintty#1296) commit b8148bb Dec 19 2024 swipe visualisation of tab reorder dragging (~mintty#1293) commit fce7f18 Dec 17 2024 image background: enhance updating when desktop background is changed (mintty#1296) commit 02e2266 Dec 16 2024 image background: keep updated while moving/resizing commit eb6ead7 Dec 15 2024 virtual transparency: fix desktop background offset, adjust brush (mintty#1296) commit d227ec8 Dec 15 2024 wiki: describe tweaked emoji width mode commit e0d8b4e Dec 15 2024 wiki: hints on Paste protection (mintty#777) commit e6b69f0 Dec 11 2024 fix distinction of ZWJ emoji vs other occurence commit c2e2d35 Dec 10 2024 tweak debug_win_text_invocation commit f2ee904 Dec 5 2024 VT52 emulation absolute position keeps row/column if out-of-bounds (mintty#1299) commit 995c45d Dec 2 2024 neutralise mysterious compilation bug since gcc 14
|
Released 3.8.0. Fixed colour glitches in the visual feedback during tab reordering. |
The old implementation didn't correctly detect the end of dragging if
the left mouse button was released out of the tab bar. Sometimes, tabs
were highlighted unintentionally. Or even crashes occurred.