/[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 281 by jsorg71, Mon Dec 2 22:57:47 2002 UTC revision 301 by matthewc, Thu Jan 30 11:28:50 2003 UTC
# Line 62  static Pixmap backstore; Line 62  static Pixmap backstore;
62  #define PROP_MOTIF_WM_HINTS_ELEMENTS    5  #define PROP_MOTIF_WM_HINTS_ELEMENTS    5
63  typedef struct  typedef struct
64  {  {
65          unsigned long flags;          uint32 flags;
66          unsigned long functions;          uint32 functions;
67          unsigned long decorations;          uint32 decorations;
68          long inputMode;          sint32 inputMode;
69          unsigned long status;          uint32 status;
70  }  }
71  PropMotifWmHints;  PropMotifWmHints;
72    
# Line 78  PropMotifWmHints; Line 78  PropMotifWmHints;
78                  XFillRectangle(display, backstore, gc, x, y, cx, cy); \                  XFillRectangle(display, backstore, gc, x, y, cx, cy); \
79  }  }
80    
81  #define FILL_RECTANGLE_FAST(x,y,cx,cy)\  #define FILL_RECTANGLE_BACKSTORE(x,y,cx,cy)\
82  { \  { \
83          XFillRectangle(display, ownbackstore ? backstore : wnd, gc, x, y, cx, cy); \          XFillRectangle(display, ownbackstore ? backstore : wnd, gc, x, y, cx, cy); \
84  }  }
# Line 128  mwm_hide_decorations(void) Line 128  mwm_hide_decorations(void)
128          hintsatom = XInternAtom(display, "_MOTIF_WM_HINTS", False);          hintsatom = XInternAtom(display, "_MOTIF_WM_HINTS", False);
129          if (!hintsatom)          if (!hintsatom)
130          {          {
131                  error("Failed to get atom _MOTIF_WM_HINTS\n");                  warning("Failed to get atom _MOTIF_WM_HINTS: probably your window manager does not support MWM hints\n");
132                  return;                  return;
133          }          }
134    
# Line 300  ui_init(void) Line 300  ui_init(void)
300          {          {
301                  xcolmap = DefaultColormapOfScreen(screen);                  xcolmap = DefaultColormapOfScreen(screen);
302                  if (depth <= 8)                  if (depth <= 8)
303                  {                          warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n");
                         printf("You're using a screen depth of 8-bits or lower\n");  
                         printf("If you get scewed colours, try the -C switch\n");  
                 }  
304          }          }
305    
306          gc = XCreateGC(display, RootWindowOfScreen(screen), 0, NULL);          gc = XCreateGC(display, RootWindowOfScreen(screen), 0, NULL);
# Line 318  ui_init(void) Line 315  ui_init(void)
315          if ((width == 0) || (height == 0))          if ((width == 0) || (height == 0))
316          {          {
317                  /* Fetch geometry from _NET_WORKAREA */                  /* Fetch geometry from _NET_WORKAREA */
318                  uint32 xpos, ypos;                  uint32 x, y, cx, cy;
319    
320                  if (get_current_workarea(&xpos, &ypos, &width, &height) < 0)                  if (get_current_workarea(&x, &y, &cx, &cy) == 0)
321                  {                  {
322                          error("Failed to get workarea.\n");                          width = cx;
323                          error("Perhaps your window manager does not support EWMH?\n");                          height = cy;
324                          error("Defaulting to geometry 800x600\n");                  }
325                    else
326                    {
327                            warning("Failed to get workarea: probably your window manager does not support extended hints\n");
328                          width = 800;                          width = 800;
329                          height = 600;                          height = 600;
330                  }                  }
# Line 607  xwin_process_events(void) Line 607  xwin_process_events(void)
607                                  break;                                  break;
608    
609                          case MotionNotify:                          case MotionNotify:
610                                    if (fullscreen && !focused)
611                                            XSetInputFocus(display, wnd, RevertToPointerRoot,
612                                                           CurrentTime);
613                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,
614                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);
615                                  break;                                  break;
# Line 1189  ui_draw_glyph(int mixmode, Line 1192  ui_draw_glyph(int mixmode,
1192          XSetStipple(display, gc, (Pixmap) glyph);          XSetStipple(display, gc, (Pixmap) glyph);
1193          XSetTSOrigin(display, gc, x, y);          XSetTSOrigin(display, gc, x, y);
1194    
1195          FILL_RECTANGLE_FAST(x, y, cx, cy);          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
1196    
1197          XSetFillStyle(display, gc, FillSolid);          XSetFillStyle(display, gc, FillSolid);
1198  }  }
# Line 1218  ui_draw_glyph(int mixmode, Line 1221  ui_draw_glyph(int mixmode,
1221      }\      }\
1222    if (glyph != NULL)\    if (glyph != NULL)\
1223      {\      {\
1224        ui_draw_glyph (mixmode, x + (short) glyph->offset,\        ui_draw_glyph (mixmode, x + glyph->offset,\
1225                       y + (short) glyph->baseline,\                       y + glyph->baseline,\
1226                       glyph->width, glyph->height,\                       glyph->width, glyph->height,\
1227                       glyph->pixmap, 0, 0, bgcolour, fgcolour);\                       glyph->pixmap, 0, 0, bgcolour, fgcolour);\
1228        if (flags & TEXT2_IMPLICIT_X)\        if (flags & TEXT2_IMPLICIT_X)\
# Line 1241  ui_draw_text(uint8 font, uint8 flags, in Line 1244  ui_draw_text(uint8 font, uint8 flags, in
1244    
1245          if (boxcx > 1)          if (boxcx > 1)
1246          {          {
1247                  FILL_RECTANGLE_FAST(boxx, boxy, boxcx, boxcy);                  FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy);
1248          }          }
1249          else if (mixmode == MIX_OPAQUE)          else if (mixmode == MIX_OPAQUE)
1250          {          {
1251                  FILL_RECTANGLE_FAST(clipx, clipy, clipcx, clipcy);                  FILL_RECTANGLE_BACKSTORE(clipx, clipy, clipcx, clipcy);
1252          }          }
1253    
1254          /* Paint text, character by character */          /* Paint text, character by character */
# Line 1279  ui_draw_text(uint8 font, uint8 flags, in Line 1282  ui_draw_text(uint8 font, uint8 flags, in
1282                                                  else                                                  else
1283                                                          x += text[i + 2];                                                          x += text[i + 2];
1284                                          }                                          }
                                         if (i + 2 < length)  
                                                 i += 3;  
                                         else  
                                                 i += 2;  
                                         length -= i;  
                                         /* this will move pointer from start to first character after FE command */  
                                         text = &(text[i]);  
                                         i = 0;  
1285                                          for (j = 0; j < entry->size; j++)                                          for (j = 0; j < entry->size; j++)
1286                                                  DO_GLYPH(((uint8 *) (entry->data)), j);                                                  DO_GLYPH(((uint8 *) (entry->data)), j);
1287                                  }                                  }
1288                                    if (i + 2 < length)
1289                                            i += 3;
1290                                    else
1291                                            i += 2;
1292                                    length -= i;
1293                                    /* this will move pointer from start to first character after FE command */
1294                                    text = &(text[i]);
1295                                    i = 0;
1296                                  break;                                  break;
1297    
1298                          default:                          default:

Legend:
Removed from v.281  
changed lines
  Added in v.301

  ViewVC Help
Powered by ViewVC 1.1.26