Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2011-01-19 08:51:50 +0000
committerLakshmi Shanmugam2011-01-19 08:51:50 +0000
commit9e2702afa6b962fde80f1108a5ec6c9116dd479c (patch)
tree711647259409e97ecec58372f642db504d238e73 /bundles/org.eclipse.swt/Eclipse SWT WebKit
parentbe91c6378853be89eec60aa864eb2c5076be911c (diff)
downloadeclipse.platform.swt-9e2702afa6b962fde80f1108a5ec6c9116dd479c.tar.gz
eclipse.platform.swt-9e2702afa6b962fde80f1108a5ec6c9116dd479c.tar.xz
eclipse.platform.swt-9e2702afa6b962fde80f1108a5ec6c9116dd479c.zip
modify focus handling code
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT WebKit')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java39
1 files changed, 1 insertions, 38 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
index 41f4b36567..c97cb90fc7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
@@ -612,30 +612,10 @@ public void create (Composite parent, int style) {
preferences.Release ();
}
- final Listener filter = new Listener () {
- public void handleEvent (Event event) {
- switch (event.type) {
- case SWT.Traverse: {
- traverseNext = event.detail != SWT.TRAVERSE_TAB_PREVIOUS;
- break;
- }
- }
- }
- };
Listener listener = new Listener () {
public void handleEvent (Event e) {
switch (e.type) {
- case SWT.Activate: {
- browser.getDisplay ().removeFilter (SWT.Traverse, filter);
- break;
- }
- case SWT.Deactivate: {
- browser.getDisplay ().removeFilter (SWT.Traverse, filter);
- browser.getDisplay ().addFilter (SWT.Traverse, filter);
- break;
- }
case SWT.Dispose: {
- browser.getDisplay ().removeFilter (SWT.Traverse, filter);
/* make this handler run after other dispose listeners */
if (ignoreDispose) {
ignoreDispose = false;
@@ -648,7 +628,7 @@ public void create (Composite parent, int style) {
break;
}
case SWT.FocusIn: {
- onFocus ();
+ OS.SetFocus (webViewWindowHandle);
break;
}
case SWT.Resize: {
@@ -673,11 +653,6 @@ public void create (Composite parent, int style) {
browser.addListener (SWT.FocusIn, listener);
browser.addListener (SWT.Resize, listener);
browser.addListener (SWT.Traverse, listener);
- browser.addListener (SWT.Activate, listener);
- browser.addListener (SWT.Deactivate, listener);
- if (!browser.isFocusControl ()) {
- browser.getDisplay ().addFilter (SWT.Traverse, filter);
- }
eventFunction = new BrowserFunction (browser, "HandleWebKitEvent") { //$NON-NLS-1$
public Object function (Object[] arguments) {
@@ -1082,18 +1057,6 @@ void onDispose () {
lastNavigateURL = null;
}
-void onFocus () {
- OS.SetFocus (webViewWindowHandle);
- int /*long*/[] result = new int /*long*/[1];
- int hr = webView.QueryInterface (WebKit_win32.IID_IWebViewPrivate, result);
- if (hr != COM.S_OK || result[0] == 0) {
- return;
- }
- IWebViewPrivate webViewPrivate = new IWebViewPrivate (result[0]);
- webViewPrivate.setInitialFocus (traverseNext ? 1 : 0);
- webViewPrivate.Release ();
-}
-
public void refresh () {
webFrameLoadDelegate.html = null;
int /*long*/[] result = new int /*long*/[1];

Back to the top