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

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.581 by root, Tue Jul 5 16:42:21 2016 UTC vs.
Revision 1.582 by sf-exg, Thu Jul 14 05:33:26 2016 UTC

1482 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) 1482 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev))
1483 ; 1483 ;
1484 1484
1485 bool want_position_change = SHOULD_INVOKE (HOOK_POSITION_CHANGE); 1485 bool want_position_change = SHOULD_INVOKE (HOOK_POSITION_CHANGE);
1486 1486
1487 bool moved = false;
1488#ifdef HAVE_BG_PIXMAP
1489 if (bg_window_position_sensitive ())
1490 {
1491 want_position_change = true;
1492 if (bg_img == 0)
1493 moved = true;
1494 }
1495#endif
1496
1497 if (want_position_change) 1487 if (want_position_change)
1498 { 1488 {
1499 int x, y; 1489 int x, y;
1500 1490
1501 if (ev.xconfigure.send_event) 1491 if (ev.xconfigure.send_event)
1509 if (x != parent_x || y != parent_y) 1499 if (x != parent_x || y != parent_y)
1510 { 1500 {
1511 parent_x = x; 1501 parent_x = x;
1512 parent_y = y; 1502 parent_y = y;
1513 HOOK_INVOKE ((this, HOOK_POSITION_CHANGE, DT_INT, x, DT_INT, y, DT_END)); 1503 HOOK_INVOKE ((this, HOOK_POSITION_CHANGE, DT_INT, x, DT_INT, y, DT_END));
1514 moved = true;
1515 } 1504 }
1516 } 1505 }
1517 1506
1518 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) 1507 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
1519 { 1508 {
1520 seen_resize = 1; 1509 seen_resize = 1;
1521 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1510 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1522 } 1511 }
1523 else
1524 {
1525#ifdef HAVE_BG_PIXMAP
1526 if (moved)
1527 update_background ();
1528#endif
1529 }
1530 1512
1531 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1513 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1532 } 1514 }
1533 break; 1515 break;
1534 1516
1543 case SelectionRequest: 1525 case SelectionRequest:
1544 selection_send (ev.xselectionrequest); 1526 selection_send (ev.xselectionrequest);
1545 break; 1527 break;
1546 1528
1547 case MapNotify: 1529 case MapNotify:
1548#ifdef HAVE_BG_PIXMAP
1549 // This is needed at startup for the case of no window manager
1550 // or a non-reparenting window manager and also because we
1551 // defer bg image updates if the window is not mapped. The
1552 // short delay is to optimize for multiple ConfigureNotify
1553 // events at startup when the window manager reparents the
1554 // window, so as to perform the computation after we have
1555 // received all of them.
1556 if (bg_img == 0)
1557 update_background_ev.start (0.025);
1558#endif
1559 mapped = 1; 1530 mapped = 1;
1560#ifdef TEXT_BLINK 1531#ifdef TEXT_BLINK
1561 text_blink_ev.start (); 1532 text_blink_ev.start ();
1562#endif 1533#endif
1563 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1534 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1858 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1829 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1859 } 1830 }
1860#endif 1831#endif
1861} 1832}
1862 1833
1863#if BG_IMAGE_FROM_ROOT || ENABLE_PERL 1834#if ENABLE_PERL
1864void ecb_hot 1835void ecb_hot
1865rxvt_term::rootwin_cb (XEvent &ev) 1836rxvt_term::rootwin_cb (XEvent &ev)
1866{ 1837{
1867 make_current (); 1838 make_current ();
1868 1839
1878 * use the property to determine the pixmap. We use it later on. 1849 * use the property to determine the pixmap. We use it later on.
1879 */ 1850 */
1880 if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] 1851 if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID]
1881 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) 1852 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1882 { 1853 {
1883#if BG_IMAGE_FROM_ROOT
1884 if (option (Opt_transparent))
1885 {
1886 rxvt_img::new_from_root (this)->replace (root_img);
1887 update_background ();
1888 }
1889#endif
1890 HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END)); 1854 HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END));
1891 } 1855 }
1892 1856
1893 break; 1857 break;
1894 } 1858 }
3568 break; 3532 break;
3569#endif 3533#endif
3570 case URxvt_Color_border: 3534 case URxvt_Color_border:
3571 process_color_seq (op, Color_border, str, resp); 3535 process_color_seq (op, Color_border, str, resp);
3572 break; 3536 break;
3573
3574#if BG_IMAGE_FROM_ROOT
3575 case URxvt_Color_tint:
3576 process_color_seq (op, Color_tint, str, resp);
3577 {
3578 bool changed = false;
3579
3580 if (ISSET_PIXCOLOR (Color_tint))
3581 changed = root_effects.set_tint (pix_colors_focused [Color_tint]);
3582
3583 if (changed)
3584 update_background ();
3585 }
3586
3587 break;
3588#endif
3589
3590#if BG_IMAGE_FROM_FILE
3591 case Rxvt_Pixmap:
3592 if (!strcmp (str, "?"))
3593 {
3594 char str[256];
3595 int h_scale = fimage.h_scale;
3596 int v_scale = fimage.v_scale;
3597 int h_align = fimage.h_align;
3598 int v_align = fimage.v_align;
3599
3600 sprintf (str, "[%dx%d+%d+%d]",
3601 h_scale, v_scale,
3602 h_align, v_align);
3603 process_xterm_seq (XTerm_title, str, CHAR_ST);
3604 }
3605 else
3606 {
3607 bool changed = false;
3608
3609 if (*str != ';')
3610 {
3611 try
3612 {
3613 fimage.set_file_geometry (this, str);
3614 changed = true;
3615 }
3616 catch (const class rxvt_failure_exception &e)
3617 {
3618 }
3619 }
3620 else
3621 {
3622 str++;
3623 if (fimage.set_geometry (str, true))
3624 changed = true;
3625 }
3626
3627 if (changed)
3628 {
3629 if (bg_window_position_sensitive ())
3630 {
3631 int x, y;
3632 get_window_origin (x, y);
3633 parent_x = x;
3634 parent_y = y;
3635 }
3636 update_background ();
3637 }
3638 }
3639 break;
3640#endif
3641 3537
3642 case XTerm_logfile: 3538 case XTerm_logfile:
3643 // TODO, when secure mode? 3539 // TODO, when secure mode?
3644 break; 3540 break;
3645 3541

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines