/[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 299 by matthewc, Thu Jan 30 11:15:00 2003 UTC
# 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 322  ui_init(void) Line 319  ui_init(void)
319    
320                  if (get_current_workarea(&xpos, &ypos, &width, &height) < 0)                  if (get_current_workarea(&xpos, &ypos, &width, &height) < 0)
321                  {                  {
322                          error("Failed to get workarea.\n");                          warning("Failed to get workarea: probably your window manager does not support extended hints\n");
                         error("Perhaps your window manager does not support EWMH?\n");  
                         error("Defaulting to geometry 800x600\n");  
323                          width = 800;                          width = 800;
324                          height = 600;                          height = 600;
325                  }                  }
# Line 607  xwin_process_events(void) Line 602  xwin_process_events(void)
602                                  break;                                  break;
603    
604                          case MotionNotify:                          case MotionNotify:
605                                    if (fullscreen && !focused)
606                                            XSetInputFocus(display, wnd, RevertToPointerRoot,
607                                                           CurrentTime);
608                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,
609                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);                                                 MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y);
610                                  break;                                  break;
# Line 1189  ui_draw_glyph(int mixmode, Line 1187  ui_draw_glyph(int mixmode,
1187          XSetStipple(display, gc, (Pixmap) glyph);          XSetStipple(display, gc, (Pixmap) glyph);
1188          XSetTSOrigin(display, gc, x, y);          XSetTSOrigin(display, gc, x, y);
1189    
1190          FILL_RECTANGLE_FAST(x, y, cx, cy);          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
1191    
1192          XSetFillStyle(display, gc, FillSolid);          XSetFillStyle(display, gc, FillSolid);
1193  }  }
# Line 1218  ui_draw_glyph(int mixmode, Line 1216  ui_draw_glyph(int mixmode,
1216      }\      }\
1217    if (glyph != NULL)\    if (glyph != NULL)\
1218      {\      {\
1219        ui_draw_glyph (mixmode, x + (short) glyph->offset,\        ui_draw_glyph (mixmode, x + glyph->offset,\
1220                       y + (short) glyph->baseline,\                       y + glyph->baseline,\
1221                       glyph->width, glyph->height,\                       glyph->width, glyph->height,\
1222                       glyph->pixmap, 0, 0, bgcolour, fgcolour);\                       glyph->pixmap, 0, 0, bgcolour, fgcolour);\
1223        if (flags & TEXT2_IMPLICIT_X)\        if (flags & TEXT2_IMPLICIT_X)\
# Line 1241  ui_draw_text(uint8 font, uint8 flags, in Line 1239  ui_draw_text(uint8 font, uint8 flags, in
1239    
1240          if (boxcx > 1)          if (boxcx > 1)
1241          {          {
1242                  FILL_RECTANGLE_FAST(boxx, boxy, boxcx, boxcy);                  FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy);
1243          }          }
1244          else if (mixmode == MIX_OPAQUE)          else if (mixmode == MIX_OPAQUE)
1245          {          {
1246                  FILL_RECTANGLE_FAST(clipx, clipy, clipcx, clipcy);                  FILL_RECTANGLE_BACKSTORE(clipx, clipy, clipcx, clipcy);
1247          }          }
1248    
1249          /* Paint text, character by character */          /* Paint text, character by character */
# Line 1279  ui_draw_text(uint8 font, uint8 flags, in Line 1277  ui_draw_text(uint8 font, uint8 flags, in
1277                                                  else                                                  else
1278                                                          x += text[i + 2];                                                          x += text[i + 2];
1279                                          }                                          }
                                         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;  
1280                                          for (j = 0; j < entry->size; j++)                                          for (j = 0; j < entry->size; j++)
1281                                                  DO_GLYPH(((uint8 *) (entry->data)), j);                                                  DO_GLYPH(((uint8 *) (entry->data)), j);
1282                                  }                                  }
1283                                    if (i + 2 < length)
1284                                            i += 3;
1285                                    else
1286                                            i += 2;
1287                                    length -= i;
1288                                    /* this will move pointer from start to first character after FE command */
1289                                    text = &(text[i]);
1290                                    i = 0;
1291                                  break;                                  break;
1292    
1293                          default:                          default:

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

  ViewVC Help
Powered by ViewVC 1.1.26