diff options
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c index ede35e19..0e028291 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -919,7 +919,14 @@ static int lgui__index(lua_State *L) { lua_pushlstring(L, text, scintilla_get_clipboard(focused_view, NULL)); free(text); #endif - } else if (strcmp(key, "size") == 0) { + } else if (strcmp(key, "maximized") == 0) +#if GTK + lua_pushboolean(L, gdk_window_get_state(window->window) & + GDK_WINDOW_STATE_MAXIMIZED); +#elif CURSES + lua_pushboolean(L, FALSE); +#endif + else if (strcmp(key, "size") == 0) { #if GTK int width, height; gtk_window_get_size(GTK_WINDOW(window), &width, &height); @@ -982,7 +989,12 @@ static int lgui__newindex(lua_State *L) { gtk_widget_hide(new_menubar); #endif #endif - } else if (strcmp(key, "size") == 0) { + } else if (strcmp(key, "maximized") == 0) +#if GTK + lua_toboolean(L, 3) ? gtk_window_maximize(GTK_WINDOW(window)) + : gtk_window_unmaximize(GTK_WINDOW(window)); +#endif + else if (strcmp(key, "size") == 0) { #if GTK luaL_argcheck(L, lua_istable(L, 3) && lua_rawlen(L, 3) == 2, 3, "{ width, height } table expected"); |