mini2Dx/mini2Dx

[LWJGL3] config.setWindowListener doesn't seem to set listener

Torbuntu opened this issue · 2 comments

Issue

Using the LWJGL3 backend on Desktop trying to set a window listener doesn't appear to be working. Overriding the filesDropped method and adding a println doesn't display anything in the terminal.

Using a similar setup in libgdx it allows me to print the paths of files dropped on the window.

config.setWindowListener(new Lwjgl3WindowAdapter() {
            @Override
            public void filesDropped(String[] files) {
                Arrays.asList(files).stream().forEach(f -> System.out.println(f));
            }
        });

I got this snipped from this libgdx test and modified it to simply print the file paths to the console.

Expectation

I wanted the file names to be printed to the terminal as I drop them from my desktop.

Actual

I don't see anything happen. Even overriding other methods do nothing seemingly.

Other

Like mentioned, I set up a new project in Mini2Dx to test this and LibGDx. LibGDx worked as expected printing the result, Mini2Dx does nothing.

Info:

OS: Fedora Linux
Java Version: 8, 13 and 14
Mini2Dx Version: 2.0.0-alpha.25
LibGDx Version: 1.9.11-SNAPSHOT, 1.9.10
Lwjgl3 Version: 3.2.3 and whatever mini2Dx uses by default. (I think 3.2.2)
other environment info: tested on both NetBeans 11.3 and Gradle (6.3) in cli.

When digging around I thought it might be somewhere in the game wrapper that is missing the connection to setWindowListener, but I could be, and probably am, way off.

From doing a debug breakline, it looks like the setWindowListener() isn't actually setting the config's windowListener object.

Maybe incompatibility between Lwjgl3Mini2DxWindowListener and what I'm passing in as Lwjgl3WindowAdapter ?

Setting the windowListener on the configuration directly seems to work now.