/[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 188 by matthewc, Tue Sep 24 06:09:09 2002 UTC revision 194 by matthewc, Tue Sep 24 12:25:21 2002 UTC
# Line 22  Line 22 
22  #include <X11/Xutil.h>  #include <X11/Xutil.h>
23  #include <time.h>  #include <time.h>
24  #include <errno.h>  #include <errno.h>
 #define XK_MISCELLANY  
 #include <X11/keysymdef.h>  
25  #include "rdesktop.h"  #include "rdesktop.h"
 #include "scancodes.h"  
26    
27  extern int width;  extern int width;
28  extern int height;  extern int height;
# Line 220  get_key_state(int keysym) Line 217  get_key_state(int keysym)
217  }  }
218    
219  BOOL  BOOL
220  ui_init()  ui_init(void)
221  {  {
222          XPixmapFormatValues *pfm;          XPixmapFormatValues *pfm;
223          uint16 test;          uint16 test;
# Line 296  ui_init() Line 293  ui_init()
293  }  }
294    
295  void  void
296  ui_deinit()  ui_deinit(void)
297  {  {
298          if (IM != NULL)          if (IM != NULL)
299                  XCloseIM(IM);                  XCloseIM(IM);
# Line 310  ui_deinit() Line 307  ui_deinit()
307  }  }
308    
309  BOOL  BOOL
310  ui_create_window()  ui_create_window(void)
311  {  {
312          XSetWindowAttributes attribs;          XSetWindowAttributes attribs;
313          XClassHint *classhints;          XClassHint *classhints;
# Line 353  ui_create_window() Line 350  ui_create_window()
350          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
351                  StructureNotifyMask | FocusChangeMask;                  StructureNotifyMask | FocusChangeMask;
352    
         if (grab_keyboard)  
                 input_mask |= EnterWindowMask | LeaveWindowMask;  
353          if (sendmotion)          if (sendmotion)
354                  input_mask |= PointerMotionMask;                  input_mask |= PointerMotionMask;
355          if (ownbackstore)          if (ownbackstore)
# Line 384  ui_create_window() Line 379  ui_create_window()
379  }  }
380    
381  void  void
382  ui_destroy_window()  ui_destroy_window(void)
383  {  {
384          if (IC != NULL)          if (IC != NULL)
385                  XDestroyIC(IC);                  XDestroyIC(IC);
# Line 393  ui_destroy_window() Line 388  ui_destroy_window()
388  }  }
389    
390  void  void
391  xwin_toggle_fullscreen()  xwin_toggle_fullscreen(void)
392  {  {
393          Pixmap contents = 0;          Pixmap contents = 0;
394    
# Line 419  xwin_toggle_fullscreen() Line 414  xwin_toggle_fullscreen()
414    
415  /* Process all events in Xlib queue */  /* Process all events in Xlib queue */
416  static void  static void
417  xwin_process_events()  xwin_process_events(void)
418  {  {
419          XEvent xevent;          XEvent xevent;
420          KeySym keysym;          KeySym keysym;
# Line 521  xwin_process_events() Line 516  xwin_process_events()
516                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);
517                                  break;                                  break;
518    
519                          case EnterNotify:                          case FocusIn:
520                                    reset_modifier_keys();
521                                  if (grab_keyboard)                                  if (grab_keyboard)
522                                          XGrabKeyboard(display, wnd, True,                                          XGrabKeyboard(display, wnd, True,
523                                                        GrabModeAsync, GrabModeAsync, CurrentTime);                                                        GrabModeAsync, GrabModeAsync, CurrentTime);
524                                  break;                                  break;
525    
526                          case LeaveNotify:                          case FocusOut:
527                                  if (grab_keyboard)                                  if (grab_keyboard)
528                                          XUngrabKeyboard(display, CurrentTime);                                          XUngrabKeyboard(display, CurrentTime);
529                                  break;                                  break;
530    
                         case FocusIn:  
                                 reset_modifier_keys();  
                                 break;  
   
531                          case Expose:                          case Expose:
532                                  XCopyArea(display, backstore, wnd, gc,                                  XCopyArea(display, backstore, wnd, gc,
533                                            xevent.xexpose.x, xevent.xexpose.y,                                            xevent.xexpose.x, xevent.xexpose.y,
# Line 855  ui_set_clip(int x, int y, int cx, int cy Line 847  ui_set_clip(int x, int y, int cx, int cy
847  }  }
848    
849  void  void
850  ui_reset_clip()  ui_reset_clip(void)
851  {  {
852          XRectangle rect;          XRectangle rect;
853    
# Line 867  ui_reset_clip() Line 859  ui_reset_clip()
859  }  }
860    
861  void  void
862  ui_bell()  ui_bell(void)
863  {  {
864          XBell(display, 0);          XBell(display, 0);
865  }  }

Legend:
Removed from v.188  
changed lines
  Added in v.194

  ViewVC Help
Powered by ViewVC 1.1.26