/[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 118 by astrand, Wed Sep 11 11:45:20 2002 UTC revision 119 by astrand, Thu Sep 12 09:38:31 2002 UTC
# Line 517  toggle_fullscreen() Line 517  toggle_fullscreen()
517          XFreePixmap(display, pixmap);          XFreePixmap(display, pixmap);
518  }  }
519    
520    /* Process all events in Xlib queue */
521  static void  static void
522  xwin_process_events()  xwin_process_events()
523  {  {
# Line 530  xwin_process_events() Line 531  xwin_process_events()
531          char str[256];          char str[256];
532          Status status;          Status status;
533    
         /* Refresh keyboard mapping if it has changed. This is important for  
            Xvnc, since it allocates keycodes dynamically */  
         if (XCheckTypedEvent(display, MappingNotify, &xevent))  
         {  
                 if (xevent.xmapping.request == MappingKeyboard  
                     || xevent.xmapping.request == MappingModifier)  
                         XRefreshKeyboardMapping(&xevent.xmapping);  
         }  
   
534          while (XCheckMaskEvent(display, ~0, &xevent))          while (XCheckMaskEvent(display, ~0, &xevent))
535          {          {
536                  if (enable_compose && (XFilterEvent(&xevent, None) == True))                  if (enable_compose && (XFilterEvent(&xevent, None) == True))
# Line 651  xwin_process_events() Line 643  xwin_process_events()
643                                            xevent.xexpose.height,                                            xevent.xexpose.height,
644                                            xevent.xexpose.x, xevent.xexpose.y);                                            xevent.xexpose.x, xevent.xexpose.y);
645                                  break;                                  break;
646    
647                            case MappingNotify:
648                                    /* Refresh keyboard mapping if it has changed. This is important for
649                                       Xvnc, since it allocates keycodes dynamically */
650                                    if (xevent.xmapping.request == MappingKeyboard
651                                        || xevent.xmapping.request == MappingModifier)
652                                            XRefreshKeyboardMapping(&xevent.xmapping);
653                                    break;
654    
655                  }                  }
656          }          }
657  }  }
# Line 660  ui_select(int rdp_socket) Line 661  ui_select(int rdp_socket)
661  {  {
662          int n = (rdp_socket > x_socket) ? rdp_socket + 1 : x_socket + 1;          int n = (rdp_socket > x_socket) ? rdp_socket + 1 : x_socket + 1;
663          fd_set rfds;          fd_set rfds;
664            XEvent xevent;
665    
666          FD_ZERO(&rfds);          FD_ZERO(&rfds);
667    
668          while (True)          while (True)
669          {          {
670                    /* Process any events already in queue */
671                    xwin_process_events();
672    
673                  FD_ZERO(&rfds);                  FD_ZERO(&rfds);
674                  FD_SET(rdp_socket, &rfds);                  FD_SET(rdp_socket, &rfds);
675                  if (display != NULL)                  if (display != NULL)
# Line 683  ui_select(int rdp_socket) Line 688  ui_select(int rdp_socket)
688                  }                  }
689    
690                  if (FD_ISSET(x_socket, &rfds))                  if (FD_ISSET(x_socket, &rfds))
691                          xwin_process_events();                  {
692                            /* Move new events from socket to queue */
693                            XPeekEvent(display, &xevent);
694                            continue;
695                    }
696    
697                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
698                          return;                          return;

Legend:
Removed from v.118  
changed lines
  Added in v.119

  ViewVC Help
Powered by ViewVC 1.1.26