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.59 by root, Wed Jul 5 20:31:48 2006 UTC vs.
Revision 1.62 by root, Mon Aug 7 15:41:05 2006 UTC

313 */ 313 */
314 char *displayResource, *xe; 314 char *displayResource, *xe;
315 XrmDatabase rdb1, database = 0; 315 XrmDatabase rdb1, database = 0;
316 316
317 // for ordering, see for example http://www.faqs.org/faqs/Xt-FAQ/ Subject: 20 317 // for ordering, see for example http://www.faqs.org/faqs/Xt-FAQ/ Subject: 20
318 // as opposed to "standard practise", we always read in ~/.Xdefaults
318 319
319 // 6. System wide per application default file. 320 // 6. System wide per application default file.
320 321
321 /* Add in $XAPPLRESDIR/Rxvt only; not bothering with XUSERFILESEARCHPATH */ 322 /* Add in $XAPPLRESDIR/Rxvt only; not bothering with XUSERFILESEARCHPATH */
322 if ((xe = (char *)getenv ("XAPPLRESDIR"))) 323 if ((xe = (char *)getenv ("XAPPLRESDIR")))
329 330
330 // 5. User's per application default file. 331 // 5. User's per application default file.
331 // none 332 // none
332 333
333 // 4. User's defaults file. 334 // 4. User's defaults file.
335 if (homedir)
336 {
337 snprintf (fname, sizeof (fname), "%s/.Xdefaults", homedir);
338
339 if ((rdb1 = XrmGetFileDatabase (fname)))
340 XrmMergeDatabases (rdb1, &database);
341 }
342
334 /* Get any Xserver defaults */ 343 /* Get any Xserver defaults */
335 if (refresh) 344 if (refresh)
336 { 345 {
337 // fucking xlib keeps a copy of the rm string 346 // fucking xlib keeps a copy of the rm string
338 Atom actual_type; 347 Atom actual_type;
354 && actual_format == 8) 363 && actual_format == 8)
355 displayResource = val; 364 displayResource = val;
356 else 365 else
357 { 366 {
358 displayResource = 0; 367 displayResource = 0;
368
359 if (val) 369 if (val)
360 XFree(val); 370 XFree(val);
361 } 371 }
362 372
363#if XLIB_ILLEGAL_ACCESS 373#if XLIB_ILLEGAL_ACCESS
368 displayResource = XResourceManagerString (dpy); 378 displayResource = XResourceManagerString (dpy);
369 379
370 if (displayResource) 380 if (displayResource)
371 { 381 {
372 if ((rdb1 = XrmGetStringDatabase (displayResource))) 382 if ((rdb1 = XrmGetStringDatabase (displayResource)))
373 XrmMergeDatabases (rdb1, &database);
374 }
375 else if (homedir)
376 {
377 snprintf (fname, sizeof (fname), "%s/.Xdefaults", homedir);
378
379 if ((rdb1 = XrmGetFileDatabase (fname)))
380 XrmMergeDatabases (rdb1, &database); 383 XrmMergeDatabases (rdb1, &database);
381 } 384 }
382 385
383#if !XLIB_ILLEGAL_ACCESS 386#if !XLIB_ILLEGAL_ACCESS
384 if (refresh && displayResource) 387 if (refresh && displayResource)
576 XFlush (dpy); 579 XFlush (dpy);
577} 580}
578 581
579void rxvt_display::reg (xevent_watcher *w) 582void rxvt_display::reg (xevent_watcher *w)
580{ 583{
584 if (!w->active)
585 {
581 xw.push_back (w); 586 xw.push_back (w);
582 w->active = xw.size (); 587 w->active = xw.size ();
588 }
583} 589}
584 590
585void rxvt_display::unreg (xevent_watcher *w) 591void rxvt_display::unreg (xevent_watcher *w)
586{ 592{
587 if (w->active) 593 if (w->active)
594 {
588 xw[w->active - 1] = 0; 595 xw[w->active - 1] = 0;
596 w->active = 0;
597 }
589} 598}
590 599
591void rxvt_display::set_selection_owner (rxvt_term *owner) 600void rxvt_display::set_selection_owner (rxvt_term *owner)
592{ 601{
593 if (selection_owner && selection_owner != owner) 602 if (selection_owner && selection_owner != owner)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines