mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-2019 provide getWindowHandle method for jcef
(cherry picked from commit 7ae706b629)
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user