Emacs: mouse wheel scroll preserve buffer position - emacs

How to enforce preserving buffer position while scrolling with mouse wheel?
Currently if I scroll for amount that buffer cursor position should be out of the screen that position is changed. And I don't want this because it is not happening in other editors like Qt Creator, IntelliJ IDEA etc.
I would like to have some mouse-wheel-scroll-preserve-buffer-position.

You can't. The Emacs display engine doesn't allow this. See this question

BTW, while the position of point has to be on screen, that doesn't prevent an Elisp package from reverting point to what it was before the mouse-wheel scroll when you stop scrolling and hit the keyboard again.
So, Emacs doesn't support it right now, but it shouldn't be difficult to make it work if you really want to. Patches welcome to add such an optional behavior.

Related

Is there an option to disable drag & drop feature in LibreOffice Draw?

I faced an issue for using LibreOffice Draw.
I need to move images between grid points snapping to them.
But when I hold the images for more than 1 second, it automatically switched to free transform mode (drag & drop, also the mouse cursor would to be changed).
How can I prevent this?
If you move the image a bit after clicking on it, the mode will not switch. That's at least how it works here.
On windows you can simply do it by disabling this from settings but here you need to move the image for a second just after clicking on it. I think this is the only way to solve your issue.

Leaflet.markercluster keyboard resize mobile

I am using the super useful Leaflet.markercluster for leaflet which has been great for performance because of the nice getExpandedVisibleBounds feature.
One problem I am running into is on mobile devices with the keyboard changing the viewport/bounds. When I enter an input box and the keyboard pops up, it shrinks the map viewport. After the keyboard goes away the viewport/bounds don't seem to update for the markercluster. The map is fully visible again but markers that are on the lower half of the map (where the keyboard was) are now not visible. Panning the map and zooming in and out don't seem to fix it. After a minute or so of use it seems to correct itself and the markers and now visible on the whole viewport again.
Any suggestions on how to fix this issue? Thanks!

Pixelwise scrolling for LO/OO Writer

In LO/OO Writer vertical scrolling can be done e.g. by moving the text cursor up/down, using the mouse wheel, clicking the up/down arrows on the vertical scrolling bar, etc.
Touch scrolling (on touch screens) is not supported, unfortunately. Therefore I wrote a tool (in Autohotkey) which enables touch scrolling. It is working fine, but the scrolling is not as smooth as in other programs supporting touch scrolling: the content of the window is moved in steps of approx. one line.
In my tool I am using the best 'control' for scrolling I could find: touch point movements are remapped to clicks on the up/down arrows on the vertical scrolling bar.
MY QUESTION: Is there (could there be) another 'control' in LO/OO Writer which would allow smoother (pixelwise) scrolling of the displayed content?
Thank you very much in advance for your answers! (Please only answers referring to LO/OO Writer.)
Clicking and dragging the scrollbar allows higher granularity than the up/down arrows. The scroll amount adjusts if the document is zoomed in.
On the downside, using the scrollbar is much more difficult than a simple click on the arrows. There is a discussion at https://autohotkey.com/board/topic/51041-click-drag-scrollbars/.
If it is a touch screen, perhaps you could require the user to touch the scrollbar, so the touch location would give the vertical position of the scrollbar. Then use MouseClickDrag starting from that position.

X11 restrict mouse to visible area

I am currently running Linux Mint 17.2 with Cinnamon. I have 2 monitors.
When I set monitors to be adjacent in Cinnamon settings, mouse freely moves through border shared between monitors but cannot escape visible area.
That is, if I set monitors to share only corner, mouse is effectively locked to current monitor and can escape to another only through corner.
However, setting monitors to be non-adjacent allows mouse to roam freely all over virtual framebuffer, including invisible areas.
I thought that Cinnamon sets some flag that controls this behavior, but changing monitor position using xrandr has the same effect.
Also, it is the same when I start plain Xorg with nothing but xterm, even without a window manager, and configure monitors using xrandr.
What exactly stops mouse from leaving visible area when all monitors are adjacent? Is there a way to override this behavior?
Being able to control this might be useful e.g. to stop mouse from leaving monitor every time you try to click something near border, without running a busy loop that monitors mouse and moves it back if needed (and without doubling framebuffer size by making monitors be adjacent by corner).
With more control it can be used to e.g. make mouse "reluctant" to leave current window, and maybe do other fun stuff. At least it will make it possible to reimplement this thing so that it can actually lock mouse to window for apps like Chrome browser or OpenGL games and not just xterm and the like.
Now that I think of it, I may even try to implement it, if it is not yet and if I find relevant code.
Okay, I have found the relevant code.
This behavior is hardcoded in Xorg X server, in RandR extension, including visible area continuity check.
Definitely nothing configurable. Well, unless you agree with creator of dwm on what the word "configuration" means :)
I do agree. Right now relevant code locations are randr/rrpointer.c and
randr/rrcrtc.c:332,1685.
Would be nice though if someone created a proper X srver extension for that.
As you already figured out: if your monitor areas are non-continuous, it seems that xrandr will allow the entire x11-screen to be used by the pointer. I just purposefully moved the position of one by 1 pixel (option --pos with xrandr) to free the mouse.
Once the mouse can go everywhere, it should be possible to fence it in with pointer barriers:
http://who-t.blogspot.com/2012/12/whats-new-in-xi-23-pointer-barrier.html
That requires the XFixes extention version 5+ and gets enhanced with XInput as described in the link with events and temporary barrier lifts... which is probably not required here.

How to change cursor style in android?

I have different views on my activity. I wanna change my cursor style when cursor is move to any view. How to do same in android.For example there is a normal cursor on the android activity when cursor moves to a button i wanna change cursor style normal to finger style.
The only cursor I know about in Android is used alongside SQLite databases. Seeing as Android phones/tablets are all touchscreen... there is no 'mouse' cursor, except in the emulator.
Of course, you could draw a cursor that followed finger movement, but I can't think of a lot of reasons you'd want do that in a standard UI.
actually there is a mouse cursor in Android 3.0 and later. The only way to see it is to connect a bluetooth mouse to the device and youll see the cursor once you move the mouse around. The only reason I found this site was because I wanted to change the cursor color so sorry I cant help you with that one.