Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2018-04-12 17:50:03 +0000
committerConrad Groth2018-04-14 08:16:46 +0000
commit2957e73bf901cb79ad422fea071083e80726d59f (patch)
treef48c9e572f79f7774448a296a1adeb07b8621bb3
parent699653c8ebc3b0cb93e4b006698a1faed364dfdb (diff)
downloadeclipse.platform.swt-2957e73bf901cb79ad422fea071083e80726d59f.tar.gz
eclipse.platform.swt-2957e73bf901cb79ad422fea071083e80726d59f.tar.xz
eclipse.platform.swt-2957e73bf901cb79ad422fea071083e80726d59f.zip
Bug 335054 - [Win32] Hand cursor over link widget gets stuck
SysLink window procedure doesn't set cursor over non-link areas because those areas are transparent for mouse events (using WM_HITTEST). Link widget overrides WM_HITTEST in order to receive mouse events, which means it's responsible for setting cursor over previously mouse-transparent areas. Change-Id: I9d8f58ea969b8abb407f4b1558cd8f6f062358b8 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 8c26ac846f..d41f9440a5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -1022,8 +1022,8 @@ LRESULT WM_NCHITTEST (long /*int*/ wParam, long /*int*/ lParam) {
/*
* Feature in Windows. For WM_NCHITTEST, the Syslink window proc
- * returns HTTRANSPARENT when mouse is over plain text. The fix is
- * to always return HTCLIENT.
+ * returns HTTRANSPARENT when mouse is over plain text. As a result,
+ * mouse events are not delivered. The fix is to always return HTCLIENT.
*/
return new LRESULT (OS.HTCLIENT);
}
@@ -1106,6 +1106,16 @@ LRESULT WM_PRINTCLIENT (long /*int*/ wParam, long /*int*/ lParam) {
}
@Override
+LRESULT WM_SETCURSOR(long /*int*/ wParam, long /*int*/ lParam) {
+ LRESULT result = super.WM_SETCURSOR (wParam, lParam);
+ if (result != null) return result;
+ long /*int*/ fDone = callWindowProc (handle, OS.WM_SETCURSOR, wParam, lParam);
+ /* Take responsibility for cursor over plain text after overriding WM_NCHITTEST. */
+ if (fDone == 0) OS.DefWindowProc (handle, OS.WM_SETCURSOR, wParam, lParam);
+ return LRESULT.ONE;
+}
+
+@Override
LRESULT WM_SETFOCUS (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT result = super.WM_SETFOCUS (wParam, lParam);
if (!useCommonControl()) redraw ();

Back to the top