WM_Class on the simulator (DEF-3725) (SOLVED)

Hello,

I am using Arch Linux and would like to use the tiling window manager i3 but because the simulator window dont have the property WM_CLASS that i need to tell the window to float instead of tiling for the simulatorwindow. Would it be possible to implement this?

Right now when i launches that window it takes up half my screen and it squash the game.

It is this property i need to recognize the window and make it floating.

WM_CLASS(STRING) = “Navigator”, “Firefox”

/Isak

I’m guessing that you get the same behaviour when you bundle for windows and run?

What would be the drawback if any of adding that flag?

Hello Britzl,

I dont get WM_CLASS when i bundle for Linux and when run it, i dont know if that is what you meant?
Because i dont think i can bundle for windows and run in linux?
The only property i can find is the following:
WM_NAME(STRING) = “Side scroller tutorial”
And that one is changing for every project so it wont work.

/Isak

What I mean is that building and bundling is basically the same thing. What you’re running when you do Project->Build is the same engine as when you bundle and run. There is nothing like a Defold simulator or anything like that. Project->Build will build and run the Defold engine.

Ahh okey, i got it to behave the way i wanted by changing the Title for the project to defold an was when able to use the WM_NAME.

But could i through code in the game add something to the WM_CLASS?

No, we do not provide any API like that. Maybe something can be done using the DefOS extension? @Pkeod and @dapetcu21?

Reading the docs for WM_CLASS it looks like, indeed, it should be set as well when setting the window title. I added an issue to defos:

2 Likes

Created DEF-3725 to add WM_CLASS when setting window title.

4 Likes

Hiya, I’ve been looking a bit at this now and this is what we are currently doing:

  • WM_CLASS.class is set to the basename of the binary (i.e ‘dmengine’ by default)
  • WM_CLASS.instance will be set to the same as the class (also ‘dmengine’ by default)

In your i3 config, you can then use ‘for_window [class=“dmengine”] floating enable’ to achieve what you want. If you need to have separate rules for different games, you can then copy the binary and rename it to whatever class name you want to have a rule for. I understand this is perhaps not the exact solution you are looking for, but it should solve your problem for now. We’ll likely ship this in the next release in ~2 weeks.

4 Likes

Fixed in 1.2.149

1 Like