embiggen menu bar to host's size

This commit is contained in:
Jesús A. Álvarez 2019-11-06 21:12:29 +01:00
parent 68fcaa117b
commit 93797ff488
2 changed files with 8 additions and 0 deletions

View File

@ -61,6 +61,9 @@ void make_window_transparent(SDL_Window * window)
return; return;
} }
extern int native_menubar_size;
native_menubar_size = (int)[[NSApp mainMenu] menuBarHeight];
SDL_SysWMinfo wmInfo; SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version); SDL_VERSION(&wmInfo.version);
if (!SDL_GetWindowWMInfo(window, &wmInfo)) { if (!SDL_GetWindowWMInfo(window, &wmInfo)) {

View File

@ -15,6 +15,7 @@
extern void make_window_transparent(SDL_Window * window); extern void make_window_transparent(SDL_Window * window);
extern void update_sdl_video(SDL_Surface *s, int numrects, SDL_Rect *rects); extern void update_sdl_video(SDL_Surface *s, int numrects, SDL_Rect *rects);
int native_menubar_size = 0;
/* /*
* Rootless mode support * Rootless mode support
@ -231,6 +232,10 @@ uint16 menuBarHeight;
bool inMenuSelect = false; bool inMenuSelect = false;
static SDL_Rect MaskMenuBar() { static SDL_Rect MaskMenuBar() {
if (native_menubar_size && ReadMacInt16(0x0BAA) == 20) {
// Embiggen menubar
WriteMacInt16(0xBAA, native_menubar_size);
}
if (!inMenuSelect) { if (!inMenuSelect) {
menuBarHeight = ReadMacInt16(0x0BAA); menuBarHeight = ReadMacInt16(0x0BAA);
} }