<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020 at 12:26 PM <<a href="mailto:elektra@markus-raab.org" target="_blank">elektra@markus-raab.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
A reference implementation sounds like a good next step<br></blockquote><div><br></div><div>I found the time to change one of the gtk3 widgets (gtkentry) to behave like I suggested earlier.</div><div>The widget supports paste-over-selection maneuvers using the mouse alone. </div><div>I didn't change any paradigma or workflow. I just specified a little sharper, how primary selection </div><div>mark and paste via mouse should work.</div><div><br></div><div>Here's a video of it:</div><div><a href="https://www.youtube.com/watch?v=iPROlvo3S0c">https://www.youtube.com/watch?v=iPROlvo3S0c</a></div><div><br></div><div>Here's how the widget in the video behaves; most of it is already specified and/or practical canon:</div><div><br></div><div> 1. We have to distinguish 'visually selected text' and the (wayland-/X11-) 'primary selection'. </div><div> The former is a widget's currently visible text selection, </div><div> the latter is the text that a window receives, when it asks for the current primary selection.</div><div> The primary selection returns the last visually selected text, it persists if text is unselected,</div><div> it is updated if different text is selected.</div><div><br></div><div> 2. Update of the visual selection happens only on left mouse button press or drag events.</div><div><br></div><div> 3. Update of the primary selection only happens on left mouse button release events.</div><div> (.. except for a little special rule for triple click below)</div><div><br></div><div> 4. Pasting the primary selection should happen on middle mouse press events.</div><div><br></div><div> 4a. Middle mouse click on a visual text selection replaces the text selection with the primary selection (like ctrl-v does).</div><div><br></div><div> 4b. .. middle mouse click somewhere else just pastes the text to the cursor position nearest to the click</div><div><br></div><div>Special rules for double and triple clicks</div><div> 5: Double click on a word selects the word that was clicked on.</div><div> Like specified above, the visual selection is updated on the second button press; </div><div> only when the button is released, the visual selection will be made available as the primary selection.</div><div> 5a, Additionally, when the second click is released, the last primary selection is memorized in a separate buffer for .. </div><div><br></div><div> 6. Triple click in a line selects the whole line. Rules above apply, except that</div><div> 6a, The third registered mouse press restores the additionally memorized buffer from 5a. to the primary selection. </div><div> </div><div> (with 5a and 6a, middle click pasteover also works in the context of double and triple clicks without letting a timer run down)</div><div><br></div><div>I get that this seems very special to many. </div><div>Give it a try with a touchpad though. It really is convenient and useful.</div><div>Branch is here: <a href="https://github.com/thraen/gtk/tree/gtk-3-22--thr--primary-buffer-pasteover">https://github.com/thraen/gtk/tree/gtk-3-22--thr--primary-buffer-pasteover</a></div><div>(branched off of a version of gtk3+ that can be built with ubuntu 18 without much hassle.)</div><div><br></div><div>Since I've seen some positive feedback from the list: I'd be happy to help with implementations in this or that library.</div><div><br></div><div>At least, I'd suggest updating </div><div><br></div><div><a href="https://specifications.freedesktop.org/clipboards-spec/clipboards-latest.txt">https://specifications.freedesktop.org/clipboards-spec/clipboards-latest.txt</a>.</div><div><br></div><div>I think it should mention, that there is a way to do the middle click paste thing 'right'. </div><div>May I ask, who would have the power of changing this document and whether there is some willingness to change it?</div><div><br></div><div>VG, Johannes</div><div><br></div><div><br></div></div></div></div></div>