/[rdesktop]/sourceforge.net/trunk/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xwin.c

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

revision 274 by astrand, Tue Nov 19 14:45:13 2002 UTC revision 275 by astrand, Tue Nov 19 14:48:02 2002 UTC
# Line 47  static XIM IM; Line 47  static XIM IM;
47  static XIC IC;  static XIC IC;
48  static XModifierKeymap *mod_map;  static XModifierKeymap *mod_map;
49  static Cursor current_cursor;  static Cursor current_cursor;
50    static Atom protocol_atom, kill_atom;
51    
52  /* endianness */  /* endianness */
53  static BOOL host_be;  static BOOL host_be;
# Line 436  ui_create_window(void) Line 437  ui_create_window(void)
437          focused = False;          focused = False;
438          mouse_in_wnd = False;          mouse_in_wnd = False;
439    
440            /* handle the WM_DELETE_WINDOW protocol */
441            protocol_atom = XInternAtom(display, "WM_PROTOCOLS", True);
442            kill_atom = XInternAtom(display, "WM_DELETE_WINDOW", True);
443            XSetWMProtocols(display, wnd, &kill_atom, 1);
444    
445          return True;          return True;
446  }  }
447    
# Line 473  xwin_toggle_fullscreen(void) Line 479  xwin_toggle_fullscreen(void)
479          }          }
480  }  }
481    
482  /* Process all events in Xlib queue */  /* Process all events in Xlib queue
483  static void     Returns 0 after user quit, 1 otherwise */
484    static int
485  xwin_process_events(void)  xwin_process_events(void)
486  {  {
487          XEvent xevent;          XEvent xevent;
# Line 502  xwin_process_events(void) Line 509  xwin_process_events(void)
509    
510                  switch (xevent.type)                  switch (xevent.type)
511                  {                  {
512                            case ClientMessage:
513                                    /* the window manager told us to quit */
514                                    if ((xevent.xclient.message_type == protocol_atom)
515                                        && (xevent.xclient.data.l[0] == kill_atom))
516                                            /* Quit */
517                                            return 0;
518                                    break;
519    
520                          case KeyPress:                          case KeyPress:
521                                  if (IC != NULL)                                  if (IC != NULL)
522                                          /* Multi_key compatible version */                                          /* Multi_key compatible version */
# Line 645  xwin_process_events(void) Line 660  xwin_process_events(void)
660    
661                  }                  }
662          }          }
663            /* Keep going */
664            return 1;
665  }  }
666    
667  void  /* Returns 0 after user quit, 1 otherwise */
668    int
669  ui_select(int rdp_socket)  ui_select(int rdp_socket)
670  {  {
671          int n = (rdp_socket > x_socket) ? rdp_socket + 1 : x_socket + 1;          int n = (rdp_socket > x_socket) ? rdp_socket + 1 : x_socket + 1;
# Line 658  ui_select(int rdp_socket) Line 676  ui_select(int rdp_socket)
676          while (True)          while (True)
677          {          {
678                  /* Process any events already waiting */                  /* Process any events already waiting */
679                  xwin_process_events();                  if (!xwin_process_events())
680                            /* User quit */
681                            return 0;
682    
683                  FD_ZERO(&rfds);                  FD_ZERO(&rfds);
684                  FD_SET(rdp_socket, &rfds);                  FD_SET(rdp_socket, &rfds);
# Line 674  ui_select(int rdp_socket) Line 694  ui_select(int rdp_socket)
694                  }                  }
695    
696                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
697                          return;                          return 1;
698          }          }
699  }  }
700    

Legend:
Removed from v.274  
changed lines
  Added in v.275

  ViewVC Help
Powered by ViewVC 1.1.26