Focus problem when switching to fullscreen mode in libgdx

When I run my app in fullscreen mode on a desktop, it starts to behave strangely. The window is created but its content is not shown. I can switch between other open windows using alt+tab but they don’t respond to mouse (although respond to the keyboard). If I choose my app using alt+tab it will be shown and behave as usual. When I switch to any other window, strange behavior continues again.
What is wrong? Can anyone help with this? Without using fullsreen mode, everything works fine.

System details: Ubuntu 18.04, libgdx 1.10.0.

The code I am using:

public class DesktopLauncher {
    public static void main (String() arg) {
        LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
        config.width = 600;
        config.height = 480;
        config.fullscreen = true; // this causes strange behavior
        new LwjglApplication(new MyGdxGame(), config);
    }
}

class MyGdxGame extends ApplicationAdapter {
    SpriteBatch batch;
    Texture img;

    @Override
    public void create () {
        batch = new SpriteBatch();
        img = new Texture("badlogic.jpg");
    }

    @Override
    public void render () {
        ScreenUtils.clear(0.1f, 0.2f, 0.3f, 0.1f);
        batch.begin();
        batch.draw(img, 100, 100);
        batch.end();
    }

    @Override
    public void dispose () {
        batch.dispose();
        img.dispose();
    }
}