Skip to content

Commit cd6366a

Browse files
authored
Merge branch 'eclipse-platform:master' into master
2 parents c5c9707 + 8a8c67d commit cd6366a

File tree

10 files changed

+1221
-453
lines changed

10 files changed

+1221
-453
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313
*******************************************************************************/
1414
package org.eclipse.swt.browser;
1515

16+
import org.eclipse.swt.*;
17+
1618
class BrowserFactory {
1719

1820
WebBrowser createWebBrowser (int style) {
1921
boolean webkitInstalled = WebKit.IsInstalled ();
2022
if (!webkitInstalled) return null;
2123

22-
return new WebKit ();
24+
WebKit webKit = new WebKit ();
25+
webKit.enableSearch = (style & SWT.SEARCH) == SWT.SEARCH;
26+
return webKit;
2327
}
2428

2529
}

bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -242,29 +242,35 @@ void createCOMInterfaces() {
242242
public long method2(long[] args) {return Release();}
243243
@Override
244244
public long method3(long[] args) {
245-
if (args.length == 5) {
246-
return DragEnter(args[0], (int)args[1], (int)args[2], (int)args[3], args[4]);
247-
} else {
248-
return DragEnter_64(args[0], (int)args[1], args[2], args[3]);
249-
}
245+
return Win32DPIUtils.runWithProperDPIAwareness(() -> {
246+
if (args.length == 5) {
247+
return DragEnter(args[0], (int)args[1], (int)args[2], (int)args[3], args[4]);
248+
} else {
249+
return DragEnter_64(args[0], (int)args[1], args[2], args[3]);
250+
}
251+
});
250252
}
251253
@Override
252254
public long method4(long[] args) {
253-
if (args.length == 4) {
254-
return DragOver((int)args[0], (int)args[1], (int)args[2], args[3]);
255-
} else {
256-
return DragOver_64((int)args[0], args[1], args[2]);
257-
}
255+
return Win32DPIUtils.runWithProperDPIAwareness(() -> {
256+
if (args.length == 4) {
257+
return DragOver((int)args[0], (int)args[1], (int)args[2], args[3]);
258+
} else {
259+
return DragOver_64((int)args[0], args[1], args[2]);
260+
}
261+
});
258262
}
259263
@Override
260264
public long method5(long[] args) {return DragLeave();}
261265
@Override
262266
public long method6(long[] args) {
263-
if (args.length == 5) {
264-
return Drop(args[0], (int)args[1], (int)args[2], (int)args[3], args[4]);
265-
} else {
266-
return Drop_64(args[0], (int)args[1], args[2], args[3]);
267-
}
267+
return Win32DPIUtils.runWithProperDPIAwareness(() -> {
268+
if (args.length == 5) {
269+
return Drop(args[0], (int)args[1], (int)args[2], (int)args[3], args[4]);
270+
} else {
271+
return Drop_64(args[0], (int)args[1], args[2], args[3]);
272+
}
273+
});
268274
}
269275
};
270276
}

bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class WebKit extends WebBrowser {
101101
private Point searchShellLocation;
102102
private Shell searchShell;
103103
private String searchText;
104+
boolean enableSearch;
105+
104106

105107
boolean firstLoad = true;
106108
static boolean FirstCreate = true;
@@ -208,7 +210,7 @@ class WebKit extends WebBrowser {
208210
static final boolean ignoreTls;
209211

210212
/** Flag that disables browser searching added on top of the WebKit browser. */
211-
static final boolean disableBrowserSearch;
213+
static final boolean disableBrowserSearchGlobally;
212214

213215
static {
214216
Proc2 = new Callback (WebKit.class, "Proc", 2); //$NON-NLS-1$
@@ -257,7 +259,7 @@ class WebKit extends WebBrowser {
257259
NativePendingCookies = null;
258260
}
259261
ignoreTls = "true".equals(System.getProperty("org.eclipse.swt.internal.webkitgtk.ignoretlserrors"));
260-
disableBrowserSearch = "true".equals(System.getProperty("org.eclipse.swt.internal.webkitgtk.disableBrowserSearch"));
262+
disableBrowserSearchGlobally = "true".equals(System.getProperty("org.eclipse.swt.internal.webkitgtk.disableBrowserSearch"));
261263
}
262264

263265
@Override
@@ -795,7 +797,7 @@ public void create (Composite parent, int style) {
795797
break;
796798
}
797799
case SWT.KeyDown: {
798-
if (!disableBrowserSearch && event.keyCode == 'f' && (event.stateMask & SWT.CTRL) == SWT.CTRL) {
800+
if (!disableBrowserSearchGlobally && enableSearch && event.keyCode == 'f' && (event.stateMask & SWT.CTRL) == SWT.CTRL) {
799801
openSearchDialog();
800802
}
801803
break;
@@ -2711,13 +2713,6 @@ private void openSearchDialog() {
27112713
return;
27122714
}
27132715
Shell browserShell = browser.getShell();
2714-
if (browserShell == null || browserShell.isDisposed() || (browserShell.getStyle() & SWT.TOOL) == SWT.TOOL) {
2715-
/*
2716-
* We don't provide search capabilities for browsers in a pop-up.
2717-
* We could cause issues with pop-up focus handling when the search shell is opened.
2718-
*/
2719-
return;
2720-
}
27212716
Shell shell = new Shell(browserShell, SWT.TOOL | SWT.MODELESS);
27222717
Rectangle browserArea = browser.getClientArea();
27232718
int height = 45;

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,7 @@ public class SWT {
15581558
* <p><b>Used By:</b></p>
15591559
* <ul>
15601560
* <li><code>Text</code></li>
1561+
* <li><code>Browser</code> (WebKit and GTK only)</li>
15611562
* </ul>
15621563
*
15631564
* @since 3.3

0 commit comments

Comments
 (0)