laamaa / m8c

Cross-platform M8 tracker headless client
Other
410 stars 85 forks source link

Option to turn off the title bar on MacOS #114

Closed alexeydemidovkz closed 1 year ago

alexeydemidovkz commented 1 year ago

I apologize for making a purely cosmetic request, but I think it would be really nice to have an option (or perhaps even make it the default setting) to turn off the title bar on MacOS (I'm unsure about other operating systems as I haven't seen how it looks on them). Essentially, it would be great to just have a black M8 window on the screen. I believe this would enhance its appearance significantly. Thank you very much for your work.

laamaa commented 1 year ago

Hi!

For me personally borderless windows are confusing, so I probably won't be adding that in the program. That being said, you could try hacking that in yourself and build yourself a custom version.

Take a look at the flags at https://github.com/laamaa/m8c/blob/main/render.c#L46-L49

By appending SDL_WINDOW_BORDERLESS flag to the window creation parameters you should get what you're looking for. (I don't own a Mac though, so I can't be sure if this works on that too.)

The line should look something like this: win = SDL_CreateWindow("m8c", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window_width, window_height, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | init_fullscreen | SDL_WINDOW_BORDERLESS);

alexeydemidovkz commented 1 year ago

Hi, thank you very much for your answer, this worked and look nice in my opinion. Although the edges of the window have become straight instead of rounded. The only problem is that I can't move window now without title bar:) Have keyboard maestro macros for this anyway. Thank you very much!

How it looks: https://i.imgur.com/mX6t51y.png

laamaa commented 1 year ago

Glad to hear you got it sorted out! :)