@@ -334,7 +334,7 @@ private static void dispatchKeyboardKeyEvent(long serial,
334334 }
335335
336336 final long surfacePtr = inputState .surfaceForKeyboardInput ();
337- final WLComponentPeer peer = componentPeerFromSurface (surfacePtr );
337+ final WLComponentPeer peer = peerFromSurface (surfacePtr );
338338 if (peer != null ) {
339339 if (extendedKeyCode >= 0x1000000 ) {
340340 int ch = extendedKeyCode - 0x1000000 ;
@@ -401,7 +401,7 @@ private static void dispatchKeyboardEnterEvent(long serial, long surfacePtr) {
401401 }
402402
403403 final WLInputState newInputState = inputState .updatedFromKeyboardEnterEvent (serial , surfacePtr );
404- final WLComponentPeer peer = componentPeerFromSurface (surfacePtr );
404+ final WLWindowPeer peer = peerFromSurface (surfacePtr );
405405 if (peer != null && peer .getTarget () instanceof Window window ) {
406406 WLKeyboardFocusManagerPeer .getInstance ().setCurrentFocusedWindow (window );
407407 final WindowEvent windowEnterEvent = new WindowEvent (window , WindowEvent .WINDOW_GAINED_FOCUS );
@@ -422,7 +422,7 @@ private static void dispatchKeyboardLeaveEvent(long serial, long surfacePtr) {
422422 keyboard .onLostFocus ();
423423
424424 final WLInputState newInputState = inputState .updatedFromKeyboardLeaveEvent (serial , surfacePtr );
425- final WLComponentPeer peer = componentPeerFromSurface (surfacePtr );
425+ final WLWindowPeer peer = peerFromSurface (surfacePtr );
426426 if (peer != null && peer .getTarget () instanceof Window window ) {
427427 final WindowEvent winLostFocusEvent = new WindowEvent (window , WindowEvent .WINDOW_LOST_FOCUS );
428428 WLKeyboardFocusManagerPeer .getInstance ().setCurrentFocusedWindow (null );
@@ -435,28 +435,28 @@ private static void dispatchKeyboardLeaveEvent(long serial, long surfacePtr) {
435435 /**
436436 * Maps 'struct wl_surface*' to WLComponentPeer that owns the Wayland surface.
437437 */
438- private static final Map <Long , WLComponentPeer > wlSurfaceToComponentMap = new HashMap <>();
438+ private static final Map <Long , WLWindowPeer > wlSurfaceToPeerMap = new HashMap <>();
439439
440- static void registerWLSurface (long wlSurfacePtr , WLComponentPeer componentPeer ) {
440+ static void registerWLSurface (long wlSurfacePtr , WLWindowPeer peer ) {
441441 if (log .isLoggable (PlatformLogger .Level .FINE )) {
442- log .fine ("registerWLSurface: 0x" + Long .toHexString (wlSurfacePtr ) + "->" + componentPeer );
442+ log .fine ("registerWLSurface: 0x" + Long .toHexString (wlSurfacePtr ) + "->" + peer );
443443 }
444- synchronized (wlSurfaceToComponentMap ) {
445- wlSurfaceToComponentMap .put (wlSurfacePtr , componentPeer );
444+ synchronized (wlSurfaceToPeerMap ) {
445+ wlSurfaceToPeerMap .put (wlSurfacePtr , peer );
446446 }
447447 }
448448
449449 static void unregisterWLSurface (long wlSurfacePtr ) {
450- synchronized (wlSurfaceToComponentMap ) {
451- wlSurfaceToComponentMap .remove (wlSurfacePtr );
450+ synchronized (wlSurfaceToPeerMap ) {
451+ wlSurfaceToPeerMap .remove (wlSurfacePtr );
452452 }
453453
454454 inputState = inputState .updatedFromUnregisteredSurface (wlSurfacePtr );
455455 }
456456
457- static WLComponentPeer componentPeerFromSurface (long wlSurfacePtr ) {
458- synchronized (wlSurfaceToComponentMap ) {
459- return wlSurfaceToComponentMap .get (wlSurfacePtr );
457+ static WLWindowPeer peerFromSurface (long wlSurfacePtr ) {
458+ synchronized (wlSurfaceToPeerMap ) {
459+ return wlSurfaceToPeerMap .get (wlSurfacePtr );
460460 }
461461 }
462462
@@ -465,15 +465,15 @@ static WLComponentPeer componentPeerFromSurface(long wlSurfacePtr) {
465465 * associated with that surface.
466466 * Otherwise, throw UOE.
467467 */
468- static WLComponentPeer getSingularWindowPeer () {
469- synchronized (wlSurfaceToComponentMap ) {
470- if (wlSurfaceToComponentMap .size () > 1 ) {
468+ static WLWindowPeer getSingularWindowPeer () {
469+ synchronized (wlSurfaceToPeerMap ) {
470+ if (wlSurfaceToPeerMap .size () > 1 ) {
471471 throw new UnsupportedOperationException ("More than one native window" );
472- } else if (wlSurfaceToComponentMap .isEmpty ()) {
472+ } else if (wlSurfaceToPeerMap .isEmpty ()) {
473473 throw new UnsupportedOperationException ("No native windows" );
474474 }
475475
476- return wlSurfaceToComponentMap .values ().iterator ().next ();
476+ return wlSurfaceToPeerMap .values ().iterator ().next ();
477477 }
478478 }
479479
0 commit comments