/[emacs]/emacs/src/xsmfns.c
ViewVC logotype

Diff of /emacs/src/xsmfns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jhd, Thu Mar 14 21:36:28 2002 UTC revision 1.4 by pj, Thu Jun 13 14:59:14 2002 UTC
# Line 57  Boston, MA 02111-1307, USA.  */ Line 57  Boston, MA 02111-1307, USA.  */
57    
58  extern Lisp_Object Vuser_login_name;  extern Lisp_Object Vuser_login_name;
59    
60  /* This is the event used when save_session occurs */  /* This is the event used when SAVE_SESSION_EVENT occurs.  */
61    
62  static struct input_event emacs_event;  static struct input_event emacs_event;
63    
64  /* The descriptor that we use to check for data from the session manager. */  /* The descriptor that we use to check for data from the session manager.  */
65    
66  static int ice_fd = -1;  static int ice_fd = -1;
67    
68  /* A flag that says if we are in shutdown interactions or not. */  /* A flag that says if we are in shutdown interactions or not.  */
69    
70  static int doing_interact = False;  static int doing_interact = False;
71    
# Line 98  Lisp_Object Vx_session_previous_id; Line 98  Lisp_Object Vx_session_previous_id;
98     open to a session manager, just return 0.     open to a session manager, just return 0.
99     Otherwise returns the number of events stored in buffer BUFP,     Otherwise returns the number of events stored in buffer BUFP,
100     which can hold up to *NUMCHARS characters.  At most one event is     which can hold up to *NUMCHARS characters.  At most one event is
101     stored, an save_session_event. */     stored, an SAVE_SESSION_EVENT. */
102  int  int
103  x_session_check_input (bufp, numchars)  x_session_check_input (bufp, numchars)
104       struct input_event *bufp;       struct input_event *bufp;
# Line 117  x_session_check_input (bufp, numchars) Line 117  x_session_check_input (bufp, numchars)
117        
118    /* Reset this so wo can check kind after callbacks have been called by    /* Reset this so wo can check kind after callbacks have been called by
119       IceProcessMessages.  The smc_interact_CB sets the kind to       IceProcessMessages.  The smc_interact_CB sets the kind to
120       save_session_event, but we don't know beforehand if that callback       SAVE_SESSION_EVENT, but we don't know beforehand if that callback
121       will be called. */       will be called. */
122    emacs_event.kind = no_event;    emacs_event.kind = NO_EVENT;
123    
124    if (select (ice_fd+1, &read_fds,    if (select (ice_fd+1, &read_fds,
125                (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout) < 0)                (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout) < 0)
# Line 135  x_session_check_input (bufp, numchars) Line 135  x_session_check_input (bufp, numchars)
135    
136        
137    /* Check if smc_interact_CB was called and we shall generate a    /* Check if smc_interact_CB was called and we shall generate a
138       save_session event. */       SAVE_SESSION_EVENT. */
139    if (*numchars > 0 && emacs_event.kind != no_event)    if (*numchars > 0 && emacs_event.kind != NO_EVENT)
140      {      {
141        bcopy (&emacs_event, bufp, sizeof (struct input_event));        bcopy (&emacs_event, bufp, sizeof (struct input_event));
142        bufp++;        bufp++;
# Line 156  x_session_have_connection () Line 156  x_session_have_connection ()
156  }  }
157    
158  /* This is called when the session manager says it is OK to interact with the  /* This is called when the session manager says it is OK to interact with the
159     user.  Here we set the kind to save_session so an event is generated.     user.  Here we set the kind to SAVE_SESSION_EVENT so an event is generated.
160     Then lisp code can interact with the user. */     Then lisp code can interact with the user. */
161  static void  static void
162  smc_interact_CB (smcConn, clientData)  smc_interact_CB (smcConn, clientData)
# Line 164  smc_interact_CB (smcConn, clientData) Line 164  smc_interact_CB (smcConn, clientData)
164       SmPointer clientData;       SmPointer clientData;
165  {  {
166    doing_interact = True;    doing_interact = True;
167    emacs_event.kind = save_session_event;    emacs_event.kind = SAVE_SESSION_EVENT;
168  }  }
169    
170  /* This is called when the session manager tells us to save ourself.  /* This is called when the session manager tells us to save ourself.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26