/[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 82 by astrand, Tue Jul 30 07:18:48 2002 UTC revision 99 by jsorg71, Tue Aug 20 01:20:08 2002 UTC
# Line 270  ui_create_window(char *title) Line 270  ui_create_window(char *title)
270          Screen *screen;          Screen *screen;
271          uint16 test;          uint16 test;
272          int i;          int i;
273            XEvent xevent;
274    
275          x_socket = ConnectionNumber(display);          x_socket = ConnectionNumber(display);
276          screen = DefaultScreenOfDisplay(display);          screen = DefaultScreenOfDisplay(display);
# Line 354  ui_create_window(char *title) Line 355  ui_create_window(char *title)
355    
356          xkeymap_init2();          xkeymap_init2();
357    
358          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
359                            VisibilityChangeMask | FocusChangeMask;
360          if (grab_keyboard)          if (grab_keyboard)
361                  input_mask |= EnterWindowMask | LeaveWindowMask;                  input_mask |= EnterWindowMask | LeaveWindowMask;
362          if (sendmotion)          if (sendmotion)
# Line 375  ui_create_window(char *title) Line 377  ui_create_window(char *title)
377    
378          XMapWindow(display, wnd);          XMapWindow(display, wnd);
379    
380            /* Wait for VisibilityNotify Event */
381            for (;;) {
382                    XNextEvent(display, &xevent);
383                    if (xevent.type == VisibilityNotify)
384                            break;
385            }
386    
387            /* clear the window so that cached data is not viewed upon start... */
388            XSetBackground(display, gc, 0);
389            XSetForeground(display, gc, 0);
390            FILL_RECTANGLE(0, 0, width, height);
391    
392          return True;          return True;
393  }  }
394    
# Line 419  xwin_process_events() Line 433  xwin_process_events()
433          {          {
434                  if (enable_compose && (XFilterEvent(&xevent, None) == True))                  if (enable_compose && (XFilterEvent(&xevent, None) == True))
435                  {                  {
436                          DEBUG_KBD("Filtering event\n");                          DEBUG_KBD(("Filtering event\n"));
437                          continue;                          continue;
438                  }                  }
439    
# Line 445  xwin_process_events() Line 459  xwin_process_events()
459                                  else                                  else
460                                  {                                  {
461                                          /* Plain old XLookupString */                                          /* Plain old XLookupString */
462                                          DEBUG_KBD("No input context, using XLookupString\n");                                          DEBUG_KBD(("No input context, using XLookupString\n"));
463                                          XLookupString((XKeyEvent *) & xevent,                                          XLookupString((XKeyEvent *) & xevent,
464                                                        str, sizeof(str), &keysym, NULL);                                                        str, sizeof(str), &keysym, NULL);
465                                  }                                  }
466    
467                                  ksname = get_ksname(keysym);                                  ksname = get_ksname(keysym);
468                                  DEBUG_KBD("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname);                                  DEBUG_KBD(("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname));
469    
470                                  if (inhibit_key(keysym))                                  if (inhibit_key(keysym))
471                                  {                                  {
472                                          DEBUG_KBD("Inhibiting key\n");                                          DEBUG_KBD(("Inhibiting key\n"));
473                                          break;                                          break;
474                                  }                                  }
475    
# Line 474  xwin_process_events() Line 488  xwin_process_events()
488                                                sizeof(str), &keysym, NULL);                                                sizeof(str), &keysym, NULL);
489    
490                                  ksname = get_ksname(keysym);                                  ksname = get_ksname(keysym);
491                                  DEBUG_KBD("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym, ksname);                                  DEBUG_KBD(("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym,
492                                               ksname));
493    
494                                  if (inhibit_key(keysym))                                  if (inhibit_key(keysym))
495                                          break;                                          break;
# Line 516  xwin_process_events() Line 531  xwin_process_events()
531    
532                          case FocusOut:                          case FocusOut:
533                                  /* reset keys */                                  /* reset keys */
534                                  rdp_send_input(ev_time, RDP_INPUT_SCANCODE,                                  rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL);
535                                                 KBD_FLAG_DOWN | KBD_FLAG_UP, SCANCODE_CHAR_LCTRL, 0);                                  rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT);
536                                  rdp_send_input(ev_time, RDP_INPUT_SCANCODE,                                  rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
537                                                 KBD_FLAG_DOWN | KBD_FLAG_UP, SCANCODE_CHAR_LALT, 0);                                  rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL);
538                                    rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT);
539                                    rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
540                                  /* fall through */                                  /* fall through */
541                          case LeaveNotify:                          case LeaveNotify:
542                                  if (grab_keyboard)                                  if (grab_keyboard)

Legend:
Removed from v.82  
changed lines
  Added in v.99

  ViewVC Help
Powered by ViewVC 1.1.26