Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added hidehomeindicator for iOS #2131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/modules/love/boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ function love.init()
resizable = false,
centered = true,
usedpiscale = true,
hidehomeindicator = "0",
},
graphics = {
gammacorrect = false,
Expand Down Expand Up @@ -401,6 +402,7 @@ function love.init()
display = c.window.display, -- deprecated
highdpi = c.window.highdpi, -- deprecated
usedpiscale = c.window.usedpiscale,
hidehomeindicator = c.window.hidehomeindicator,
x = c.window.x,
y = c.window.y,
}), "Could not set window mode")
Expand Down
1 change: 1 addition & 0 deletions src/modules/window/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ STRINGMAP_CLASS_BEGIN(Window, Window::Setting, Window::SETTING_MAX_ENUM, setting
{"display", Window::SETTING_DISPLAY},
{"highdpi", Window::SETTING_HIGHDPI},
{"usedpiscale", Window::SETTING_USE_DPISCALE},
{"hidehomeindicator", Window::SETTING_HIDEHOMEINDICATOR},
{"refreshrate", Window::SETTING_REFRESHRATE},
{"x", Window::SETTING_X},
{"y", Window::SETTING_Y},
Expand Down
2 changes: 2 additions & 0 deletions src/modules/window/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Window : public Module
SETTING_DISPLAY, // Deprecated
SETTING_HIGHDPI, // Deprecated
SETTING_USE_DPISCALE,
SETTING_HIDEHOMEINDICATOR,
SETTING_REFRESHRATE,
SETTING_X,
SETTING_Y,
Expand Down Expand Up @@ -279,6 +280,7 @@ struct WindowSettings
bool centered = true;
int displayindex = 0;
bool usedpiscale = true;
char *hidehomeindicator = "0";
double refreshrate = 0.0;
bool useposition = false;
int x = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/modules/window/sdl/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
}
}

if (f.hidehomeindicator)
SDL_SetHint(SDL_HINT_IOS_HIDE_HOME_INDICATOR, f.hidehomeindicator);

bool needsetmode = false;

if (renderer != windowRenderer && isOpen())
Expand Down Expand Up @@ -761,6 +764,8 @@ void Window::updateSettings(const WindowSettings &newsettings, bool updateGraphi

settings.usedpiscale = newsettings.usedpiscale;

settings.hidehomeindicator = newsettings.hidehomeindicator;

// Only minimize on focus loss if the window is in exclusive-fullscreen mode
if (settings.fullscreen && settings.fstype == FULLSCREEN_EXCLUSIVE)
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1");
Expand Down
8 changes: 8 additions & 0 deletions src/modules/window/wrap_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ static int readWindowSettings(lua_State *L, int idx, WindowSettings &settings)
settings.centered = luax_boolflag(L, idx, settingName(Window::SETTING_CENTERED), settings.centered);
settings.usedpiscale = luax_boolflag(L, idx, settingName(Window::SETTING_USE_DPISCALE), settings.usedpiscale);

lua_getfield(L, idx, settingName(Window::SETTING_HIDEHOMEINDICATOR));
if (!lua_isnoneornil(L, -1))
settings.hidehomeindicator = (char *) lua_tostring(L, -1);
lua_pop(L, 1);

lua_getfield(L, idx, settingName(Window::SETTING_DEPTH));
if (lua_type(L, -1) == LUA_TNUMBER)
{
Expand Down Expand Up @@ -232,6 +237,9 @@ int w_getMode(lua_State *L)
luax_pushboolean(L, settings.usedpiscale);
lua_setfield(L, -2, settingName(Window::SETTING_USE_DPISCALE));

lua_pushstring(L, settings.hidehomeindicator);
lua_setfield(L, -2, settingName(Window::SETTING_HIDEHOMEINDICATOR));

lua_pushnumber(L, settings.refreshrate);
lua_setfield(L, -2, settingName(Window::SETTING_REFRESHRATE));

Expand Down
Loading