… | |
… | |
15 | * - extensive modifications |
15 | * - extensive modifications |
16 | * Copyright (c) 2003-2010 Marc Lehmann <schmorp@schmorp.de> |
16 | * Copyright (c) 2003-2010 Marc Lehmann <schmorp@schmorp.de> |
17 | * |
17 | * |
18 | * This program is free software; you can redistribute it and/or modify |
18 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License as published by |
19 | * it under the terms of the GNU General Public License as published by |
20 | * the Free Software Foundation; either version 2 of the License, or |
20 | * the Free Software Foundation; either version 3 of the License, or |
21 | * (at your option) any later version. |
21 | * (at your option) any later version. |
22 | * |
22 | * |
23 | * This program is distributed in the hope that it will be useful, |
23 | * This program is distributed in the hope that it will be useful, |
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
… | |
… | |
168 | sel_scroll_ev.set <rxvt_term, &rxvt_term::sel_scroll_cb> (this); |
168 | sel_scroll_ev.set <rxvt_term, &rxvt_term::sel_scroll_cb> (this); |
169 | #endif |
169 | #endif |
170 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
170 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
171 | slip_wheel_ev.set <rxvt_term, &rxvt_term::slip_wheel_cb> (this); |
171 | slip_wheel_ev.set <rxvt_term, &rxvt_term::slip_wheel_cb> (this); |
172 | #endif |
172 | #endif |
173 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
173 | #if BG_IMAGE_FROM_ROOT || ENABLE_PERL |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
175 | #endif |
175 | #endif |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
177 | #ifdef USE_XIM |
177 | #if USE_XIM |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
179 | #endif |
179 | #endif |
180 | #ifdef POINTER_BLANK |
180 | #ifdef POINTER_BLANK |
181 | pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this); |
181 | pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this); |
182 | #endif |
182 | #endif |
… | |
… | |
226 | |
226 | |
227 | #ifdef HAVE_BG_PIXMAP |
227 | #ifdef HAVE_BG_PIXMAP |
228 | bg_destroy (); |
228 | bg_destroy (); |
229 | #endif |
229 | #endif |
230 | |
230 | |
|
|
231 | #if HAVE_IMG |
|
|
232 | delete bg_img; |
|
|
233 | #endif |
|
|
234 | |
231 | if (display) |
235 | if (display) |
232 | { |
236 | { |
233 | selection_clear (); |
237 | selection_clear (); |
234 | selection_clear (true); |
238 | selection_clear (true); |
235 | |
239 | |
236 | #ifdef USE_XIM |
240 | #if USE_XIM |
237 | im_destroy (); |
241 | im_destroy (); |
238 | #endif |
242 | #endif |
239 | scrollBar.destroy (); |
243 | scrollBar.destroy (); |
|
|
244 | |
|
|
245 | if (gc) |
240 | if (gc) XFreeGC (dpy, gc); |
246 | XFreeGC (dpy, gc); |
241 | |
247 | |
242 | delete drawable; |
248 | delete drawable; |
|
|
249 | |
243 | // destroy all windows |
250 | // destroy all windows |
244 | if (parent) |
251 | if (parent) |
245 | XDestroyWindow (dpy, parent); |
252 | XDestroyWindow (dpy, parent); |
246 | |
253 | |
247 | for (int i = 0; i < TOTAL_COLORS; i++) |
254 | for (int i = 0; i < TOTAL_COLORS; i++) |
… | |
… | |
270 | free (locale); |
277 | free (locale); |
271 | free (v_buffer); |
278 | free (v_buffer); |
272 | |
279 | |
273 | delete selection_req; |
280 | delete selection_req; |
274 | |
281 | |
|
|
282 | if (memcmp (env, envv->begin (), envv->size () * sizeof (char *))) |
|
|
283 | rxvt_warn ("env has been modified, probably as a result of a lib calling setenv.\n"); |
|
|
284 | |
|
|
285 | delete env; |
|
|
286 | |
275 | delete envv; |
287 | delete envv; |
276 | delete argv; |
288 | delete argv; |
277 | |
289 | |
278 | #ifdef KEYSYM_RESOURCE |
290 | #ifdef KEYSYM_RESOURCE |
279 | delete keyboard; |
291 | delete keyboard; |
… | |
… | |
311 | { |
323 | { |
312 | #if USE_XIM |
324 | #if USE_XIM |
313 | im_ev.stop (display); |
325 | im_ev.stop (display); |
314 | #endif |
326 | #endif |
315 | scrollbar_ev.stop (display); |
327 | scrollbar_ev.stop (display); |
316 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
328 | #if BG_IMAGE_FROM_ROOT || ENABLE_PERL |
317 | rootwin_ev.stop (display); |
329 | rootwin_ev.stop (display); |
318 | #endif |
330 | #endif |
319 | termwin_ev.stop (display); |
331 | termwin_ev.stop (display); |
320 | vt_ev.stop (display); |
332 | vt_ev.stop (display); |
321 | } |
333 | } |
… | |
… | |
362 | } |
374 | } |
363 | |
375 | |
364 | /*----------------------------------------------------------------------*/ |
376 | /*----------------------------------------------------------------------*/ |
365 | /* |
377 | /* |
366 | * Exit gracefully, clearing the utmp entry and restoring tty attributes |
378 | * Exit gracefully, clearing the utmp entry and restoring tty attributes |
367 | * TODO: if debugging, this should free up any known resources if we can |
|
|
368 | */ |
379 | */ |
369 | static XErrorHandler old_xerror_handler; |
380 | static XErrorHandler old_xerror_handler; |
370 | |
381 | |
371 | static void |
382 | static void |
372 | rxvt_emergency_cleanup () |
383 | rxvt_emergency_cleanup () |
… | |
… | |
374 | for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) |
385 | for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) |
375 | (*t)->emergency_cleanup (); |
386 | (*t)->emergency_cleanup (); |
376 | } |
387 | } |
377 | |
388 | |
378 | #if !ENABLE_MINIMAL |
389 | #if !ENABLE_MINIMAL |
379 | static void |
390 | static void ecb_cold |
380 | print_x_error (Display *dpy, XErrorEvent *event) |
391 | print_x_error (Display *dpy, XErrorEvent *event) |
381 | { |
392 | { |
382 | char buffer[BUFSIZ]; |
393 | char buffer[BUFSIZ]; |
383 | char mesg[BUFSIZ]; |
394 | char mesg[BUFSIZ]; |
384 | char number[32]; |
395 | char number[32]; |
385 | const char mtype[] = "XlibMessage"; |
396 | |
386 | XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); |
|
|
387 | XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); |
|
|
388 | rxvt_warn ("An X Error occurred, trying to continue after report.\n"); |
397 | rxvt_warn ("An X Error occurred, trying to continue after report.\n"); |
|
|
398 | |
|
|
399 | XGetErrorDatabaseText (dpy, "XlibMessage", "ErrorSerial", "Error Serial #%d", mesg, BUFSIZ); |
|
|
400 | snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->serial); |
|
|
401 | |
|
|
402 | XGetErrorText (dpy, event->error_code, buffer, BUFSIZ); |
|
|
403 | XGetErrorDatabaseText (dpy, "XlibMessage", "XError", "X Error", mesg, BUFSIZ); |
389 | rxvt_warn ("%s: %s\n", mesg, buffer); |
404 | rxvt_warn ("+ %s: %s\n", mesg, buffer); |
|
|
405 | |
390 | XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", mesg, BUFSIZ); |
406 | XGetErrorDatabaseText (dpy, "XlibMessage", "MajorCode", "Request Major code %d", mesg, BUFSIZ); |
391 | rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->request_code); |
407 | snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->request_code); |
392 | sprintf(number, "%d", event->request_code); |
408 | |
393 | XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); |
|
|
394 | rxvt_warn ("(which is %s)\n", buffer); |
|
|
395 | if (event->request_code >= 128) { |
409 | if (event->request_code >= 128) |
|
|
410 | { |
|
|
411 | #if 0 |
|
|
412 | /* XListExtensions and probably query extensions hangs when there are multiple queues errors */ |
|
|
413 | int nexts; |
|
|
414 | char **exts = XListExtensions (dpy, &nexts); |
|
|
415 | |
|
|
416 | while (nexts) |
|
|
417 | { |
|
|
418 | char *extname = exts [nexts - 1]; |
|
|
419 | int major, first_event, first_error; |
|
|
420 | |
|
|
421 | if (XQueryExtension (dpy, extname, &major, &first_event, &first_error) && major == event->request_code) |
|
|
422 | { |
|
|
423 | XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, BUFSIZ); |
|
|
424 | rxvt_warn ("+ (which is extension %s minor code %d)\n", extname, event->minor_code); |
|
|
425 | |
|
|
426 | snprintf (buffer, BUFSIZ, "%s.%d", extname, event->minor_code); |
|
|
427 | XGetErrorDatabaseText (dpy, "XRequest", buffer, "an unregistered minor code", buffer, BUFSIZ); |
|
|
428 | rxvt_warn ("+ (which is %s)\n", buffer); |
|
|
429 | |
|
|
430 | break; |
|
|
431 | } |
|
|
432 | |
|
|
433 | printf ("nextss %d %s\n", nexts, extname);//D |
|
|
434 | --nexts; |
|
|
435 | ++exts; |
|
|
436 | } |
|
|
437 | #else |
|
|
438 | int nexts = 0; |
|
|
439 | char **exts = 0; |
|
|
440 | #endif |
|
|
441 | |
|
|
442 | if (!nexts) |
|
|
443 | { |
|
|
444 | rxvt_warn ("+ (which is an unknown extension)\n", buffer); |
|
|
445 | |
396 | XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d", |
446 | XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, BUFSIZ); |
397 | mesg, BUFSIZ); |
447 | snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->minor_code); |
398 | rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->minor_code); |
448 | |
|
|
449 | #if 0 |
|
|
450 | sprintf (number, "RENDER.%d", event->minor_code); |
|
|
451 | XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, BUFSIZ); |
|
|
452 | rxvt_warn ("+ (which is %s)\n", buffer); |
|
|
453 | #endif |
|
|
454 | } |
|
|
455 | |
|
|
456 | XFreeExtensionList (exts); |
399 | } |
457 | } |
|
|
458 | else |
|
|
459 | { |
|
|
460 | sprintf (number, "%d", event->request_code); |
|
|
461 | XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, BUFSIZ); |
|
|
462 | rxvt_warn ("+ (which is %s)\n", buffer); |
|
|
463 | } |
|
|
464 | |
400 | if ((event->error_code == BadWindow) || |
465 | if (event->error_code == BadWindow |
401 | (event->error_code == BadPixmap) || |
466 | || event->error_code == BadPixmap |
402 | (event->error_code == BadCursor) || |
467 | || event->error_code == BadCursor |
403 | (event->error_code == BadFont) || |
468 | || event->error_code == BadFont |
404 | (event->error_code == BadDrawable) || |
469 | || event->error_code == BadDrawable |
405 | (event->error_code == BadColor) || |
470 | || event->error_code == BadColor |
406 | (event->error_code == BadGC) || |
471 | || event->error_code == BadGC |
407 | (event->error_code == BadIDChoice) || |
472 | || event->error_code == BadIDChoice |
408 | (event->error_code == BadValue) || |
473 | || event->error_code == BadValue |
409 | (event->error_code == BadAtom)) { |
474 | || event->error_code == BadAtom) |
|
|
475 | { |
410 | if (event->error_code == BadValue) |
476 | if (event->error_code == BadValue) |
411 | XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x", |
477 | XGetErrorDatabaseText (dpy, "XlibMessage", "Value", "Value 0x%x", mesg, BUFSIZ); |
412 | mesg, BUFSIZ); |
|
|
413 | else if (event->error_code == BadAtom) |
478 | else if (event->error_code == BadAtom) |
414 | XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x", |
479 | XGetErrorDatabaseText (dpy, "XlibMessage", "AtomID", "AtomID 0x%x", mesg, BUFSIZ); |
415 | mesg, BUFSIZ); |
|
|
416 | else |
480 | else |
417 | XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x", |
481 | XGetErrorDatabaseText (dpy, "XlibMessage", "ResourceID", "ResourceID 0x%x", mesg, BUFSIZ); |
418 | mesg, BUFSIZ); |
|
|
419 | rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->resourceid); |
|
|
420 | } |
|
|
421 | XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d", |
|
|
422 | mesg, BUFSIZ); |
|
|
423 | rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->serial); |
|
|
424 | } |
|
|
425 | #endif |
|
|
426 | |
482 | |
427 | int |
483 | snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->resourceid); |
|
|
484 | } |
|
|
485 | } |
|
|
486 | #endif |
|
|
487 | |
|
|
488 | int ecb_cold |
428 | rxvt_xerror_handler (Display *display, XErrorEvent *event) |
489 | rxvt_xerror_handler (Display *display, XErrorEvent *event) |
429 | { |
490 | { |
430 | if (GET_R->allowedxerror == -1) |
491 | if (GET_R->allowedxerror == -1) |
431 | GET_R->allowedxerror = event->error_code; |
492 | GET_R->allowedxerror = event->error_code; |
432 | else |
493 | else |
… | |
… | |
441 | } |
502 | } |
442 | |
503 | |
443 | return 0; |
504 | return 0; |
444 | } |
505 | } |
445 | |
506 | |
446 | int |
507 | int ecb_cold |
447 | rxvt_xioerror_handler (Display *display) |
508 | rxvt_xioerror_handler (Display *display) |
448 | { |
509 | { |
449 | rxvt_warn ("X connection to '%s' broken, unable to recover, exiting.\n", |
510 | rxvt_warn ("X connection to '%s' broken, unable to recover, exiting.\n", |
450 | DisplayString (display)); |
511 | DisplayString (display)); |
451 | rxvt_emergency_cleanup (); |
512 | rxvt_emergency_cleanup (); |
… | |
… | |
571 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
632 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
572 | // TODO: handle this with exceptions and tolerate the memory loss |
633 | // TODO: handle this with exceptions and tolerate the memory loss |
573 | XSetIOErrorHandler (rxvt_xioerror_handler); |
634 | XSetIOErrorHandler (rxvt_xioerror_handler); |
574 | |
635 | |
575 | XrmInitialize (); |
636 | XrmInitialize (); |
|
|
637 | |
|
|
638 | #if HAVE_PIXBUF |
|
|
639 | g_type_init (); |
|
|
640 | #endif |
576 | } |
641 | } |
577 | |
642 | |
578 | /*----------------------------------------------------------------------*/ |
643 | /*----------------------------------------------------------------------*/ |
579 | /* |
644 | /* |
580 | * window size/position calculations for XSizeHint and other storage. |
645 | * window size/position calculations for XSizeHint and other storage. |
… | |
… | |
764 | |
829 | |
765 | delete fontset[0]; |
830 | delete fontset[0]; |
766 | fontset[0] = fs; |
831 | fontset[0] = fs; |
767 | |
832 | |
768 | prop = (*fs)[rxvt_fontset::firstFont]->properties (); |
833 | prop = (*fs)[rxvt_fontset::firstFont]->properties (); |
769 | prop.height += lineSpace; |
834 | prop.width = max (prop.width + letterSpace, 1); |
770 | prop.width += letterSpace; |
|
|
771 | |
835 | |
772 | fs->set_prop (prop, false); |
836 | fs->set_prop (prop, false); |
773 | |
837 | |
774 | fwidth = prop.width; |
838 | fwidth = prop.width; |
775 | fheight = prop.height; |
839 | fheight = prop.height + lineSpace; |
776 | fbase = prop.ascent; |
840 | fbase = prop.ascent; |
777 | |
841 | |
778 | for (int style = 1; style < 4; style++) |
842 | for (int style = 1; style < 4; style++) |
779 | { |
843 | { |
780 | #if ENABLE_STYLES |
844 | #if ENABLE_STYLES |
… | |
… | |
962 | |
1026 | |
963 | for (i = Color_Black; i <= Color_White; i++) |
1027 | for (i = Color_Black; i <= Color_White; i++) |
964 | if (pix_colors[Color_bg] == pix_colors[i]) |
1028 | if (pix_colors[Color_bg] == pix_colors[i]) |
965 | { |
1029 | { |
966 | sprintf (bstr, "%d", i - Color_Black); |
1030 | sprintf (bstr, "%d", i - Color_Black); |
967 | #ifdef BG_IMAGE_FROM_FILE |
1031 | #if BG_IMAGE_FROM_FILE |
968 | xpmb = "default;"; |
1032 | xpmb = "default;"; |
969 | #endif |
1033 | #endif |
970 | break; |
1034 | break; |
971 | } |
1035 | } |
972 | |
1036 | |
… | |
… | |
1075 | |
1139 | |
1076 | XMoveResizeWindow (dpy, vt, |
1140 | XMoveResizeWindow (dpy, vt, |
1077 | window_vt_x, window_vt_y, |
1141 | window_vt_x, window_vt_y, |
1078 | vt_width, vt_height); |
1142 | vt_width, vt_height); |
1079 | |
1143 | |
|
|
1144 | HOOK_INVOKE ((this, HOOK_SIZE_CHANGE, DT_INT, newwidth, DT_INT, newheight, DT_END)); |
|
|
1145 | |
1080 | #ifdef HAVE_BG_PIXMAP |
1146 | #ifdef HAVE_BG_PIXMAP |
1081 | if (bg_window_size_sensitive ()) |
1147 | if (bg_window_size_sensitive ()) |
1082 | update_background (); |
1148 | update_background (); |
1083 | #endif |
1149 | #endif |
1084 | } |
1150 | } |
1085 | |
1151 | |
1086 | if (fix_screen || old_height == 0) |
1152 | if (fix_screen || old_height == 0) |
1087 | scr_reset (); |
1153 | scr_reset (); |
1088 | |
1154 | |
1089 | #ifdef USE_XIM |
1155 | #if USE_XIM |
1090 | im_set_position (); |
1156 | im_set_position (); |
1091 | #endif |
1157 | #endif |
1092 | } |
1158 | } |
1093 | |
1159 | |
1094 | /* |
1160 | /* |
… | |
… | |
1119 | } |
1185 | } |
1120 | |
1186 | |
1121 | /* -------------------------------------------------------------------- * |
1187 | /* -------------------------------------------------------------------- * |
1122 | * - X INPUT METHOD ROUTINES - * |
1188 | * - X INPUT METHOD ROUTINES - * |
1123 | * -------------------------------------------------------------------- */ |
1189 | * -------------------------------------------------------------------- */ |
1124 | #ifdef USE_XIM |
1190 | #if USE_XIM |
1125 | |
1191 | |
1126 | void |
1192 | void |
1127 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1193 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1128 | { |
1194 | { |
1129 | fg = pix_colors [Color_fg]; |
1195 | fg = pix_colors [Color_fg]; |
… | |
… | |
1309 | unsigned long fg, bg; |
1375 | unsigned long fg, bg; |
1310 | const char *p; |
1376 | const char *p; |
1311 | char **s; |
1377 | char **s; |
1312 | XIMStyles *xim_styles; |
1378 | XIMStyles *xim_styles; |
1313 | |
1379 | |
1314 | set_environ (envv); |
1380 | set_environ (env); |
1315 | |
1381 | |
1316 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1382 | if (!((p = XSetLocaleModifiers (modifiers)) && *p)) |
1317 | return false; |
1383 | return false; |
1318 | |
1384 | |
1319 | input_method = display->get_xim (locale, modifiers); |
1385 | input_method = display->get_xim (locale, modifiers); |
1320 | if (input_method == NULL) |
1386 | if (input_method == NULL) |
1321 | return false; |
1387 | return false; |
… | |
… | |
1564 | |
1630 | |
1565 | /* try with no modifiers base IF the user didn't specify an IM */ |
1631 | /* try with no modifiers base IF the user didn't specify an IM */ |
1566 | if (im_get_ic ("@im=none")) |
1632 | if (im_get_ic ("@im=none")) |
1567 | goto done; |
1633 | goto done; |
1568 | |
1634 | |
1569 | done: ; |
1635 | done: |
1570 | if (rs[Rs_imLocale]) |
1636 | if (rs[Rs_imLocale]) |
1571 | SET_LOCALE (locale); |
1637 | SET_LOCALE (locale); |
1572 | } |
1638 | } |
1573 | |
1639 | |
1574 | void |
1640 | void |
… | |
… | |
1621 | { |
1687 | { |
1622 | Window cr; |
1688 | Window cr; |
1623 | XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr); |
1689 | XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr); |
1624 | } |
1690 | } |
1625 | |
1691 | |
1626 | Pixmap |
|
|
1627 | rxvt_term::get_pixmap_property (Atom property) |
|
|
1628 | { |
|
|
1629 | Pixmap pixmap = None; |
|
|
1630 | |
|
|
1631 | int aformat; |
|
|
1632 | unsigned long nitems, bytes_after; |
|
|
1633 | Atom atype; |
|
|
1634 | unsigned char *prop; |
|
|
1635 | int result = XGetWindowProperty (dpy, display->root, property, |
|
|
1636 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
1637 | &nitems, &bytes_after, &prop); |
|
|
1638 | if (result == Success) |
|
|
1639 | { |
|
|
1640 | if (atype == XA_PIXMAP) |
|
|
1641 | pixmap = *(Pixmap *)prop; |
|
|
1642 | XFree (prop); |
|
|
1643 | } |
|
|
1644 | |
|
|
1645 | return pixmap; |
|
|
1646 | } |
|
|
1647 | |
|
|
1648 | #ifdef HAVE_BG_PIXMAP |
1692 | #ifdef HAVE_BG_PIXMAP |
1649 | |
1693 | |
1650 | void |
1694 | void |
1651 | rxvt_term::update_background () |
1695 | rxvt_term::update_background () |
1652 | { |
1696 | { |
1653 | if (update_background_ev.is_active ()) |
1697 | if (update_background_ev.is_active ()) |
1654 | return; |
|
|
1655 | |
|
|
1656 | bg_invalidate (); |
|
|
1657 | |
|
|
1658 | if (!mapped) |
|
|
1659 | return; |
1698 | return; |
1660 | |
1699 | |
1661 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1700 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1662 | |
1701 | |
1663 | if (to_wait <= 0.) |
1702 | if (to_wait <= 0.) |