Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tomay3000 on September 21, 2019, 08:26:03 pm

Title: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: tomay3000 on September 21, 2019, 08:26:03 pm
Hello,
It happens many times, when scrolling with the mouse wheel in the editor and some data has been copied to the clipboard, then this data will be pasted while scrolling at the current position, and I wont notice it unless I get compiler errors.

This is becoming very annoying, because it happens that the clipboard content data may be pasted in a comment and this wont be notices at all.

Any body please confirm this problem if it is really happening and has been fixed (maybe) in the svn versions after this one!

TIA.
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: Miguel Gimenez on September 21, 2019, 08:51:31 pm
Do you have the MouseSap plugin enabled? It adds pasting with middle button to the editor, so if you press the wheel when turning it you will get what you describe.
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: tomay3000 on September 21, 2019, 09:59:46 pm
Do you have the MouseSap plugin enabled? It adds pasting with middle button to the editor, so if you press the wheel when turning it you will get what you describe.
I believe YES.

So MouseSap plugin is my nightmare :(
I thought for a moment that it something related to scintilla.

I have disabled it for now.
Thank you.

EDIT: After disabling it and even Uninstalling it, the middle-mouse click still working :(
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 22, 2019, 01:48:19 am
Do you click on the scroll wheel while scrolling in the first place?
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: tomay3000 on September 22, 2019, 02:01:48 am
Do you click on the scroll wheel while scrolling in the first place?
Quite possible, because I can't feel my index finger while doing it or hear the TICK sound.
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 22, 2019, 02:10:03 pm
Do you see text pasted if you deliberately click the scroll wheel?
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: tomay3000 on September 22, 2019, 08:20:35 pm
Do you see text pasted if you deliberately click the scroll wheel?
YES, sure.
But I fixed the problem, by going to "Settings" -> "Editor..." -> "Mouse Drag Scrolling" -> "Mouse Key To Use" -> Set to "Middle" instead of "Right".

Apparently I was accidentally clicking the wheel while scrolling.
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 22, 2019, 08:25:29 pm
This is from the drag scroll plugin.
OK, this was reported already, but I don't know what happened with this.
I guess it is still a problem... :(
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: tomay3000 on September 22, 2019, 08:32:10 pm
This is from the drag scroll plugin.
OK, this was reported already, but I don't know what happened with this.
I guess it is still a problem... :(
Do you mean that I just workaround it!?
Do you mean that I should also disable DragScroll plugin?
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 23, 2019, 12:58:36 am
I don't know, I have to investigate, but I don't have time now.
If someone is interested in this then go on. :)
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: Pecan on September 23, 2019, 06:22:37 pm
Pasting happens with the middle mouse click when any word is marked before the click. This happens with both the Nightly and all the way back to my oldest CB version svn10542. (Both Windows and Linux.)

This happens with no contrib plugins loaded.
It has nothing to do with BrowseTracker or DragScroll.

I quite like it.

The original poster was successful stopping the paste because DragScroll captured the middle mouse to use as the drag key.

I don't see a problem here.
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 23, 2019, 08:48:03 pm
I don't see a problem here.
For windows people it might seem unexpected. Do you know where in the source this pasting happens?
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: Pecan on September 24, 2019, 07:56:32 am
Do you know where in the source this pasting happens?

cbstyledtextctrl.cpp:116

I hope those of us who use this feature regularly will be able to keep it.
It's been in CB for a very long time.

Code

void cbStyledTextCtrl::OnMouseMiddleDown(wxMouseEvent& event)
{
    if (platform::gtk == false) // only if OnMouseMiddleDown is not already implemented by the OS
    {
        int pos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));

        if (pos == wxSCI_INVALID_POSITION)
            return;

        int start = GetSelectionStart();
        int end   = GetSelectionEnd();

        const wxString s = GetSelectedText();

        if (pos < GetCurrentPos())
        {
            start += s.length();
            end += s.length();
        }

        InsertText(pos, s);
        SetSelectionVoid(start, end);
    }
}
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: oBFusCATed on September 24, 2019, 07:45:02 pm
I think it should not be on by default on platforms which don't have it natively (on linux I use this feature all the time, but there it is sort of integrated in everything). I'm fine if it is an option you could enable.

But if we have this here, what is the purpose of the mousesap plugin? Doing copy on selection change? Isn't this a duplication of features? Shouldn't this be moved to the mouse-sap plugins (which btw fails to compile with wxgtk + gtk3 :( )
Title: Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
Post by: Pecan on September 25, 2019, 07:29:11 am
I'm fine if it is an option you could enable.
...
But if we have this here, what is the purpose of the mousesap plugin?

I'll look at it.