… | |
… | |
297 | get_options (r_argc, r_argv); |
297 | get_options (r_argc, r_argv); |
298 | |
298 | |
299 | if (!(display = displays.get (rs[Rs_display_name]))) |
299 | if (!(display = displays.get (rs[Rs_display_name]))) |
300 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
300 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
301 | |
301 | |
302 | extract_resources (); |
|
|
303 | |
|
|
304 | free (r_argv); |
|
|
305 | |
|
|
306 | #if ENABLE_PERL |
|
|
307 | if (!rs[Rs_perl_ext_1]) |
|
|
308 | rs[Rs_perl_ext_1] = "default"; |
|
|
309 | |
|
|
310 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
|
|
311 | || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) |
|
|
312 | || (rs[Rs_perl_eval] && *rs[Rs_perl_eval])) |
|
|
313 | { |
|
|
314 | rxvt_perl.init (this); |
|
|
315 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
|
|
316 | } |
|
|
317 | #endif |
|
|
318 | |
|
|
319 | xa = display->xa; |
302 | xa = display->xa; |
320 | |
303 | |
321 | #if ENABLE_FRILLS |
304 | #if ENABLE_FRILLS |
322 | if (rs[Rs_depth]) |
305 | if (rs[Rs_depth]) |
323 | set (display, strtol (rs[Rs_depth], 0, 0)); |
306 | set (display, strtol (rs[Rs_depth], 0, 0)); |
324 | else |
307 | else |
325 | #endif |
308 | #endif |
326 | set (display); |
309 | set (display); |
|
|
310 | |
|
|
311 | extract_resources (); |
|
|
312 | |
|
|
313 | free (r_argv); |
|
|
314 | |
|
|
315 | #if ENABLE_PERL |
|
|
316 | if (!rs[Rs_perl_ext_1]) |
|
|
317 | rs[Rs_perl_ext_1] = "default"; |
|
|
318 | |
|
|
319 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
|
|
320 | || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) |
|
|
321 | || (rs[Rs_perl_eval] && *rs[Rs_perl_eval])) |
|
|
322 | { |
|
|
323 | rxvt_perl.init (this); |
|
|
324 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
|
|
325 | } |
|
|
326 | #endif |
327 | |
327 | |
328 | /* |
328 | /* |
329 | * set any defaults not already set |
329 | * set any defaults not already set |
330 | */ |
330 | */ |
331 | if (cmd_argv && cmd_argv[0]) |
331 | if (cmd_argv && cmd_argv[0]) |
… | |
… | |
482 | val = rxvt_network_display (rs[Rs_display_name]); |
482 | val = rxvt_network_display (rs[Rs_display_name]); |
483 | rs[Rs_display_name] = (const char *)val; |
483 | rs[Rs_display_name] = (const char *)val; |
484 | |
484 | |
485 | if (val == NULL) |
485 | if (val == NULL) |
486 | #endif /* DISPLAY_IS_IP */ |
486 | #endif /* DISPLAY_IS_IP */ |
487 | val = XDisplayString (display->display); |
487 | val = XDisplayString (xdisp); |
488 | |
488 | |
489 | if (rs[Rs_display_name] == NULL) |
489 | if (rs[Rs_display_name] == NULL) |
490 | rs[Rs_display_name] = val; /* use broken `:0' value */ |
490 | rs[Rs_display_name] = val; /* use broken `:0' value */ |
491 | |
491 | |
492 | i = strlen (val); |
492 | i = strlen (val); |
… | |
… | |
737 | /* xcol[0] == white |
737 | /* xcol[0] == white |
738 | * xcol[1] == top shadow |
738 | * xcol[1] == top shadow |
739 | * xcol[2] == bot shadow */ |
739 | * xcol[2] == bot shadow */ |
740 | |
740 | |
741 | xcol[1] = pix_colors[Color_scroll]; |
741 | xcol[1] = pix_colors[Color_scroll]; |
742 | xcol[0].set (this, 65535, 65535, 65535); |
742 | xcol[0].set (this, rxvt_rgba (rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC)); |
743 | |
743 | |
744 | unsigned short pr1, pg1, pb1, pr0, pg0, pb0; |
744 | rxvt_rgba c0, c1; |
745 | |
745 | |
746 | xcol[0].get (this, pr0, pg0, pb0); |
746 | xcol[0].get (this, c0); |
747 | xcol[1].get (this, pr1, pg1, pb1); |
747 | xcol[1].get (this, c1); |
748 | |
748 | |
749 | pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50); |
749 | pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50); |
750 | |
750 | |
751 | /* topShadowColor */ |
751 | /* topShadowColor */ |
752 | if (!xcol[1].set (this, |
752 | if (!xcol[1].set (this, |
|
|
753 | rxvt_rgba ( |
753 | min (pr0, max (pr0 / 5, pr1) * 7 / 5), |
754 | min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), |
754 | min (pg0, max (pg0 / 5, pg1) * 7 / 5), |
755 | min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), |
755 | min (pb0, max (pb0 / 5, pb1) * 7 / 5))) |
756 | min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), |
|
|
757 | c1.a) // pa1 vs. pa0: arbitrary |
|
|
758 | )); |
756 | xcol[1] = pix_colors[Color_White]; |
759 | xcol[1] = pix_colors[Color_White]; |
757 | |
760 | |
758 | pix_colors[Color_topShadow] = xcol[1]; |
761 | pix_colors[Color_topShadow] = xcol[1]; |
759 | } |
762 | } |
760 | #endif /* KEEP_SCROLLCOLOR */ |
763 | #endif /* KEEP_SCROLLCOLOR */ |
… | |
… | |
804 | |
807 | |
805 | if (rsmod |
808 | if (rsmod |
806 | && strcasecmp (rsmod, "mod1") >= 0 && strcasecmp (rsmod, "mod5") <= 0) |
809 | && strcasecmp (rsmod, "mod1") >= 0 && strcasecmp (rsmod, "mod5") <= 0) |
807 | requestedmeta = rsmod[3] - '0'; |
810 | requestedmeta = rsmod[3] - '0'; |
808 | |
811 | |
809 | map = XGetModifierMapping (display->display); |
812 | map = XGetModifierMapping (xdisp); |
810 | kc = map->modifiermap; |
813 | kc = map->modifiermap; |
811 | |
814 | |
812 | for (i = 1; i < 6; i++) |
815 | for (i = 1; i < 6; i++) |
813 | { |
816 | { |
814 | k = (i + 2) * map->max_keypermod; /* skip shift/lock/control */ |
817 | k = (i + 2) * map->max_keypermod; /* skip shift/lock/control */ |
… | |
… | |
816 | for (j = map->max_keypermod; j--; k++) |
819 | for (j = map->max_keypermod; j--; k++) |
817 | { |
820 | { |
818 | if (kc[k] == 0) |
821 | if (kc[k] == 0) |
819 | break; |
822 | break; |
820 | |
823 | |
821 | switch (XKeycodeToKeysym (display->display, kc[k], 0)) |
824 | switch (XKeycodeToKeysym (xdisp, kc[k], 0)) |
822 | { |
825 | { |
823 | case XK_Num_Lock: |
826 | case XK_Num_Lock: |
824 | ModNumLockMask = modmasks[i - 1]; |
827 | ModNumLockMask = modmasks[i - 1]; |
825 | continue; |
828 | continue; |
826 | |
829 | |
… | |
… | |
900 | if (OPTION (Opt_borderLess)) |
903 | if (OPTION (Opt_borderLess)) |
901 | { |
904 | { |
902 | if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None) |
905 | if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None) |
903 | { |
906 | { |
904 | /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ |
907 | /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ |
905 | attributes.override_redirect = TRUE; |
908 | attributes.override_redirect = true; |
906 | mwmhints.flags = 0; |
909 | mwmhints.flags = 0; |
907 | } |
910 | } |
908 | else |
911 | else |
909 | { |
912 | { |
910 | mwmhints.flags = MWM_HINTS_DECORATIONS; |
913 | mwmhints.flags = MWM_HINTS_DECORATIONS; |