Bug 116948 - Alt-Click in views not working under Linux
Summary: Alt-Click in views not working under Linux
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 150773 206503 478765 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-17 17:03 EST by A Kappen CLA
Modified: 2015-10-07 16:02 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description A Kappen CLA 2005-11-17 17:03:14 EST
Mylar 1.4.1 / Eclipse 3.2M3 - Linux GTK / gnome 2.10

When I Alt-Click on an element in package explorer (or any other mylar'd view),
nothng happens.  This should pop open the element and show all sub-elements
regardless of mylar "interest level".  This functionality works fine in Windows
installs.
Comment 1 Ian Bull CLA 2005-11-17 17:19:38 EST
I have experienced the same problem.  
Pressing the right-arrow button works, but this also scrolls the view
horizontally (which is quite distracting).

Comment 2 Mik Kersten CLA 2005-11-19 20:54:28 EST
I just changed from filtering on SWT.ALT to SWT.MOD3, which I hope resolves the issue.
 Ian, are you able to verify by synching and trying this in a runtime workspace?  (I'll
try to get a Linux test environment set up soon).
Comment 3 Ian Bull CLA 2005-11-20 20:17:24 EST
Still not working, but I don't think there is much we can do.  I forgot, under X, ALT-Click grabs the current window.  Should be able to see this in any application (if you hover over a button, and then alt-click).  A work around (for me at least) is to press the windows key and alt, (there are beside each other on my keyboard).  This seems to get sent as alt-click.

I am going to write a small SWT application and see exactly what we get.  

cheers,
ian
Comment 4 Mik Kersten CLA 2005-11-20 20:22:24 EST
Thanks for figuring that out!  The code that accepts the click is one line in: 
   BrowseFilteredListener.mouseInteractionAccepted(..)

So it may be just as easy to play with that rather than writing a seperate app.  I assume that most, but not all people will have the Windows key (e.g. ThinkPad users won't).  I wonder if we should accept both Alt and another combination?
Comment 5 Ian Bull CLA 2005-11-20 20:46:00 EST
I used the following small app, and it seems that when the alt-key is pressed, mouse events are not sent to the shell.  I think we need another option.

package swt_test;

import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SWT_Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Display display = new Display();
		
		Shell shell = new Shell( display );
		
		shell.addMouseListener( new MouseListener() {

			public void mouseDoubleClick(MouseEvent e) {
			}

			public void mouseDown(MouseEvent e) {
				System.out.println("Mouse Down Event");
			
			}

			public void mouseUp(MouseEvent e) {
				System.out.println("Mouse Up Event");
			}
			
		});
		shell.open();
		while ( !shell.isDisposed() ) {
			if ( !display.readAndDispatch())
				display.sleep();
		}
		display.dispose();

	}

}
Comment 6 Mik Kersten CLA 2005-11-20 20:49:44 EST
What about Ctrl+Alt or Ctrl+Shift+Alt?  Perhaps that prevents the window manager from grabbing the Alt mouse event?
Comment 7 Ian Bull CLA 2005-11-20 20:55:40 EST
Yep, those work (so does Windows Key + alt).  The problem is, ctrl and Shift are used for multiple selection, so they behaviour is really strange. If you already have an item selected, and you press Shift+alt, you get multiple selection and the expand.  I guess we could change that
Comment 8 Mik Kersten CLA 2005-11-20 20:57:37 EST
But Ctrl+Shift+Alt works fine, right?  
Comment 9 Ian Bull CLA 2005-11-20 21:12:08 EST
We get the mouse click when we hold shift+alt+ctrl, but like other cases, it just results in multiple selection (in Mylar).  It expands if it is the first shift+alt+ctrl click done.

Comment 10 Mik Kersten CLA 2005-11-20 21:42:00 EST
What if we made the UI for Linux be middle button click, no modifiers?  How do people simulate middle click on a laptop with only two buttons?
Comment 11 Ian Bull CLA 2005-11-20 22:04:40 EST
I know X-windows uses this for paste (it is not very common, but it still works), but I don't think anyone will be pasting in a view that supports this.

I think 3 buttons are emulated by pressing both buttons.  This currently selects a node and brings up the context menu.

Comment 12 Mik Kersten CLA 2005-11-21 11:41:45 EST
Duh, of course, I forgot about paste (wow, it's been a while since I used Linux for my desktop, but I still have hope of of going back someday).  So we can't use that because resources and Java elements can be pasted. 
Comment 13 Ian Bull CLA 2005-11-21 11:55:36 EST
I think it just pastes text, but I could be wrong (eclipse also support ctrl-c, ctrl-v, so I use those).  I will check this today.  If it just pastes text, then we may be ok.

What about a context menu option to show all descendents?  (maybe you have one).

Comment 14 Mik Kersten CLA 2005-11-21 11:58:02 EST
We used to have this, but it was just too slow to use.  I think that this needs to be one click (and one keyboard shortcut) and not two.
Comment 15 Mik Kersten CLA 2005-11-21 12:09:35 EST
Hmmm, I don't see the "scroll to the right" behavior with the arrow key.  If my view has a horizontal scrollbar this still works as it would with Alt-click and doesn't cause wierd scrolling.  Could you describe it in more detail?
Comment 16 Mik Kersten CLA 2005-11-21 12:11:25 EST
Btw, I just checked it and it turns out that ESC doesn't work as a mouse modifier so that's out. 
Comment 17 Mik Kersten CLA 2005-12-16 17:48:14 EST
So there seems to be no good solution for this since all the modifiers are taen, just two work-arounds:
- click, then right arrow, repeat (instead of alt-click repeat)
- use the Windows modifier key to alt-click

I'm marking this for LATER in case any ideas for improving on this come up.
Comment 18 Mik Kersten CLA 2006-07-28 15:49:11 EDT
*** Bug 150773 has been marked as a duplicate of this bug. ***
Comment 19 Mik Kersten CLA 2007-10-16 23:54:04 EDT
*** Bug 206503 has been marked as a duplicate of this bug. ***
Comment 20 Steffen Pingel CLA 2009-08-20 13:19:37 EDT
Reopening to mark as resolved as per message from webmaster: http://dev.eclipse.org/mhonarc/lists/eclipse.org-committers/msg00778.html.
Comment 21 Steffen Pingel CLA 2009-08-20 13:25:08 EDT
Marking resolved.
Comment 22 Ian Bull CLA 2009-10-29 14:11:23 EDT
I'm just wondering why this issue has been resolved as fixed, as I'm pretty sure this is still a problem on linux.

I agree there is not much we can do, but is it really "fixed"? 

Having said that, using xfce I managed to map Window Grab Key to the Super (windows) key.  This appears to be a good workaround for window managers (and keyboards) that support this.
Comment 23 Steffen Pingel CLA 2009-10-29 17:30:17 EDT
Good point Ian. I have changed the resolution to NOT_ECLIPSE since there is nothing we can do in Eclipse to address this at the moment.
Comment 24 arne anka CLA 2014-09-29 04:46:44 EDT
not sure if i miss something, but the OBVIOUS solution would have been to make it user-configurable.
why didn't that happen?
Comment 25 Miles Parker CLA 2014-10-10 13:58:24 EDT
Arne, when you ask to make it configurable, what configurations are you thinking should be supported? The other meta keys aren't any better for the reasons discussed above. Allowing users to make a choice of equally unsuitable alternatives does not seem like an improvement.
Comment 26 Miles Parker CLA 2014-10-10 13:58:56 EDT
*** Bug 445314 has been marked as a duplicate of this bug. ***
Comment 27 arne anka CLA 2014-10-10 15:23:56 EDT
doesn't matter.

the first rule is: user decides. and for a complex system like eclipse, the target audience are people who are supposed to know what they are doing.

users are able to think for themselves, don't you think?
and since even the workaround mentioned somewhere requires users to re-configure their desk environments shortcuts, what makes you think they wouldn't be able to figure out something sensible on their own?

you guys have no chance to know what makes sense for the individual user, nor for the individual desktop environment. given the fact that you know that this shortcut fails on Linux (but apparently did not grasp the concepts of a) user's freedom of choice and b) freedom to configurable) it is shocking that after almost ten years this issue is still unsolved ("NOT_ECLIPSE" is just a poor excuse).
Comment 28 Sam Davis CLA 2015-10-07 16:02:52 EDT
*** Bug 478765 has been marked as a duplicate of this bug. ***