diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-07-08 19:16:49 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-07-08 19:16:49 +0300 |
commit | cd2e23e06f503ec6d7240ddd5e8ff8e315cd1536 (patch) | |
tree | 4ae5cc7c186549276558b7a145d5943b5116c1f3 /nt | |
parent | b953882a75068e079a99cfc86a5c0e9796d604bd (diff) |
Support "maximized" property of runemacs's shortcut
* nt/runemacs.c (WinMain): If runemacs is invoked "maximized", pass
the '--maximized' switch to Emacs.
Diffstat (limited to 'nt')
-rw-r--r-- | nt/runemacs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nt/runemacs.c b/nt/runemacs.c index 905ef30a5d..86644b4dfe 100644 --- a/nt/runemacs.c +++ b/nt/runemacs.c @@ -59,7 +59,7 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) char *new_cmdline; char *p; char modname[MAX_PATH]; - static const char iconic_opt[] = "--iconic "; + static const char iconic_opt[] = "--iconic ", maximized_opt[] = "--maximized "; if (!ensure_unicows_dll ()) goto error; @@ -74,7 +74,10 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) new_cmdline = alloca (MAX_PATH + strlen (cmdline) - + (nShow == SW_SHOWMINNOACTIVE) * strlen (iconic_opt) + + ((nShow == SW_SHOWMINNOACTIVE + || nShow == SW_SHOWMAXIMIZED) + ? max (sizeof (iconic_opt), sizeof (maximized_opt)) + : 0) + 3); /* Quote executable name in case of spaces in the path. */ *new_cmdline = '"'; @@ -146,9 +149,12 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) /* If the desktop shortcut properties tell to invoke runemacs minimized, or if they invoked runemacs via "start /min", pass - '--iconic' to Emacs, as that's what users will expect. */ + '--iconic' to Emacs, as that's what users will expect. Likewise + with invoking runemacs maximized: pass '--maximized' to Emacs. */ if (nShow == SW_SHOWMINNOACTIVE) strcat (new_cmdline, iconic_opt); + else if (nShow == SW_SHOWMAXIMIZED) + strcat (new_cmdline, maximized_opt); strcat (new_cmdline, cmdline); /* Set emacs_dir variable if runemacs was in "%emacs_dir%\bin". */ |