Skip to main content

FlixelLwjgl3WindowListener

View source

class

org.flixelgdx.backend.lwjgl3.window.FlixelLwjgl3WindowListener

public class FlixelLwjgl3WindowListener implements Lwjgl3WindowListener

GLFW window listener that drives Flixel window lifecycle hooks and optionally forwards events to a user-supplied Lwjgl3WindowListener.

This listener handles three responsibilities in one place:

  • Routing GLFW focus and minimize events to FlixelGame.onFocusLost(), FlixelGame.onFocusGained(), and FlixelGame.onMinimized().
  • Vetoing GLFW close requests when FlixelLwjgl3WindowListener.setAbsorbCloseRequests(boolean) is true.
  • Forwarding all events to the optional user listener passed at construction.

Constructors

FlixelLwjgl3WindowListener(Lwjgl3WindowListener)

public FlixelLwjgl3WindowListener(Lwjgl3WindowListener next)

Methods

addFocusHooks(Runnable, Runnable)

public static void addFocusHooks(Runnable onFocusGained, Runnable onFocusLost)

Registers a pair of callbacks that fire on every focus-gained and focus-lost event, after the built-in Flixel lifecycle hooks run.

Intended for backend modules (such as the LWJGL3/VLC video module) that need reliable focus notifications without relying on Signals, which can be cleared by developer code.

Parameters:

NameDescription
onFocusGainedCalled when the window regains focus.
onFocusLostCalled when the window loses focus.

created(Lwjgl3Window)

public void created(Lwjgl3Window window)

iconified(boolean)

public void iconified(boolean isIconified)

maximized(boolean)

public void maximized(boolean isMaximized)

focusLost()

public void focusLost()

focusGained()

public void focusGained()

closeRequested()

public boolean closeRequested()

filesDropped(String[])

public void filesDropped(String[] files)

refreshRequested()

public void refreshRequested()