icewolfz / jiMUD

MUD client for ShadowMUD.com using electron
http://www.shadowmud.com
7 stars 0 forks source link

Wayland support #263

Open icewolfz opened 2 months ago

icewolfz commented 2 months ago

Electron has issues with native wayland, some events do not fire, child windows/dialogs may not show but remain hidden in the background, or child/dialog windows may not linked to parent windows thus letting them float or move around when they should not. Saddly there is not much i can do to fix it at this point i am looking into work a rounds, if i can find a reliable way to detect when native wayland is used in the main process i can try to work around some of the issues. largest that seems to not be able to work around is setting child windows on top of parent windows as some times windows should not allow access to parent windows like the preference window should remain focused until closed right now it will be treated as an entire seperate app and let you continue to use the main client which could cause settings to be corrupted or lost

icewolfz commented 2 months ago

if(process.env.GDK_BACKEND === 'wayland') can be used to test for wayland once far enough into the main process, beleave it will not be correct until app.ready has been called but anything window related i called after that so this test should work, will need to replace window.once('ready-to-show') with windows.webcontents.once('did-finish-load') as it seems the ready to show is not very good on wayland outside of the main window it seems

this does not fix the on top/parent bug as this will at least show a window but will still not allow a good fix until i can figure out how to fix the parent issue

icewolfz commented 2 months ago

can test and force wayland using the command line arguments --enable-features=UseOzonePlatform --ozone-platform=wayland

icewolfz commented 2 months ago

Anther bug related to wayland is window titlebar icon uses the wayland icon and not the jimud icon