ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.C
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.81 by root, Fri Dec 14 02:22:24 2007 UTC vs.
Revision 1.87 by root, Mon Dec 24 08:21:39 2007 UTC

297 297
298rxvt_display::rxvt_display (const char *id) 298rxvt_display::rxvt_display (const char *id)
299: refcounted (id) 299: refcounted (id)
300, selection_owner (0) 300, selection_owner (0)
301{ 301{
302 x_ev.set<rxvt_display, &rxvt_display::x_cb> (this); 302 x_ev .set<rxvt_display, &rxvt_display::x_cb > (this);
303 flush_ev.set<rxvt_display, &rxvt_display::flush_cb> (this);
303} 304}
304 305
305XrmDatabase 306XrmDatabase
306rxvt_display::get_resources (bool refresh) 307rxvt_display::get_resources (bool refresh)
307{ 308{
471 socklen_t sl = sizeof (sa); 472 socklen_t sl = sizeof (sa);
472 473
473 if (!getsockname (fd, (sockaddr *)&sa, &sl)) 474 if (!getsockname (fd, (sockaddr *)&sa, &sl))
474 is_local = sa.sun_family == AF_UNIX; 475 is_local = sa.sun_family == AF_UNIX;
475 476
477 flush_ev.start ();
476 x_ev.start (fd, ev::READ); 478 x_ev.start (fd, ev::READ);
477 fcntl (fd, F_SETFD, FD_CLOEXEC); 479 fcntl (fd, F_SETFD, FD_CLOEXEC);
478 480
479 XSelectInput (dpy, root, PropertyChangeMask); 481 XSelectInput (dpy, root, PropertyChangeMask);
480 482
499 501
500#ifdef POINTER_BLANK 502#ifdef POINTER_BLANK
501 XFreeCursor (dpy, blank_cursor); 503 XFreeCursor (dpy, blank_cursor);
502#endif 504#endif
503 x_ev.stop (); 505 x_ev.stop ();
506 flush_ev.stop ();
504#ifdef USE_XIM 507#ifdef USE_XIM
505 xims.clear (); 508 xims.clear ();
506#endif 509#endif
507 XCloseDisplay (dpy); 510 XCloseDisplay (dpy);
508} 511}
567 } 570 }
568#ifdef USE_XIM 571#ifdef USE_XIM
569 } 572 }
570#endif 573#endif
571 } 574 }
575}
572 576
577void rxvt_display::flush_cb (ev::prepare &w, int revents)
578{
579 w.stop ();
573 XFlush (dpy); 580 XFlush (dpy);
574}
575
576void rxvt_display::flush ()
577{
578 x_cb (x_ev, ev::READ);
579} 581}
580 582
581void rxvt_display::reg (xevent_watcher *w) 583void rxvt_display::reg (xevent_watcher *w)
582{ 584{
583 if (!w->active) 585 if (!w->active)
597} 599}
598 600
599void rxvt_display::set_selection_owner (rxvt_term *owner) 601void rxvt_display::set_selection_owner (rxvt_term *owner)
600{ 602{
601 if (selection_owner && selection_owner != owner) 603 if (selection_owner && selection_owner != owner)
604 {
605 rxvt_term *owner = selection_owner;
606
602 selection_owner->selection_clear (); 607 owner->selection_clear ();
608 owner->flush ();
609 }
603 610
604 selection_owner = owner; 611 selection_owner = owner;
605} 612}
606 613
607#ifdef USE_XIM 614#ifdef USE_XIM

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines