Changeset 353


Ignore:
Timestamp:
Jan 18, 2004, 5:01:32 AM (18 years ago)
Author:
Sam Hocevar
Message:
  • src/event.c: + Refresh the X11 window when an exposure event is received. + When resizing the X11 window, start showing extra characters when two

thirds are visible.

Location:
libcaca/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/caca_internals.h

    r349 r353  
    8686extern Display *x11_dpy;
    8787extern Window x11_window;
     88extern Pixmap x11_pixmap;
     89extern GC x11_gc;
    8890extern long int x11_event_mask;
    8991extern int x11_font_width, x11_font_height;
  • libcaca/trunk/src/event.c

    r351 r353  
    260260            KeySym keysym;
    261261
     262            /* Expose event */
     263            if(xevent.type == Expose)
     264            {
     265                XCopyArea(x11_dpy, x11_pixmap, x11_window, x11_gc, 0, 0,
     266                          _caca_width * x11_font_width,
     267                          _caca_height * x11_font_height, 0, 0);
     268                continue;
     269            }
     270
    262271            /* Resize event */
    263272            if(xevent.type == ConfigureNotify)
    264273            {
    265                 unsigned int w = xevent.xconfigure.width / x11_font_width;
    266                 unsigned int h = xevent.xconfigure.height / x11_font_height;
     274                unsigned int w, h;
     275
     276                h = (xevent.xconfigure.height + x11_font_height / 3)
     277                      / x11_font_height;
     278                w = (xevent.xconfigure.width + x11_font_width / 3)
     279                      / x11_font_width;
    267280
    268281                if(w == _caca_width && h == _caca_height)
  • libcaca/trunk/src/graphics.c

    r352 r353  
    164164Display *x11_dpy;
    165165Window x11_window;
     166Pixmap x11_pixmap;
     167GC x11_gc;
    166168long int x11_event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask
    167             | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask;
     169            | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask
     170            | ExposureMask;
    168171int x11_font_width, x11_font_height;
    169172unsigned int x11_new_width, x11_new_height;
    170 static GC x11_gc;
    171 static Pixmap x11_pixmap;
    172173static uint8_t *x11_char, *x11_attr;
    173174static int x11_colors[16];
Note: See TracChangeset for help on using the changeset viewer.