Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332709 - Use JNI add an window callback function to Shell, function can not be called.
Summary: Use JNI add an window callback function to Shell, function can not be called.
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.6.2   Edit
Assignee: Silenio Quarti CLA
QA Contact: Lakshmi P Shanmugam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 04:41 EST by Fan Peng CLA
Modified: 2010-12-22 11:47 EST (History)
7 users (show)

See Also:
eclipse.felipe: review+


Attachments
Native code sample. (2.80 KB, application/octet-stream)
2010-12-16 04:43 EST, Fan Peng CLA
no flags Details
Eclipse rcp code sample. (11.54 KB, application/octet-stream)
2010-12-16 04:43 EST, Fan Peng CLA
no flags Details
possible fix (3.46 KB, patch)
2010-12-16 18:04 EST, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fan Peng CLA 2010-12-16 04:41:36 EST
Build Identifier: IES 3.6.1Carbon      Version:3.6.1         Build id:M20100909-0800

For some reason,We had added an window callback function to Shell.We had implemented this by jni native c code.We passed Shell.handle to the jni functions and call carbon api HMInstallWindowContentCallback to add an callback function.In swt 3.5.2,the window callback works correctly but in 3.6.1, it won't be called.

Reproducible: Always

Steps to Reproduce:
1.New an Shell.
2.Use carbon api HMInstallWindowContentCallback to add a window callback function to the Shell.
3.The window callback function won't be called in carbon 3.6.1
Comment 1 Fan Peng CLA 2010-12-16 04:43:19 EST
Created attachment 185299 [details]
Native code sample.
Comment 2 Fan Peng CLA 2010-12-16 04:43:52 EST
Created attachment 185300 [details]
Eclipse rcp code sample.
Comment 3 Fan Peng CLA 2010-12-16 05:14:40 EST
I have investigated carbon SWT code between 3.5.2 and 3.6.1.This issue is caused by Control.helpProc.If we havn't set tooltiptext to Shell, this method will return OS.noErr in 3.5.2 and return OS.eventNotHandledErr in 3.6.1 .The window callback function only called when this method return OS.noErr.

When Shell is created, the swt created a UserPane control on the Shell and used HMInstallControlContentCallback to add an control call back function to the UserPane.The control call back function is problematic method Control.helpProc.

Finally I have represented this issue by pure carbon code.similar As Shell code,I create an carbon window,then create an user panel on the window.Add window call back function on the window and controll call back function on the user panel.If these call back function always return 0,when you hover mouse on the window,the control call back will be called first,then the window call back will be called .If the control call back function not return 0, the window call back will never called.These code can be seen in Attachments:Native code sample.

Though it's an carbon issue,we hope swt can supply an patch to support this.
Comment 4 Felipe Heidrich CLA 2010-12-16 11:06:27 EST
Silenio, do you think you can help ?
Comment 5 Silenio Quarti CLA 2010-12-16 18:04:38 EST
Created attachment 185386 [details]
possible fix

This bug was caused by the fix for bug#136932.

Please try this patch out.
Comment 6 Fan Peng CLA 2010-12-16 21:17:33 EST
This fix works correctly.
Comment 7 Silenio Quarti CLA 2010-12-20 10:35:04 EST
Fixed > 20101220.  Only in HEAD  (3.7).
Comment 8 Silenio Quarti CLA 2010-12-22 11:28:27 EST
Reopening to fix in 3.6.2.
Comment 9 Silenio Quarti CLA 2010-12-22 11:47:42 EST
Fixed in R3_6_maintenance.