Avoid to restore window size when maximized (#226)
This commit is contained in:
parent
bd29383a07
commit
bd788d96fc
|
@ -18,7 +18,7 @@ local core = {}
|
||||||
local function load_session()
|
local function load_session()
|
||||||
local ok, t = pcall(dofile, USERDIR .. "/session.lua")
|
local ok, t = pcall(dofile, USERDIR .. "/session.lua")
|
||||||
if ok then
|
if ok then
|
||||||
return t.recents, t.window
|
return t.recents, t.window, t.window_mode
|
||||||
end
|
end
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
@ -29,6 +29,7 @@ local function save_session()
|
||||||
if fp then
|
if fp then
|
||||||
fp:write("return {recents=", common.serialize(core.recent_projects),
|
fp:write("return {recents=", common.serialize(core.recent_projects),
|
||||||
", window=", common.serialize(table.pack(system.get_window_size())),
|
", window=", common.serialize(table.pack(system.get_window_size())),
|
||||||
|
", window_mode=", common.serialize(system.get_window_mode()),
|
||||||
"}\n")
|
"}\n")
|
||||||
fp:close()
|
fp:close()
|
||||||
end
|
end
|
||||||
|
@ -370,9 +371,11 @@ function core.init()
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local recent_projects, window_position = load_session()
|
local recent_projects, window_position, window_mode = load_session()
|
||||||
if window_position then
|
if window_mode == "normal" then
|
||||||
system.set_window_size(table.unpack(window_position))
|
system.set_window_size(table.unpack(window_position))
|
||||||
|
else
|
||||||
|
system.set_window_mode("maximized")
|
||||||
end
|
end
|
||||||
core.recent_projects = recent_projects
|
core.recent_projects = recent_projects
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue