Admicos / minecraft-wayland

A better way of running Minecraft Without XWayland. Because I REALLY had nothing better to do with my life.
254 stars 14 forks source link

swaywm: Disappearing window unless joining game in fullscreen mode #63

Open mazunki opened 2 months ago

mazunki commented 2 months ago

I'm not sure if this is specific to Sway, but I somehow need to put the game into fullscreen before I join a game, or the game window disappears into oblivion. If I fullscreen the game first, then I can windowize it afterwards just fine.

The game doesn't crash, and I can still hear the music, but somehow the surface is nowhere to be found. I have a feeling this is due to a new opengl context replacing the old window, or something, and I would like to report it to Sway, but I don't really understand it well enough to make a proper report.

If anyone has any ideas, I'm happy to test them out.

mazunki commented 2 months ago

Some more notes: from swaymsg -t get_tree I get the following tree:

{
    "id": 109,
    "type": "floating_con",
    "orientation": "none",
    "percent": 0.19320427901081824,
    "urgent": false,
    "marks": [],
    "focused": false,
    "layout": "none",
    "border": "pixel",
    "current_border_width": 2,
    "rect": {
        "x": 3092,
        "y": 277,
        "width": 1182,
        "height": 1300
    },
    "deco_rect": {
        "x": 0,
        "y": 0,
        "width": 0,
        "height": 0
    },
    "window_rect": {
        "x": 2,
        "y": 2,
        "width": 1178,
        "height": 1296
    },
    "geometry": {
        "x": 0,
        "y": 0,
        "width": 854,
        "height": 480
    },
    "name": "GT: New Horizons 2.6.0",
    "window": null,
    "nodes": [],
    "floating_nodes": [],
    "focus": [],
    "fullscreen_mode": 0,
    "sticky": false,
    "pid": 8769,
    "app_id": "",
    "visible": true,
    "max_render_time": 0,
    "shell": "xdg_shell",
    "inhibit_idle": false,
    "idle_inhibitors": {
        "user": "none",
        "application": "none"
    }
}

After the window disappears, there is no window with name nor id anymore. Using full-screen doesn't always work either, sometimes it's not necessary. It's a bit unpredictable.

mazunki commented 2 months ago

It also happens when reloading resource packs.