/[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 157 by matthewc, Sun Sep 15 11:39:16 2002 UTC revision 182 by astrand, Tue Sep 17 16:55:43 2002 UTC
# Line 351  ui_init() Line 351  ui_init()
351                  height = HeightOfScreen(screen);                  height = HeightOfScreen(screen);
352          }          }
353    
354            /* make sure width is a multiple of 4 */
355            width = (width + 3) & ~3;
356    
357          xkeymap_init();          xkeymap_init();
358          return True;          return True;
359  }  }
# Line 432  ui_destroy_window() Line 435  ui_destroy_window()
435          display = NULL;          display = NULL;
436  }  }
437    
 static void  
 xwin_reset_keys()  
 {  
         /* reset keys */  
         uint32 ev_time;  
         ev_time = time(NULL);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT);  
         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);  
 }  
438    
439  void  void
440  xwin_toggle_fullscreen()  xwin_toggle_fullscreen()
# Line 454  xwin_toggle_fullscreen() Line 444  xwin_toggle_fullscreen()
444          int newwidth, newheight;          int newwidth, newheight;
445    
446          fullscreen = !fullscreen;          fullscreen = !fullscreen;
447          newwidth  = fullscreen ? WidthOfScreen(screen) : width;          newwidth = fullscreen ? WidthOfScreen(screen) : width;
448          newheight = fullscreen ? HeightOfScreen(screen) : height;          newheight = fullscreen ? HeightOfScreen(screen) : height;
449    
450          XUnmapWindow(display, wnd);          XUnmapWindow(display, wnd);
# Line 509  xwin_process_events() Line 499  xwin_process_events()
499                                  else                                  else
500                                  {                                  {
501                                          /* Plain old XLookupString */                                          /* Plain old XLookupString */
502                                          DEBUG_KBD(("No input context, using XLookupString\n"));                                          DEBUG_KBD(("\nNo input context, using XLookupString\n"));
503                                          XLookupString((XKeyEvent *) & xevent,                                          XLookupString((XKeyEvent *) & xevent,
504                                                        str, sizeof(str), &keysym, NULL);                                                        str, sizeof(str), &keysym, NULL);
505                                  }                                  }
506    
507                                  ksname = get_ksname(keysym);                                  ksname = get_ksname(keysym);
508                                  DEBUG_KBD(("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname));                                  DEBUG_KBD(("KeyPress for (keysym 0x%lx, %s)\n", keysym, ksname));
509    
510                                  if (handle_special_keys(keysym, ev_time, True))                                  if (handle_special_keys(keysym, ev_time, True))
511                                          break;                                          break;
# Line 568  xwin_process_events() Line 558  xwin_process_events()
558                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);
559                                  break;                                  break;
560    
                         case FocusIn:  
                                 /* fall through */  
561                          case EnterNotify:                          case EnterNotify:
562                                  if (grab_keyboard)                                  if (grab_keyboard)
563                                          XGrabKeyboard(display, wnd, True,                                          XGrabKeyboard(display, wnd, True,
564                                                        GrabModeAsync, GrabModeAsync, CurrentTime);                                                        GrabModeAsync, GrabModeAsync, CurrentTime);
565                                  break;                                  break;
566    
                         case FocusOut:  
                                 xwin_reset_keys();  
                                 /* fall through */  
567                          case LeaveNotify:                          case LeaveNotify:
568                                  if (grab_keyboard)                                  if (grab_keyboard)
569                                          XUngrabKeyboard(display, CurrentTime);                                          XUngrabKeyboard(display, CurrentTime);
570                                  break;                                  break;
571    
572                            case FocusIn:
573                                    reset_modifier_keys();
574                                    break;
575    
576                          case Expose:                          case Expose:
577                                  XCopyArea(display, backstore, wnd, gc,                                  XCopyArea(display, backstore, wnd, gc,
578                                            xevent.xexpose.x, xevent.xexpose.y,                                            xevent.xexpose.x, xevent.xexpose.y,

Legend:
Removed from v.157  
changed lines
  Added in v.182

  ViewVC Help
Powered by ViewVC 1.1.26