Closed Bug 149079 Opened 23 years ago Closed 23 years ago

Mouse shortcut for copy doesn't work correctly

Categories

(Core :: DOM: Selection, defect)

x86
OS/2
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Sebastian.Wittmeier, Assigned: mkaply)

Details

Attachments

(1 file, 5 obsolete files)

When I want to copy some text with the mouse shortcut, Mozilla pastes the text instead (entry fields) or does nothing (static text). Normal behaviour would be: Copy: Mark some text with left mouse button, press right button before releasing left one Paste: press right button, and before releasing it, press left button on insert position
I can't make copy work, but I can make the paste motion not execute a copy.
Assignee: mjudge → mkaply
Status: UNCONFIRMED → NEW
Ever confirmed: true
It was the other way round. Mozilla always did a paste. It looks like their is only one handler for pressing both mouse buttons. Can it be changed to always copy?
I can't make it copy at all. The code currently turns WM_CHORD into a mousebutton3 which in the Mozilla world is a paste. So what is happening is that any chord (regardless of which button happens first) executes a paste. The ONLY function I can have a chord map to is paste. There is no programmatic way to tell Mozilla to do a copy. So my solution to this problem would be to prevent the copy chord from executing a paste which it does today.
Just read through some similar bugs in Bugzilla. The Unix people need a similar feature with primary selections and X cut buffers. Perhaps that could be enabled as a workaround.
I've downloaded the source code. I hope the attached changes would be a approach to solve the problem.
Did you test the fix? You can do this yourself. Find the proper file in one of the .jar files in chrome directory. Unzip the .jar. Modify the file. Rezip the jar. You can test immediately.
Attached file new patch (working) (obsolete) —
nice, and a javascript console for testing the first version did not work (of course *g*) until now only static text gets copied (I can't obsolete the previous attachment, also I created it)
Attached file new patch (working) (obsolete) —
nice, and a javascript console for testing the first version did not work (of course *g*) until now only static text gets copied (I can't obsolete the previous attachment, although I created it)
Attached patch debugged patch as diff file (obsolete) — Splinter Review
The patch only works with static text For entry fields mozilla\editor\libeditor\text\nsEditorEventListeners.cpp has to be edited. Would you review the attached file so that it can be included in the official distribution? Sebastian
The problem is that you have added functionality for everyone that should only be for Os/2 clients. Unless this problem can be fixed in OS/2 specific files, it will never go out as part of the general Mozilla distribution.
Hi, I don't think that feature has any disadvantages How can I query the current operating system? Or should that be solved by some new preference setting, that can be activated only in the OS/2 prefs.js Sebastian
Attached patch OS/2 specific patch (obsolete) — Splinter Review
I figured out how to make this happen in OS/2 specific code.
seems to work now (rev. 1.1). Sebastian
This only works in 1.1 - I haven't checked it in. Alecf, do you have any idea on a better way to do this? It's pretty ugly. Thanks
QA Contact: pmac → mkaply
the paste thing is pref-based, no? I would introduce a new value for the pref, and then fix the XP code such that it honors this new value.... mainly I think this patch is ugly because its using windowWatcher and its techincally sending the wrong event..
Detection for this mouse action doesn't exist at the XP level. Basically for OS/2 cut and paste behavior, we need to know which mouse button went down first and then we need to invoke copy/paste based on that. This was the only way I found to tell Mozilla to do a copy or paste from widget.
>Basically for OS/2 cut and paste behavior, we need to know which mouse button went down first and then we need to invoke copy/paste based on that. To be exact that's not the real OS/2 behaviour. OS/2 does a copy, when you are just selecting text and have not released the left mouse button. OS/2 does a paste in every other case. OS/2 has only one WM_CHORD regardless which button was pressed first. I hope an easier implementation gets possible now. Sebastian
That's not entirely correct. There are two actions that paste - the WM_CHORD (pressing both mouse button simultaneously) as well as pressing the right and then the left (which is not technically a chord) The copy action only happens if you select with the left mouse button and then press the right mouse button with the left button still held down.
for my info after brade's changes land. change these lines: + webShell = do_QueryInterface(docShell); + if (!webShell) { + break; + } + clipCmds = do_QueryInterface(webShell); + if (!clipCmds) { + break;to instead be something like this: nsCOMPTr<nsICommandManager> cmdmgr = do_GetInterface(docShell); if (!cmdmgr) break; cmdmgr->DoCommand("cmd_copy", nsnull); or cmdmgr->DoCommand("cmd_paste", nsnull); depending when my api change lands, you may need to add another nsnull param to the DoCommand calls
Attached patch Good fixSplinter Review
I can't believe I never thought of doing this. This is easy. I emulate the NS_KEY events when I get the mouse actions. Done.
Attachment #86462 - Attachment is obsolete: true
Attachment #86467 - Attachment is obsolete: true
Attachment #86468 - Attachment is obsolete: true
Attachment #88542 - Attachment is obsolete: true
Attachment #91156 - Attachment is obsolete: true
Attachment #114488 - Flags: review?(pedemont)
Attachment #114488 - Flags: review?(pedemont) → review+
Comment on attachment 114488 [details] [diff] [review] Good fix sr=blizzard (platform specific code) This is OS/2 specific code, totally low risk. I'd like this for 1.3 because this is a feature many OS/2 users have requested.
Attachment #114488 - Flags: superreview+
Attachment #114488 - Flags: approval1.3?
Comment on attachment 114488 [details] [diff] [review] Good fix a=asa (on behalf of drivers) for checkin to 1.3
Attachment #114488 - Flags: approval1.3? → approval1.3+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: