This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219271 - Dragging and dropping the editor`s scroll bar returns me back to the cursor point in win7 ultimate 64-bit
Summary: Dragging and dropping the editor`s scroll bar returns me back to the cursor p...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.3
Hardware: Other Windows 7 x64
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 14:16 UTC by alix
Modified: 2013-01-18 21:32 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
drag & drop scroll bar turning back demonstration (2.84 MB, application/octet-stream)
2012-11-24 22:04 UTC, alix
Details
nb tracing log (49.94 KB, application/octet-stream)
2012-11-27 13:47 UTC, alix
Details
messages.log (85.13 KB, text/plain)
2012-11-28 18:04 UTC, alix
Details
finest+selection and scroll (78.13 KB, text/plain)
2012-12-05 12:31 UTC, alix
Details
Replacement core jar (229.35 KB, application/octet-stream)
2012-12-06 11:47 UTC, Miloslav Metelka
Details
TimableEventQueue logs (79.63 KB, application/octet-stream)
2012-12-07 12:28 UTC, alix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alix 2012-10-01 14:16:33 UTC
Hi
Using NB7.1.1 and continuously using NB7.2
In the editor when I drag and drop the scroll bar it returns me to the place of cursor, whether vertically or horizontally.
I found nothing about this scroll bar behavior in Tools>Options
Also there was not any related instruction in Help>Help Contents
On netbeans.org I tried to find "drag drop scroll bar" in bugs and reports but nothing
My OS is Win7 Ultimate 64-bit

If there is a configuration for NB options and I omitted it please pardon me.
And if it is a bug thank you so much for consideration.
Comment 1 Jiri Prox 2012-10-08 11:57:47 UTC
I cannot reproduce the problem. Can you please attach video or screen cast to demonstrate the problem?

Did you install any additional plugin?

Thanks
Comment 2 alix 2012-11-24 22:04:03 UTC
Created attachment 128348 [details]
drag & drop scroll bar turning back demonstration

Hi

This video demonstrates how the scroll bar will turn back after a drag-&-drop on 7.3 Beta2 on win7 64-bit
It has been repeated through NB7.1 or older to now 7.3Beta2.

Excuse me for late answer
I couldn't upload file successfully for a long while. The extreme-low internet speed is a normal issue here in my country.
Pray for me to be patient and save myself(at least myself) tnx


Sincerely thank you so much for being in this golden project (NB)
Comment 3 alix 2012-11-25 01:03:07 UTC
No plugin was installed in NB 7.3 Beta2 when this bug repeats

Previously, NB 7.1.1 and 7.2 and some plugins had been installed and I installed 7.3B2 without importing any plugin but settings were imported.
And the scroll bar repeated the drop-turn back behavior.

So I got a setting backup and uninstalled them(all 3 versions) completely (including user files).
I installed NB 7.3 Beta2.
Next without any plugin and without importing settings backup,
I opened my project and some files but again, dragging & dropping scroll bar caused turning back.

Already, Using VMWare Workstation, I have a ready winXp virtual machine so I installed NB 7.3 B2 in it
I guessed it may be a problem with Dell systems :D don't laugh ;)
But dropping scroll bar has no problem on this XP santa claus SP1
I'll try 7.3 B2 in a win7 virtual machine. Ok another windows installing I need tomorrow Bye ... it's 4:30 AM zzzz...


AND THE PREVIOUS ATTACHMENT was an AVI Video recorded by teachsmith camtasia
Comment 4 Miloslav Metelka 2012-11-26 15:53:28 UTC
Setting to P2 since there is no data loss.
It looks like some code calls caret.setDot() during the scroll. Please run the IDE again with

-J-Dorg.netbeans.editor.BaseCaret.level=FINE

(possibly see http://wiki.netbeans.org/FaqStartupParameters or http://wiki.netbeans.org/FaqNetbeansConf) and reproduce the problem. Then please attach the resulting messages.log to this issue (possibly see http://wiki.netbeans.org/FaqLogMessagesFile). Thanks.
Comment 5 alix 2012-11-27 13:47:27 UTC
Created attachment 128458 [details]
nb tracing log

I had a problem after booting the VM from win7 bootable hdd drv (\. was inaccessible). I didn't have Win7 DVD

I entered below parameter as you said and the messages.log is attached.

netbeans -J-Dorg.netbeans.editor.BaseCaret.level=FINE

I kept cursor in line 18

Scroll actions were :
1. one drag and drop vertically in this manner that curser was blinking in editor screen so scroll didn't turn back.
2. vertical drag and drop caused cursor out of editor screen (turn back)
3. horizontal drag and drop caused cursor out of screen (turn back)

I don't know but it seems BaseCaret.setDot is in log during scroll as you said.
FINE [org.netbeans.editor.BaseCaret]: setDot: offset=323
FINE [org.netbeans.editor.BaseCaret]: updateCaretBounds: old=java.awt.Rectangle[x=0,y=255,width=2,height=15], new=java.awt.Rectangle[x=0,y=255,width=2,height=15], offset=323
FINE [org.netbeans.editor.BaseCaret]: updateCaretBounds: no change, old=java.awt.Rectangle[x=0,y=255,width=2,height=15]

Thank you a lot
Comment 6 Miloslav Metelka 2012-11-28 16:12:03 UTC
Apologies it should be FINEST level instead of FINE i.e.

netbeans -J-Dorg.netbeans.editor.BaseCaret.level=FINEST

Could you please re-run it? Thanks.
Comment 7 alix 2012-11-28 18:04:04 UTC
Created attachment 128528 [details]
messages.log

Hi

Apologies? I know, the testing series is a certain issue in every debugging cycle. Don't matter. ;)

As a user of netbeans, I'm happy to be a tiny help in this cycle
Comment 8 Miloslav Metelka 2012-12-04 12:45:14 UTC
It looks the problem occurs because a CopyAction is called (for an empty selection) attempts to copy a single line (containing the caret) into clipboard. I guess that the CopyAction gets called due to a drag being initiated. Although it should not be initiated when just dragging the scroll knob it probably is and we should attempt to avoid single line copying which in turn causes the scroll-to-caret (e.g. by checking that the drag started).
To verify the hypothesis could you please first select e.g. a word and then try to reproduce the problem? I expect that the scroll-to-caret should not occur with the selection.
Thanks.
Comment 9 alix 2012-12-05 12:31:13 UTC
Created attachment 128888 [details]
finest+selection and scroll

Yessss exactly, no problem with scroll bar when a word or even multiple lines are selected.
You said a CopyAction
I don't know, this may be not relative but with NB<=7.2 when we were selecting a character or line by dragging cursor, the selected area had being copied. However that problem is resolved in 7.3B2

+Msgs.log

Tnx
Comment 10 Miloslav Metelka 2012-12-06 11:46:13 UTC
In the meantime I've researched TransferHandler instances (used by D&D) and found out that JTextComponent.DefaultTransferHandler does not delegate to an action named by DefaultEditorKit.copyAction as I thought originally (it uses its own code to copy the text).
Therefore it looks like there's some key that actually triggers the copy action which is a bit of magic to me ;-)

 Anyway I've patched TimableEventQueue (attached) so that it dumps all KeyEvent instances and I need you to:
1) Shutdown NB if it's currently running. Locate "org-netbeans-core.jar" in your NB installation (it should be in netbeans/platform/modules) and move it into some temp folder outside of NB installation.
2) Unpack org-netbeans-core.jar (packed in the attached core-packed.zip) in place of the original jar.
4) When you now run NB and press a key you should see additional messages like this in the log file:

INFO [org.netbeans.core.TimableEventQueue]: KeyEvent dispatched: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=65,keyText=A,keyChar='a',keyLocation=KEY_LOCATION_STANDARD,rawCode=38,primaryLevelUnicode=97,scancode=0] on NbMainWindow

If not please shutdown the IDE then locate NB userdir and delete $userdir/var/cache folder and start the IDE. It should start to dump the additional messages.

5) Now please reproduce the problem (without any editor selection) and attach the resulting log file. Thanks.
Comment 11 Miloslav Metelka 2012-12-06 11:47:17 UTC
Created attachment 128953 [details]
Replacement core jar
Comment 12 alix 2012-12-07 12:28:15 UTC
Created attachment 129040 [details]
TimableEventQueue logs

The core.jar has been replaced in "\NetBeans 7.3 Beta 2\platform\modules"
Then the problem has been reproduced by running NB with FINEST param

First I had a problem
What I was seeing in the cmd line was like an input loop (like C++) or an input time interval causing output msgs by cursor blinking.
but as you advised, it resolved by removing cache

INFO [org.netbeans.core.TimableEventQueue]: KeyEvent dispatched: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=10,keyText=Enter,keyChar=Enter,keyLocation=KEY_LOCATION_NUMPAD,rawCode=13,primaryLevelUnicode=13,scancode=28,extendedKeyCode=0xa] on NbMainWindow


Note that : NB was on JRE v6u1
From now, the tests will be on JRE v7u9 (if other special module tests be essential)

Thanks
Comment 13 Miloslav Metelka 2013-01-08 16:49:58 UTC
There's something on your system that sends regular "Ctrl+Insert" key events to the java app:

INFO [org.netbeans.core.TimableEventQueue]: KeyEvent dispatched: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=17,keyText=Ctrl,keyChar=Undefined keyChar,modifiers=Ctrl,extModifiers=Ctrl,keyLocation=KEY_LOCATION_LEFT,rawCode=17,primaryLevelUnicode=0,scancode=29,extendedKeyCode=0x11] on NbMainWindow
INFO [org.netbeans.core.TimableEventQueue]: KeyEvent dispatched: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=155,keyText=Insert,keyChar=Undefined keyChar,modifiers=Ctrl,extModifiers=Ctrl,keyLocation=KEY_LOCATION_NUMPAD,rawCode=45,primaryLevelUnicode=0,scancode=82,extendedKeyCode=0x9b] on NbMainWindow


 Don't you have any resident program that would e.g. translate some mouse gestures to a series of keystrokes?
 The key events obviously arrive so practically I can't do anything in NB code to treat them specially somehow. Anyway if you don't succeed finding the program on your system that sends the key events I've made a command-line option that you can add to netbeans.conf that disables single-line copy when no selection is present which should resolve the problem:

-J-Dorg.netbeans.editor.disable.no.selection.copy=true

http://hg.netbeans.org/jet-main/rev/c59455c02796
Comment 14 Quality Engineering 2013-01-10 03:30:59 UTC
Integrated into 'main-golden', will be available in build *201301100107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c59455c02796
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #219271 - Dragging and dropping the editor`s scroll bar returns me back to the cursor point in win7 ultimate 64-bit.
Comment 15 alix 2013-01-18 21:32:17 UTC
Yes exactly
It is Babylon 8 running on startup by default and grabbing mouse clicks on screen for translation like to an OCR.
My settings was <Ctrl+Middle Mouse Button>.
When you said a resident program that sends keystrokes by mouse click I suspected to it.
So by closing it the problem has been resolved.

Thank you very very very much

To test whether this problem occurs just in this situation of my win7 I installed Babylon on a win XP virtual machine and again when Babylon is running , this problem occurs again on XP.
A lot of people are using this popular dictionary.
This can be released as a notice for windows users to close programs like Babylon for similar problems.
Application conflicts like this are very vague to inspect.

Thank you a lot.