JBR-2019 provide getWindowHandle method for jcef

(cherry picked from commit 7ae706b629)
This commit is contained in:
Anton Tarasov
2019-12-13 15:14:17 +03:00
committed by jbrbot
parent dcb5305e5c
commit 86f3ce1c86
2 changed files with 23 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ import sun.java2d.SurfaceData;
import sun.java2d.loops.Blit;
import sun.java2d.loops.CompositeType;
import sun.java2d.pipe.Region;
import sun.lwawt.macosx.CPlatformWindow;
import sun.util.logging.PlatformLogger;
public class LWWindowPeer
@@ -1523,4 +1524,17 @@ public class LWWindowPeer
public String toString() {
return super.toString() + " [target is " + getTarget() + "]";
}
/**
* [tav] Used externally.
*/
@Override
public long getWindowHandle() {
final long[] handle = new long[1];
PlatformWindow window = getPlatformWindow();
if (window instanceof CPlatformWindow) {
((CPlatformWindow)window).execute(ptr -> handle[0] = ptr);
}
return handle[0];
}
}

View File

@@ -126,6 +126,15 @@ public interface WindowPeer extends ContainerPeer {
*/
default Insets getSysInsets() { return null; }
/**
* Returns platform window handle.
*
* @return the window handle
*/
default long getWindowHandle() {
throw new UnsupportedOperationException("unimplemented");
}
/**
* Requests a GC that best suits this Window. The returned GC may differ
* from the requested GC passed as the argument to this method. This method