/[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 318 by astrand, Mon Feb 10 12:58:51 2003 UTC revision 331 by astrand, Tue Feb 18 13:44:27 2003 UTC
# Line 32  extern BOOL grab_keyboard; Line 32  extern BOOL grab_keyboard;
32  extern BOOL hide_decorations;  extern BOOL hide_decorations;
33  extern char title[];  extern char title[];
34  extern int server_bpp;  extern int server_bpp;
35    extern int win_button_size;
36  BOOL enable_compose = False;  BOOL enable_compose = False;
37  BOOL focused;  BOOL focused;
38  BOOL mouse_in_wnd;  BOOL mouse_in_wnd;
# Line 122  static int rop2_map[] = { Line 123  static int rop2_map[] = {
123  #define SET_FUNCTION(rop2)      { if (rop2 != ROP2_COPY) XSetFunction(display, gc, rop2_map[rop2]); }  #define SET_FUNCTION(rop2)      { if (rop2 != ROP2_COPY) XSetFunction(display, gc, rop2_map[rop2]); }
124  #define RESET_FUNCTION(rop2)    { if (rop2 != ROP2_COPY) XSetFunction(display, gc, GXcopy); }  #define RESET_FUNCTION(rop2)    { if (rop2 != ROP2_COPY) XSetFunction(display, gc, GXcopy); }
125    
126  void  static void
127  mwm_hide_decorations(void)  mwm_hide_decorations(void)
128  {  {
129          PropMotifWmHints motif_hints;          PropMotifWmHints motif_hints;
# Line 144  mwm_hide_decorations(void) Line 145  mwm_hide_decorations(void)
145                          (unsigned char *) &motif_hints, PROP_MOTIF_WM_HINTS_ELEMENTS);                          (unsigned char *) &motif_hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
146  }  }
147    
148  PixelColour  static PixelColour
149  split_colour15(uint32 colour)  split_colour15(uint32 colour)
150  {  {
151          PixelColour rv;          PixelColour rv;
# Line 157  split_colour15(uint32 colour) Line 158  split_colour15(uint32 colour)
158          return rv;          return rv;
159  }  }
160    
161  PixelColour  static PixelColour
162  split_colour16(uint32 colour)  split_colour16(uint32 colour)
163  {  {
164          PixelColour rv;          PixelColour rv;
# Line 170  split_colour16(uint32 colour) Line 171  split_colour16(uint32 colour)
171          return rv;          return rv;
172  }  }
173    
174  PixelColour  static PixelColour
175  split_colour24(uint32 colour)  split_colour24(uint32 colour)
176  {  {
177          PixelColour rv;          PixelColour rv;
# Line 180  split_colour24(uint32 colour) Line 181  split_colour24(uint32 colour)
181          return rv;          return rv;
182  }  }
183    
184  uint32  static uint32
185  make_colour16(PixelColour pc)  make_colour16(PixelColour pc)
186  {  {
187          pc.red = (pc.red * 0x1f) / 0xff;          pc.red = (pc.red * 0x1f) / 0xff;
# Line 189  make_colour16(PixelColour pc) Line 190  make_colour16(PixelColour pc)
190          return (pc.red << 11) | (pc.green << 5) | pc.blue;          return (pc.red << 11) | (pc.green << 5) | pc.blue;
191  }  }
192    
193  uint32  static uint32
194  make_colour24(PixelColour pc)  make_colour24(PixelColour pc)
195  {  {
196          return (pc.red << 16) | (pc.green << 8) | pc.blue;          return (pc.red << 16) | (pc.green << 8) | pc.blue;
197  }  }
198    
199  uint32  static uint32
200  make_colour32(PixelColour pc)  make_colour32(PixelColour pc)
201  {  {
202          return (pc.red << 16) | (pc.green << 8) | pc.blue;          return (pc.red << 16) | (pc.green << 8) | pc.blue;
# Line 854  xwin_process_events(void) Line 855  xwin_process_events(void)
855                                  if (button == 0)                                  if (button == 0)
856                                          break;                                          break;
857    
858                                    /* If win_button_size is nonzero, enable single app mode */
859                                    if (xevent.xbutton.y < win_button_size)
860                                    {
861                                            if (xevent.xbutton.x < win_button_size)
862                                            {
863                                                    /* The system menu, do not send to server */
864                                                    break;
865                                            }
866                                            else if (xevent.xbutton.x >= width - win_button_size)
867                                            {
868                                                    /* The close button, continue */
869                                                    ;
870                                            }
871                                            else if (xevent.xbutton.x >= width - win_button_size * 2)
872                                            {
873                                                    /* The maximize/restore button. Do not send to
874                                                       server.  It might be a good idea to change the
875                                                       cursor or give some other visible indication
876                                                       that rdesktop inhibited this click */
877                                                    break;
878                                            }
879                                            else if (xevent.xbutton.x >= width - win_button_size * 3)
880                                            {
881                                                    /* The minimize button. Iconify window. */
882                                                    XIconifyWindow(display, wnd,
883                                                                   DefaultScreen(display));
884                                                    break;
885                                            }
886                                    }
887    
888                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,
889                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);
890                                  break;                                  break;

Legend:
Removed from v.318  
changed lines
  Added in v.331

  ViewVC Help
Powered by ViewVC 1.1.26