#373 Avoid trouble with horizontal scrolling

closed-accepted
5
2012-08-21
2010-12-11
EdorFaus
No

I understand that Java currently makes it (practically) impossible to do horizontal scrolling properly, so this instead makes horizontal scrolling do nothing, instead of acting similar to a click, and thus messing with the caret position or worse (which I find quite annoying, and is hard to avoid on a touchpad).

The way it does this is by starting the mousePressed and mouseReleased handlers with a check for which mouse button was pressed/released, and if this was no button at all, simply returns instead of doing anything, just as if the events never occurred at all.

I haven't comrehensively tested or checked that this does not break anything, but it seems odd to me that anything should depend on mouse clicks with no button, and I haven't seen any side effects so far.

Related

Patches: #505

Discussion

  • EdorFaus

    EdorFaus - 2010-12-11

    Patch to ignore horizontal scrolling events

     
    Attachments
  • Matthieu Casanova

    • status: open --> pending
     
  • Matthieu Casanova

    Could you give an example ?

     
  • EdorFaus

    EdorFaus - 2011-10-19

    Well, I use two-finger scrolling on my touchpad, and have both vertical (up-down) and horizontal (left-right) scrolling enabled, in part because my screen is fairly small. This works quite well in most programs, even if there's no sideways scrolling available, vertical scrolling works just fine.

    However, in jEdit without this patch, when I have a long document open and scroll vertically, it also reacts to the slight horizontal scrolling that is hard to avoid (moving two fingers perfectly for vertical scrolling is difficult, especially if the touchpad isn't quite aligned with my hand). When this happens, jEdit acts basically as if I had clicked the left mouse button, moving the caret to a new position in the buffer and clearing the selection. This quickly gets to be annoying.

    As mentioned, the patch fixes this behaviour, making jEdit ignore the horizontal scroll events. I've been using jEdit with the patch since I first added it here, and haven't noticed any side effects. (In fact, I had pretty much forgotten all about it until your comment...)

     
  • EdorFaus

    EdorFaus - 2012-02-14

    I recently switched distro, and hence reinstalled jEdit, now version 4.5 - and found that this problem still exists. The slightest horizontal scrolling is still treated as if I clicked a mouse button in that location.

    So, I checked out the 4.5.x branch from svn (help/about now identifies it as 4.5.1), applied the attached patch (it still applies cleanly), and built it - and the behaviour was fixed again.

    It's a rather simple patch, really - do you have any specific objections to it that I might address? Or other reasons not to include it?

     
  • EdorFaus

    EdorFaus - 2012-02-14
    • status: pending --> open
     
  • Alan Ezust

    Alan Ezust - 2012-08-21
    • status: open --> closed-accepted
     
  • Alan Ezust

    Alan Ezust - 2012-08-21

    Committed 22038.

     
  • Alan Ezust

    Alan Ezust - 2012-08-21
    • assigned_to: nobody --> ezust
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks