Closed
Bug 149079
Opened 23 years ago
Closed 23 years ago
Mouse shortcut for copy doesn't work correctly
Categories
(Core :: DOM: Selection, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: Sebastian.Wittmeier, Assigned: mkaply)
Details
Attachments
(1 file, 5 obsolete files)
|
3.79 KB,
patch
|
jhpedemonte
:
review+
mkaply
:
superreview+
asa
:
approval1.3+
|
Details | Diff | Splinter Review |
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
| Assignee | ||
Comment 1•23 years ago
|
||
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
| Reporter | ||
Comment 2•23 years ago
|
||
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?
| Assignee | ||
Comment 3•23 years ago
|
||
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.
| Reporter | ||
Comment 4•23 years ago
|
||
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.
| Reporter | ||
Comment 5•23 years ago
|
||
I've downloaded the source code.
I hope the attached changes would be a approach to solve the problem.
| Assignee | ||
Comment 6•23 years ago
|
||
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.
| Reporter | ||
Comment 7•23 years ago
|
||
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)
| Reporter | ||
Comment 8•23 years ago
|
||
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)
| Reporter | ||
Comment 9•23 years ago
|
||
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
| Assignee | ||
Comment 10•23 years ago
|
||
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.
| Reporter | ||
Comment 11•23 years ago
|
||
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
| Assignee | ||
Comment 12•23 years ago
|
||
I figured out how to make this happen in OS/2 specific code.
| Reporter | ||
Comment 13•23 years ago
|
||
seems to work now (rev. 1.1).
Sebastian
| Assignee | ||
Comment 14•23 years ago
|
||
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
Comment 15•23 years ago
|
||
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..
| Assignee | ||
Comment 16•23 years ago
|
||
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.
| Reporter | ||
Comment 17•23 years ago
|
||
>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
| Assignee | ||
Comment 18•23 years ago
|
||
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.
| Assignee | ||
Comment 19•23 years ago
|
||
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
| Assignee | ||
Comment 20•23 years ago
|
||
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
| Assignee | ||
Updated•23 years ago
|
Attachment #114488 -
Flags: review?(pedemont)
Updated•23 years ago
|
Attachment #114488 -
Flags: review?(pedemont) → review+
| Assignee | ||
Comment 21•23 years ago
|
||
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 22•23 years ago
|
||
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+
| Assignee | ||
Comment 23•23 years ago
|
||
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.
Description
•