… | |
… | |
1311 | dDisp; |
1311 | dDisp; |
1312 | |
1312 | |
1313 | SET_R (this); |
1313 | SET_R (this); |
1314 | SET_LOCALE (locale); |
1314 | SET_LOCALE (locale); |
1315 | |
1315 | |
|
|
1316 | if (ev.xany.window == vt |
|
|
1317 | && HOOK_INVOKE ((this, HOOK_X_EVENT, DT_XEVENT, &ev, DT_END))) |
|
|
1318 | return; |
|
|
1319 | |
|
|
1320 | // for XQueryPointer |
1316 | Window unused_root, unused_child; |
1321 | Window unused_root, unused_child; |
1317 | int unused_root_x, unused_root_y; |
1322 | int unused_root_x, unused_root_y; |
1318 | unsigned int unused_mask; |
1323 | unsigned int unused_mask; |
1319 | |
1324 | |
1320 | switch (ev.type) |
1325 | switch (ev.type) |
… | |
… | |
1600 | #endif |
1605 | #endif |
1601 | } |
1606 | } |
1602 | break; |
1607 | break; |
1603 | |
1608 | |
1604 | case MotionNotify: |
1609 | case MotionNotify: |
|
|
1610 | printf ("motion notify\n");//D |
1605 | #ifdef POINTER_BLANK |
1611 | #ifdef POINTER_BLANK |
1606 | if (hidden_pointer) |
1612 | if (hidden_pointer) |
1607 | pointer_unblank (); |
1613 | pointer_unblank (); |
1608 | #endif |
1614 | #endif |
1609 | #if MENUBAR |
1615 | #if MENUBAR |
… | |
… | |
1920 | #else |
1926 | #else |
1921 | selection.rect = false; |
1927 | selection.rect = false; |
1922 | #endif |
1928 | #endif |
1923 | |
1929 | |
1924 | /* allow shift+left click to extend selection */ |
1930 | /* allow shift+left click to extend selection */ |
1925 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1931 | if (ev.state & ShiftMask && !(priv_modes & PrivMode_mouse_report)) |
1926 | { |
1932 | { |
1927 | if (MEvent.button == Button1 && clickintime) |
1933 | if (MEvent.button == Button1 && clickintime) |
1928 | selection_rotate (ev.x, ev.y); |
1934 | selection_rotate (ev.x, ev.y); |
1929 | else |
1935 | else |
1930 | selection_extend (ev.x, ev.y, 1); |
1936 | selection_extend (ev.x, ev.y, 1); |
… | |
… | |
3858 | { |
3864 | { |
3859 | if ((name = strchr (buf, ';')) == NULL) |
3865 | if ((name = strchr (buf, ';')) == NULL) |
3860 | break; |
3866 | break; |
3861 | |
3867 | |
3862 | *name++ = '\0'; |
3868 | *name++ = '\0'; |
3863 | color = atoi (buf); |
3869 | color = atoi (buf) + minCOLOR; |
3864 | |
3870 | |
3865 | if (color < 0 || color >= TOTAL_COLORS) |
3871 | if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) |
3866 | break; |
3872 | break; |
3867 | |
3873 | |
3868 | if ((buf = strchr (name, ';')) != NULL) |
3874 | if ((buf = strchr (name, ';')) != NULL) |
3869 | *buf++ = '\0'; |
3875 | *buf++ = '\0'; |
3870 | |
3876 | |
3871 | if (name[0] == '?' && !name[1]) |
3877 | if (name[0] == '?' && !name[1]) |
3872 | { |
3878 | { |
3873 | unsigned short r, g, b; |
3879 | unsigned short r, g, b; |
3874 | pix_colors_focused[color + minCOLOR].get (display, r, g, b); |
3880 | pix_colors_focused[color].get (display, r, g, b); |
3875 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); |
3881 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); |
3876 | } |
3882 | } |
3877 | else |
3883 | else |
3878 | set_window_color (color + minCOLOR, name); |
3884 | set_window_color (color, name); |
3879 | } |
3885 | } |
3880 | break; |
3886 | break; |
3881 | case XTerm_Color00: |
3887 | case XTerm_Color00: |
3882 | process_color_seq (XTerm_Color00, Color_fg, str, resp); |
3888 | process_color_seq (XTerm_Color00, Color_fg, str, resp); |
3883 | break; |
3889 | break; |
3884 | case XTerm_Color01: |
3890 | case XTerm_Color01: |
3885 | process_color_seq (XTerm_Color00, Color_bg, str, resp); |
3891 | process_color_seq (XTerm_Color01, Color_bg, str, resp); |
3886 | break; |
3892 | break; |
3887 | #ifndef NO_CURSORCOLOR |
3893 | #ifndef NO_CURSORCOLOR |
3888 | case XTerm_Color_cursor: |
3894 | case XTerm_Color_cursor: |
3889 | process_color_seq (XTerm_Color_cursor, Color_cursor, str, resp); |
3895 | process_color_seq (XTerm_Color_cursor, Color_cursor, str, resp); |
3890 | break; |
3896 | break; |
… | |
… | |
3894 | break; |
3900 | break; |
3895 | case XTerm_Color_pointer_bg: |
3901 | case XTerm_Color_pointer_bg: |
3896 | process_color_seq (XTerm_Color_pointer_bg, Color_pointer_bg, str, resp); |
3902 | process_color_seq (XTerm_Color_pointer_bg, Color_pointer_bg, str, resp); |
3897 | break; |
3903 | break; |
3898 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3904 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3899 | case XTerm_Color_BD: |
|
|
3900 | process_color_seq (XTerm_Color_BD, Color_BD, str, resp); |
|
|
3901 | break; |
|
|
3902 | case XTerm_Color_UL: |
|
|
3903 | process_color_seq (XTerm_Color_UL, Color_UL, str, resp); |
|
|
3904 | break; |
|
|
3905 | case XTerm_Color_RV: |
3905 | case XTerm_Color_RV: |
3906 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3906 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
|
|
3907 | break; |
|
|
3908 | case Rxvt_Color_BD: |
|
|
3909 | case URxvt_Color_BD: |
|
|
3910 | process_color_seq (op, Color_BD, str, resp); |
|
|
3911 | break; |
|
|
3912 | case Rxvt_Color_UL: |
|
|
3913 | case URxvt_Color_UL: |
|
|
3914 | process_color_seq (op, Color_UL, str, resp); |
3907 | break; |
3915 | break; |
3908 | case URxvt_Color_IT: |
3916 | case URxvt_Color_IT: |
3909 | process_color_seq (URxvt_Color_IT, Color_IT, str, resp); |
3917 | process_color_seq (URxvt_Color_IT, Color_IT, str, resp); |
3910 | break; |
3918 | break; |
3911 | #endif |
3919 | #endif |
… | |
… | |
3916 | if (am_transparent) |
3924 | if (am_transparent) |
3917 | want_full_refresh = want_refresh = 1; |
3925 | want_full_refresh = want_refresh = 1; |
3918 | break; |
3926 | break; |
3919 | #endif |
3927 | #endif |
3920 | |
3928 | |
3921 | case XTerm_Pixmap: |
3929 | case Rxvt_Pixmap: |
3922 | if (*str != ';') |
3930 | if (*str != ';') |
3923 | { |
3931 | { |
3924 | #if XPM_BACKGROUND |
3932 | #if XPM_BACKGROUND |
3925 | scale_pixmap (""); /* reset to default scaling */ |
3933 | scale_pixmap (""); /* reset to default scaling */ |
3926 | set_bgPixmap (str); /* change pixmap */ |
3934 | set_bgPixmap (str); /* change pixmap */ |
3927 | #endif |
|
|
3928 | scr_touch (true); |
3935 | scr_touch (true); |
|
|
3936 | #endif |
3929 | } |
3937 | } |
|
|
3938 | |
3930 | while ((str = strchr (str, ';')) != NULL) |
3939 | while ((str = strchr (str, ';')) != NULL) |
3931 | { |
3940 | { |
3932 | str++; |
3941 | str++; |
3933 | #if XPM_BACKGROUND |
3942 | #if XPM_BACKGROUND |
3934 | changed += scale_pixmap (str); |
3943 | changed += scale_pixmap (str); |
… | |
… | |
3937 | |
3946 | |
3938 | if (changed) |
3947 | if (changed) |
3939 | { |
3948 | { |
3940 | #ifdef XPM_BACKGROUND |
3949 | #ifdef XPM_BACKGROUND |
3941 | resize_pixmap (); |
3950 | resize_pixmap (); |
3942 | #endif |
|
|
3943 | scr_touch (true); |
3951 | scr_touch (true); |
|
|
3952 | #endif |
3944 | } |
3953 | } |
3945 | break; |
3954 | break; |
3946 | |
3955 | |
3947 | case XTerm_restoreFG: |
3956 | case Rxvt_restoreFG: |
3948 | set_window_color (Color_fg, str); |
3957 | set_window_color (Color_fg, str); |
3949 | break; |
3958 | break; |
3950 | case XTerm_restoreBG: |
3959 | case Rxvt_restoreBG: |
3951 | set_window_color (Color_bg, str); |
3960 | set_window_color (Color_bg, str); |
3952 | break; |
3961 | break; |
3953 | |
3962 | |
3954 | case XTerm_logfile: |
3963 | case XTerm_logfile: |
3955 | // TODO, when secure mode? |
3964 | // TODO, when secure mode? |
… | |
… | |
3960 | if (OPTION (Opt_insecure)) |
3969 | if (OPTION (Opt_insecure)) |
3961 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3970 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3962 | break; |
3971 | break; |
3963 | #endif |
3972 | #endif |
3964 | #if 0 |
3973 | #if 0 |
3965 | case XTerm_dumpscreen: /* no error notices */ |
3974 | case Rxvt_dumpscreen: /* no error notices */ |
3966 | { |
3975 | { |
3967 | int fd; |
3976 | int fd; |
3968 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
3977 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
3969 | { |
3978 | { |
3970 | scr_dump (fd); |
3979 | scr_dump (fd); |