/[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 332 by astrand, Tue Feb 18 13:51:43 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                                            /* Check from right to left: */
862    
863                                            if (xevent.xbutton.x >= width - win_button_size)
864                                            {
865                                                    /* The close button, continue */
866                                                    ;
867                                            }
868                                            else if (xevent.xbutton.x >= width - win_button_size * 2)
869                                            {
870                                                    /* The maximize/restore button. Do not send to
871                                                       server.  It might be a good idea to change the
872                                                       cursor or give some other visible indication
873                                                       that rdesktop inhibited this click */
874                                                    break;
875                                            }
876                                            else if (xevent.xbutton.x >= width - win_button_size * 3)
877                                            {
878                                                    /* The minimize button. Iconify window. */
879                                                    XIconifyWindow(display, wnd,
880                                                                   DefaultScreen(display));
881                                                    break;
882                                            }
883                                            else
884                                            {
885                                                    /* Ignore clicks to the rest of the border. This includes
886                                                       the system menu, but also inhibits double clicks on the
887                                                       border itself. */
888                                                    break;
889                                            }
890                                    }
891    
892                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,
893                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);
894                                  break;                                  break;

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

  ViewVC Help
Powered by ViewVC 1.1.26