/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/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/branches/seamlessrdp-branch/rdesktop/xwin.c

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

revision 332 by astrand, Tue Feb 18 13:51:43 2003 UTC revision 368 by matthewc, Wed Apr 16 13:48:17 2003 UTC
# Line 59  static BOOL xserver_be; Line 59  static BOOL xserver_be;
59  static BOOL ownbackstore;  static BOOL ownbackstore;
60  static Pixmap backstore;  static Pixmap backstore;
61    
62    /* Moving in single app mode */
63    static BOOL moving_wnd;
64    static int move_x_offset = 0;
65    static int move_y_offset = 0;
66    
67  /* MWM decorations */  /* MWM decorations */
68  #define MWM_HINTS_DECORATIONS   (1L << 1)  #define MWM_HINTS_DECORATIONS   (1L << 1)
69  #define PROP_MOTIF_WM_HINTS_ELEMENTS    5  #define PROP_MOTIF_WM_HINTS_ELEMENTS    5
# Line 397  translate24to32(uint8 * data, uint32 * o Line 402  translate24to32(uint8 * data, uint32 * o
402          uint32 pixel = 0;          uint32 pixel = 0;
403          while (out < end)          while (out < end)
404          {          {
405                  memcpy(&pixel, data, 3);                  pixel = *(data++);
406                  data += 3;                  pixel |= *(data++) << 8;
407                    pixel |= *(data++) << 16;
408                  *(out++) = pixel;                  *(out++) = pixel;
409          }          }
410  }  }
# Line 858  xwin_process_events(void) Line 864  xwin_process_events(void)
864                                  /* If win_button_size is nonzero, enable single app mode */                                  /* If win_button_size is nonzero, enable single app mode */
865                                  if (xevent.xbutton.y < win_button_size)                                  if (xevent.xbutton.y < win_button_size)
866                                  {                                  {
867                                          /* Check from right to left: */                                          /* Stop moving window when button is released, regardless of cursor position */
868                                            if (moving_wnd && (xevent.type == ButtonRelease))
869                                                    moving_wnd = False;
870    
871                                            /*  Check from right to left: */
872    
873                                          if (xevent.xbutton.x >= width - win_button_size)                                          if (xevent.xbutton.x >= width - win_button_size)
874                                          {                                          {
# Line 880  xwin_process_events(void) Line 890  xwin_process_events(void)
890                                                                 DefaultScreen(display));                                                                 DefaultScreen(display));
891                                                  break;                                                  break;
892                                          }                                          }
893                                            else if (xevent.xbutton.x <= win_button_size)
894                                            {
895                                                    /* The system menu. Ignore. */
896                                                    break;
897                                            }
898                                          else                                          else
899                                          {                                          {
900                                                  /* Ignore clicks to the rest of the border. This includes                                                  /* The title bar. */
901                                                     the system menu, but also inhibits double clicks on the                                                  if ((xevent.type == ButtonPress) && !fullscreen
902                                                     border itself. */                                                      && hide_decorations)
903                                                    {
904                                                            moving_wnd = True;
905                                                            move_x_offset = xevent.xbutton.x;
906                                                            move_y_offset = xevent.xbutton.y;
907                                                    }
908                                                  break;                                                  break;
909    
910                                          }                                          }
911                                  }                                  }
912    
# Line 894  xwin_process_events(void) Line 915  xwin_process_events(void)
915                                  break;                                  break;
916    
917                          case MotionNotify:                          case MotionNotify:
918                                    if (moving_wnd)
919                                    {
920                                            XMoveWindow(display, wnd,
921                                                        xevent.xmotion.x_root - move_x_offset,
922                                                        xevent.xmotion.y_root - move_y_offset);
923                                            break;
924                                    }
925    
926                                  if (fullscreen && !focused)                                  if (fullscreen && !focused)
927                                          XSetInputFocus(display, wnd, RevertToPointerRoot,                                          XSetInputFocus(display, wnd, RevertToPointerRoot,
928                                                         CurrentTime);                                                         CurrentTime);

Legend:
Removed from v.332  
changed lines
  Added in v.368

  ViewVC Help
Powered by ViewVC 1.1.26