geany icon indicating copy to clipboard operation
geany copied to clipboard

geany loses ability to middle click copy/paste

Open lllars opened this issue 4 years ago • 22 comments

This is running under Sway, testing with Wayland native apps only (no xwayland).

When I first open a file in Geany, I can copy out of Geany and paste into another program by selecting and then middle clicking in the usual way. I can do that multiple times with different selections. If I then select something ("foo" for example) in the other program, I can middle click paste it into Geany. I can do this with multiple selections as well. All OK so far.

At this point if I select something in Geany ("bar" for example), I can no longer middle click paste it outside of Geany. I just get "foo" instead, even if I make sure to unselect "foo" in the other app before selecting "bar" in Geany. Middle click copy/paste within Geany works fine still. It also works fine within and between non-Geany applications. It is as if Geany is now using a different primary buffer than everything else.

Opening a new file in Geany (or closing and reopening an existing one) gets things working again temporarily.

I've tested this with Geany 1.36 and also the latest Master branch. I also tried applying the patch from here, but saw no difference: https://sourceforge.net/p/scintilla/bugs/2127/

I have mainly been using kitty (0.18.3) and firefox (78.3.0 esr) as the other applications. Sway is version 1.5-3. This is on Debian Bullseye. I also briefly tried to check if SciTe exhibits the same behavior, but middle click copy paste did not work at all there (at least to other programs, not sure if it worked within SciTe).

lllars avatar Oct 17 '20 15:10 lllars

WFM selecting and middle pasting between here (in Chrome 86) and Geany 1.37 on Linux Mint 20.

elextr avatar Oct 17 '20 21:10 elextr

Can you clarify if you are running Sway, and if not then Wayland or X11? I'm asking because surely this bug is Wayland related.

lllars avatar Oct 18 '20 19:10 lllars

Sorry I wasn't clear, pointing out it works fine with X11 and Cinnamon, so as you say its likely something to do with Sway and its implementation of the Wayland protocols around clipboards (or the protocols themselves might be flakey, but then all WMs would have the bug).

Here middle click and paste works in Scite 4.3.0 (the one in the distros repo), thats a newer Scintilla than Geany 1.36/7 but IIRC there have not been any major changes to the GTK backend.

AFAIK none of the Geany devs use Wayland based systems or sway, so we can't give you much guidance, other contributors might.

If possible you could try a different WM, like Gnome and see if the problem still exists.

elextr avatar Oct 18 '20 22:10 elextr

I can confirm this problem with Sway. Selected text can be only pasted within Geany. It doesn't even work with other Wayland native softwares, like Alacritty. A bug is already opened on Alacritty side : https://github.com/alacritty/alacritty/issues/3592

The same bug also applies with XWayland apps. For now, the only trick is to specify GDK_BACKEND=x11 before launching Geany. Needless to say it is quite unpractical.

Ypnose avatar Nov 05 '20 08:11 Ypnose

For now, the only trick is to specify GDK_BACKEND=x11 before launching Geany. Needless to say it is quite unpractical.

Would appear to be a problem with GTK then since GDK is its lower level portable layer.

elextr avatar Nov 05 '20 08:11 elextr

I think this is a Scintilla issue https://sourceforge.net/p/scintilla/bugs/2227/.

cjmayo avatar Jan 05 '21 19:01 cjmayo

Same issue for me in Debian testing. I saw that the Scintilla issue was fixed today. I just fear that it may be too late for the next Debian stable :-)

claudep avatar Apr 28 '21 15:04 claudep

Since the change (won't say fix until performance is checked) was made to Scintilla 5 which is still unstable, and is not backward compatible with Scintilla 3 as currently used by Geany, the changes required make it possible (but not guaranteed) that it will be in the long term stable after that (Bullseye was frozen last month IIUC so it won't make that, but it possibly will make the average year gap to the next stable opening) if Scintilla 5 stabilised and then "somebody" contributes the Geany change to Version 5.

elextr avatar Apr 28 '21 22:04 elextr

Would backporting to Scintilla 3 code an option?

claudep avatar Apr 29 '21 06:04 claudep

I don't know what the fix was, or if it would backport, someone would have to try it.

elextr avatar Apr 29 '21 06:04 elextr

Here's the fix: https://sourceforge.net/p/scintilla/code/ci/921cb3dea3112a

claudep avatar Apr 29 '21 06:04 claudep

This is solved by https://github.com/geany/geany/pull/2867 It can be closed with the next release with this commit.

getzze avatar Nov 03 '21 19:11 getzze

Can a sway user confirm its fixed with current Geany git?

elextr avatar Nov 03 '21 21:11 elextr

Had the same issue on Gnome Wayland with Geany 1.38. I can confirm it's fixed in current git. Thanks!

tom--k avatar Dec 01 '21 17:12 tom--k

ubuntu 22.04 gnome 42 wayland This issue comes again, write code is very hard without primary clipboard. I need geany.

eexpress avatar Apr 07 '22 02:04 eexpress

@eexpress confirm you are using the latest Geany from git, not the version in Ubuntu?

elextr avatar Apr 07 '22 03:04 elextr

OK, I had build from git, and installed.

The plug-in uses the in the distribution repository, and then overwrites the geany with the git version. It's normal now. It's just that it's inconvenient to select / paste in current file. You can't click before pasting. Once you click, the selected text will disappear.

eexpress avatar Apr 08 '22 10:04 eexpress

Regarding the issue with loosing the selected text for paste on click, I had described a similar behavior here https://sourceforge.net/p/scintilla/bugs/2287/#df46/1070 where you can paste the selected text only once.

You might comment on the mentioned Scintilla bug report or open a new one to get the behavior changed.

eht16 avatar Apr 09 '22 17:04 eht16