Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337548 - SWTBotLink.click() seizes the mouse pointer and doesn't work with KDE as window manager
Summary: SWTBotLink.click() seizes the mouse pointer and doesn't work with KDE as wind...
Status: RESOLVED FIXED
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.6.0   Edit
Assignee: Patrick Tasse CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-18 05:56 EST by Geoff Bache CLA
Modified: 2017-04-12 14:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Bache CLA 2011-02-18 05:56:50 EST
Build Identifier: M20100909-0800

The operation SWTBotLink.click() seizes my mouse pointer and moves it around and appears to be a much lower-level operation than most of SWTBot. Very little else in SWTBot seems to do this.

Also, it doesn't work with KDE at all (running RHEL5 Linux). When I call it there, it seems to click outside the window, causing it to lose focus and no further actions there to work.

I have tested though and it does work under Gnome or Xvfb on Linux. It also works on Windows.

Reproducible: Always

Steps to Reproduce:
1. Run KDE on a linux machine
2. Try to call SWTBotLink.click() on any link at all
3.
Comment 1 Geoff Bache CLA 2011-02-20 05:07:41 EST
After the rapid fix and release of bug 337527 (for which many thanks btw, really got me out of a hole) could I suggest the way to go with this one is to rewrite the method to find the hyperlink text and call SWTBot.click(hyperlinkText) which now works and isn't so low-level as to depend on window managers and their quirks?
Comment 2 Eclipse Genie CLA 2016-11-11 11:03:55 EST
New Gerrit change created: https://git.eclipse.org/r/84907
Comment 3 Patrick Tasse CLA 2016-11-11 11:34:26 EST
SWTBotLink.click() posts a mouse click event at the display location that corresponds to the center of the Link widget's bounds. It is possible, if the widget is in a parent composite or a shell that is too small, that this mouse location is over another control in the shell, or even over another shell, or no shell at all.

The proposed patch makes the click() method reliably click on the widget without posting mouse events, and select the first hyperlink, if there is any in the widget's text.

A new method click(int) is added to click and select the hyperlink at a specified index.
Comment 5 Patrick Tasse CLA 2017-04-12 14:57:39 EDT
Merged to master branch.