fastaddons / ScrollAnywhere

This repository is for tracking bugs and documentation only
Other
27 stars 1 forks source link

Thunderbird: Cannot position the cursor in the message compose window with the mouse #60

Open sphh opened 1 year ago

sphh commented 1 year ago

Describe the bug When I have ScrollAnywhere switched on in Thunderbird and then I compose a new email, I cannot position the text cursor with the mouse in the message input field.

Steps To Reproduce Steps to reproduce the behavior:

  1. Switch on ScrollAnywhere.
  2. Compose a new message.
  3. Write some text.
  4. Move the cursor with the arrow/home/end keys: That is working.
  5. Position the cursor with a single mouse left click: The cursor disappears.
  6. Double click on a word: The cursor appears again.

Expected behavior A single mouse click should position the cursor – and show it.

Device info:

Options Maybe it is just a configuration glitch, so here is my configuration

{"ADDITIONAL_SPEED":0,
 "ALLOW_OTHER_MOUSE_DOWN_HANDLERS":true,
 "AXIS_LOCK":0,
 "CONTEXT_MENU_UNBLOCK_DELAY":100,
 "CURSOR":"",
 "CURSOR_X":"",
 "CURSOR_Y":"",
 "DISABLED_DOMAINS":{},
 "DISABLED_HORIZONTAL_SCROLLING_DOMAINS":{},
 "DISABLED_URL":{},
 "DISABLE_ALT":false,
 "DISABLE_CONTEXT_MENU_ON_MOVE":false,
 "DISABLE_CTRL":false,
 "DISABLE_SHIFT":false,
 "DISABLE_TYPE":0,
 "DURATION_MULTIPLIER":1000,
 "DURATION_PLUS":0,
 "IS_DISABLED":true,
 "MAXIMUM_SPEED":0,
 "MOMENTUM":true,
 "MOMENTUM_FORMULA_TYPE":0,
 "MOMENTUM_MAX_SPEED":0,
 "MOMENTUM_STOP_DETECTION":50,
 "MOVING_DETECTION":7,
 "NO_CSS_EDIT":false,
 "NO_LINK_BLOCK":false,
 "OUTSIDE_AREA_WIDTH":0,
 "PASTE_WITH_MIDDLE":false,
 "PREVENT_BIG_JUMPS":false,
 "PREVENT_TEXT_SELECTION":false,
 "SCROLLBARS_BACKGROUND":"#f0f0f0",
 "SCROLLBARS_COLOR":"#cdcdcd",
 "SCROLLBARS_WIDTH":0,
 "SCROLL_ON_EDITABLE_HTML":true,
 "SCROLL_ON_LINKS":true,
 "SCROLL_ON_TEXT":true,
 "SCROLL_ON_TEXTAREA":true,
 "SCROLL_ON_TEXT_EDIT_WITH":0,
 "SCROLL_TYPE":1,
 "TOOLBAR_BUTTON_MAIN_SWITCH":true,
 "TREND_MOMENTUM_WINDOW":8,
 "__install_date":[18682,18682],
 "no_prevent_default":true,
 "reverse":false,
 "scroll_button_left":true,
 "scroll_button_middle":true,
 "scroll_button_right":false,
 "simple_ratio_multiplier":1
}
fastaddons commented 1 year ago

Hello, Scrolling with "Left" mouse button is still considered experimental. Try to disable that to see if it helps. Also, I see you have also "SCROLL_ON_TEXT" enabled, so clicking on empty place won't place cursor there, you need to first click on text to activate "editing mode".

As you can see, when using Left button to scroll, things can get pretty complicated. That's why it's best to use either middle or right button to scroll.

sphh commented 1 year ago

Hello, Scrolling with "Left" mouse button is still considered experimental. Try to disable that to see if it helps. Also, I see you have also "SCROLL_ON_TEXT" enabled, so clicking on empty place won't place cursor there, you need to first click on text to activate "editing mode".

I see. Most of the time I click into the space right of a line to position the cursor at the end. I now tried to click onto a word. Sometimes I have to way a bit for the cursor to show, but basically this works. Still I cannot place the cursor at the end of a line.

As you can see, when using Left button to scroll, things can get pretty complicated. That's why it's best to use either middle or right button to scroll.

Yes, I need the Left button to scroll, because I use this on a tablet with a pen. Touching the screen with it only generates a left click.

Would it be possible to add an option, which excludes the message compose area from being handled by ScrollAnywhere?

fastaddons commented 1 year ago

Excluding compose window does sound like a good workaround. Although a bit drastic... Let's brainstorm a bit, maybe allow it only on the right half of the screen, or maybe only right 25% of the screen. Or introduce some special option that would disable scrolling after single click - so one click would not place cursor, but second would?

It's been a while since I've worked on this addon, so I'm a bit rusty about how it works, especially the complex left scrolling.

sphh commented 1 year ago

I do not know anything about the internals of ScrollAnywhere and Thunderbird, but isn't it possible to set a flag, whenever the mouse was moved with the (left) button pressed. When the button is released and this flag is set, the flag is cleared and nothing will happen (mouse event cancelled there). If the flag is not set, the mouse event either bubbles up or (in the case of the left mouse button) the cursor is positioned. As I said, I have absolutely no idea how ScrollAnywhere and Thunderbird are processing the mouse events, so please forgive me, if that is nonsense. And I believe you have considered such an approach already!

fastaddons commented 1 year ago

It's not that complex, but it's pretty limited. These are the events that fire when you click with left button:

mousedown   which=1 button=0 buttons=1
mouseup     which=1 button=0 buttons=0
click       which=1 button=0 buttons=0

If I want to scroll the page, and not select text, I need to call "preventDefault" in the "mousedown" event (the first one). So when mouse button is down (being pressed), I need to decide whether I want to scroll, or whether I want to proceed with default action - which is placing cursor in the text. And I can't wait for the mouseup, I need to decide that moment what to do :). So I can check where the cursor is or some other things...

sphh commented 1 year ago

As I said, I do not know, how that feature is implemented. I also cannot check, because ScrollAnywhere is closed source …