Geany 1.33 Windows 10 Rectangular selection interacts oddly with drag-and-drop. Steps to reproduce: 1. Type a large block of text (multiple long lines; Lorem Ipsum or whatever). 2. Select multiple lines of text _normally_; drag and drop selection: **works as expected**: text is "cut" from original position and "pasted" into destination. 3. Make _rectangular selection_; drag and drop it: _**FAILS**_: text gets cut correctly, but gets pasted as if regular text had been copied (first line, newline, second line, newline...), breaking the block of text where it was pasted rather than interleaving clipboard and destination lines. 4. Make _rectangular selection_; _cut/copy_; paste: **works** (lines are interleaved; a block of text is pushed to the right). 5. Make _rectangular selection_; drag and drop it (_after having copied a rectangular selection_): **now it works**. Apparently copying a rectangular selection changes the status/behavior of drag-and-drop. 6. Select multiple lines of text _normally_ (_after having copied a rectangular selection_); drag and drop: _**FAILS**_. Text lines are cut correctly, but pasted in a rectangular fashion (lines are interleaved). 7. _Cut/copy_ text _normally_: the original behavior is restored (regular drag-and-drop **works**; rectangular drag-and-drop **_fails_**).
As someone who uses rectangular selection a lot (which seems to work fine on Linux), this is driving me nuts. (In case this affects anyone else: consider hitting Ctrl-C before dragging and dropping a rectangular selection to change Geany's mode from "regular selection works" to "rectangular selection works"; this is the workaround I'm currently using.)
PS: I currently can't upgrade Geany on this machine, but may try installing it on another computer.
As someone who uses rectangular selection a lot (which seems to work fine on Linux)
Does it work in version 1.33 on Linux?
Does it work in version 1.33 on Linux?
Like a charm. (Just tested; **works** both in the Geany 1.32 from the Ubuntu repos and from a freshly compiled 1.33.0 Geany clone.)
I also tried installing it under **Wine** (emulating a Windows 7) and ***I can reproduce*** the bug, so that rules out a possible issue on the Windows machine. (Also this may help devs debugging if you don't have access to a Windows machine.)
Oh, I also tried Geany 1.36 on Wine just in case it had been fixed, but no, same issue.
I never use this feature in Geany since it never seemed to work quite right (compared to other editors), so I'm just taking a stab here, but is it possibly because the modifier key on Windows is <kbd>Alt</kbd> and not <kbd>Ctrl</kbd> like it is on Linux?
The selection process works fine; it's dragging and dropping which fails. I just use <kbd>Ctrl</kbd>+<kbd>Alt</kbd> on both (back in the day <kbd>Ctrl</kbd> didn't work, since that was for selecting words). Just to make sure this wasn't affecting the behavior, I just tried with <kbd>Alt</kbd> on Windows, but that didn't change the outcome.
Is it possible that Geany has some sort of internal state to decide how to handle drag and drop? If so, it is not being set properly when dragging selected text (in Windows).
@cousteaulecommandant possibly, not Geany but Scintilla where the docs say "Rectangular selections are handled as multiple selections although the original rectangular range is remembered so that subsequent operations may be handled differently for rectangular selections. For example, pasting a rectangular selection places each piece in a vertical column."
Btw just to confirm this wasn't (solely) a Scintilla issue I downloaded and ran latest SciTE 32b for Windows on Wine. SciTE works. (I didn't experiment much though -- didn't test older versions; also it is possible that this is a bug of Scintilla that only affects Geany and not Scite.)
Personally I don't know how can I be of any further help on this bug (I wouldn't even know where to start debugging; I'm not familiar with the Geany code structure and functions).
[...] also it is possible that this is a bug of Scintilla that only affects Geany and not Scite.
It's very likely not to affect Scite on Windows since it uses the native win32 backend and not the GTK+ backend like Geany does.
Maybe its time for the windows build to use GTK3, @eht16 hows that coming?
@cousteaulecommandant what version of GTK+ where you testing with on Linux? (`Help->Debug Messages` first couple of lines).
GTK 3.22.30, GLib 2.56.4
So perhaps it is related to GTK+2 vs GTK+3 as @elextr implied. If you were so inclined you could try building the Linux one with GTK+2, using `./configure --disable-gtk3` (which I believe is the default if you have both GTK2 development dependencies installed). If it doesn't work, then it rules out OS/platform and indicates a bug with all GTK+2 builds (of which the Windows is release is one).
Compiled Geany 1.33.0 on Linux as instructed (GTK 2.24.32, GLib 2.56.4); works. Ouch! I tried with some older Windows versions back to 0.15; none worked. (Weird; I would have sworn I saw it working in older versions.)
So, the GTK version doesn't seem to make a difference. I have no idea what could cause the different behavior, I just guess it's unlikely that it is Geany itself. I agree with @codebrainz that it's probably more related to the GTK backend of Scintilla on Windows.
@elextr regarding GTK3 Windows builds: I remember some time ago (maybe about 2years or so) we tried with GTK3 on Windows and had some issues and so we kept the GTK2 builds. I didn't try it again since then. After the next release, we need a new Windows builds maintainer anyway as Windows 7 is EOL and I personally definitely will never use Windows 10 or newer. So, creating new builds based on GTK3 could be a good start task for the new maintainer.
github-comments@lists.geany.org