Ticket #4186: Options_-w_-T_for_windowed_startup.patch

File Options_-w_-T_for_windowed_startup.patch, 2.2 KB (added by psprint, 19 months ago)
  • src/args.c

    From cd77f3bbebf34e41a8d52f36fd06ac9c6d44a98e Mon Sep 17 00:00:00 2001
    From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
    Date: Sun, 24 Jan 2021 04:45:51 -0600
    Subject: Add -w/-T options.
    
    ---
     src/args.c              | 18 ++++++++++++++++++
     src/args.h              |  2 ++
     src/editor/editwidget.c |  9 +++++++++
     3 files changed, 29 insertions(+)
    
    diff --git a/src/args.c b/src/args.c
    index 3f6a8b2a4..df49bbd94 100644
    a b  
    4646 
    4747/*** global variables ****************************************************************************/ 
    4848 
     49gboolean mc_args__cascade = FALSE; 
     50gboolean mc_args__tile = FALSE; 
     51 
    4952/* If true, assume we are running on an xterm terminal */ 
    5053gboolean mc_args__force_xterm = FALSE; 
    5154 
    static const GOptionEntry argument_main_table[] = { 
    178181    }, 
    179182#endif /* ENABLE_VFS_SMB */ 
    180183 
     184    /* options for non-fullscreen mcedit startup */ 
     185    { 
     186     "cascade", 'w', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, 
     187     &mc_args__cascade, 
     188     N_("Start editor with windows arranged in cascade"), 
     189     NULL 
     190    }, 
     191 
     192    { 
     193     "tile", 'T', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, 
     194     &mc_args__tile, 
     195     N_("Start editor with windows tiled"), 
     196     NULL 
     197    }, 
     198 
    181199    { 
    182200     /* handle arguments manually */ 
    183201     "view", 'v', G_OPTION_FLAG_IN_MAIN | G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, 
  • src/args.h

    diff --git a/src/args.h b/src/args.h
    index 616864d00..69b25ec16 100644
    a b extern gboolean mc_args__force_xterm; 
    2222extern gboolean mc_args__nomouse; 
    2323extern gboolean mc_args__force_colors; 
    2424extern gboolean mc_args__nokeymap; 
     25extern gboolean mc_args__cascade; 
     26extern gboolean mc_args__tile; 
    2527extern char *mc_args__last_wd_file; 
    2628extern char *mc_args__netfs_logfile; 
    2729extern char *mc_args__keymap_file; 
  • src/editor/editwidget.c

    diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
    index 41d9bc5da..d1a41de45 100644
    a b edit_files (const GList * files) 
    13871387        ok = ok || f_ok; 
    13881388    } 
    13891389 
     1390    if (mc_args__cascade) 
     1391    { 
     1392        edit_window_cascade (edit_dlg); 
     1393    } 
     1394    else if (mc_args__tile) 
     1395    { 
     1396        edit_window_tile (edit_dlg); 
     1397    } 
     1398 
    13901399    if (ok) 
    13911400        dlg_run (edit_dlg); 
    13921401