Changeset 2458 for neercs/trunk


Ignore:
Timestamp:
Jun 19, 2008, 11:50:29 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Support detaching (NOT ATTACHING)
Location:
neercs/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/Makefile.am

    r2457 r2458  
    33
    44neercs_SOURCES = neercs.h mygetopt.c recurrent.c main.c screens.c term.c \
    5                  grab.c effects.c wm.c screensaver.c
     5                 grab.c effects.c wm.c screensaver.c attach.c
    66neercs_CFLAGS = @CACA_CFLAGS@
    77neercs_LDADD = @CACA_LIBS@ @UTIL_LIBS@ @PAM_LIBS@
  • neercs/trunk/src/main.c

    r2457 r2458  
    127127    screen_list->in_screensaver = 0;
    128128    screen_list->locked = 0;
     129    screen_list->attached = 1;
    129130    memset(screen_list->lockmsg, 0, 1024);
    130131    memset(screen_list->lockpass, 0, 1024);
     
    203204    {
    204205        caca_event_t ev;
    205         int ret;
     206        int ret = 0;
    206207
    207208        refresh |= update_screens_contents(screen_list);
     
    214215
    215216        /* Get events, if any */
    216         ret = caca_get_event(dp, CACA_EVENT_ANY, &ev, 0);
     217        if(screen_list->attached)
     218            ret = caca_get_event(dp, CACA_EVENT_ANY, &ev, 0);
     219        else
     220            sleep(1);
    217221
    218222        if(ret && (caca_get_event_type(&ev) & CACA_EVENT_KEY_PRESS))
     
    279283                    screen_list->help = !screen_list->help;
    280284                    refresh = 1;
     285                    break;
     286                case 'd':
     287                case 0x04: //CACA_KEY_CTRL_D:
     288                    detach(screen_list, dp);
    281289                    break;
    282290                }
     
    392400        /* Resfresh screen */
    393401
    394         if(screen_list->locked)
     402        if(!screen_list->attached)
     403        {
     404            /* No need to refresh */
     405        }
     406        else if(screen_list->locked)
    395407        {
    396408            draw_lock(cv, screen_list);
  • neercs/trunk/src/neercs.h

    r2457 r2458  
    6262    int in_bell;                 /* Bell occuring in a window  */
    6363    int dont_update_coords;      /* Used by recurrents */
     64    int attached;                /* Are we attached to a terminal */
    6465
    6566    /* Lock */
     
    117118long long get_ms(void);
    118119
     120int detach(struct screen_list* screen_list, caca_display_t * dp);
    119121
    120122/* Screens management */
Note: See TracChangeset for help on using the changeset viewer.