… | |
… | |
169 | COLOR_SCROLLTROUGH, |
169 | COLOR_SCROLLTROUGH, |
170 | #endif /* KEEP_SCROLLCOLOR */ |
170 | #endif /* KEEP_SCROLLCOLOR */ |
171 | #if TINTING |
171 | #if TINTING |
172 | NULL, |
172 | NULL, |
173 | #endif |
173 | #endif |
|
|
174 | #if OFF_FOCUS_FADING |
|
|
175 | "black", |
|
|
176 | #endif |
174 | }; |
177 | }; |
175 | |
178 | |
176 | const char *const xa_names[] = |
179 | const char *const xa_names[] = |
177 | { |
180 | { |
178 | "TEXT", |
181 | "TEXT", |
… | |
… | |
185 | "INCR", |
188 | "INCR", |
186 | "WM_PROTOCOLS", |
189 | "WM_PROTOCOLS", |
187 | "WM_DELETE_WINDOW", |
190 | "WM_DELETE_WINDOW", |
188 | "CLIPBOARD", |
191 | "CLIPBOARD", |
189 | #if ENABLE_FRILLS |
192 | #if ENABLE_FRILLS |
|
|
193 | "_MOTIF_WM_HINTS", |
|
|
194 | #endif |
|
|
195 | #if ENABLE_EWMH |
190 | "_NET_WM_PID", |
196 | "_NET_WM_PID", |
191 | "_MOTIF_WM_HINTS", |
|
|
192 | "_NET_WM_NAME", |
197 | "_NET_WM_NAME", |
193 | "_NET_WM_ICON_NAME", |
198 | "_NET_WM_ICON_NAME", |
|
|
199 | "_NET_WM_PING", |
194 | #endif |
200 | #endif |
195 | #if USE_XIM |
201 | #if USE_XIM |
196 | "WM_LOCALE_NAME", |
202 | "WM_LOCALE_NAME", |
197 | #endif |
203 | #endif |
198 | #ifdef TRANSPARENT |
204 | #ifdef TRANSPARENT |
… | |
… | |
341 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
347 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
342 | rs[Rs_display_name] = ":0"; |
348 | rs[Rs_display_name] = ":0"; |
343 | |
349 | |
344 | get_options (r_argc, r_argv); |
350 | get_options (r_argc, r_argv); |
345 | |
351 | |
346 | #ifdef LOCAL_X_IS_UNIX |
|
|
347 | if (rs[Rs_display_name][0] == ':') |
|
|
348 | { |
|
|
349 | val = rxvt_malloc (5 + strlen (rs[Rs_display_name])); |
|
|
350 | strcpy (val, "unix"); |
|
|
351 | strcat (val, rs[Rs_display_name]); |
|
|
352 | display = displays.get (val); |
|
|
353 | free (val); |
|
|
354 | } |
|
|
355 | #endif |
|
|
356 | |
|
|
357 | if (!display |
|
|
358 | && ! (display = displays.get (rs[Rs_display_name]))) |
352 | if (!(display = displays.get (rs[Rs_display_name]))) |
359 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
353 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
360 | |
354 | |
361 | extract_resources (); |
355 | extract_resources (); |
362 | free (r_argv); |
356 | free (r_argv); |
363 | |
357 | |
… | |
… | |
746 | } |
740 | } |
747 | } |
741 | } |
748 | } |
742 | } |
749 | |
743 | |
750 | pix_colors[i] = xcol; |
744 | pix_colors[i] = xcol; |
|
|
745 | SET_PIXCOLOR (i); |
|
|
746 | } |
|
|
747 | |
751 | #ifdef OFF_FOCUS_FADING |
748 | #ifdef OFF_FOCUS_FADING |
752 | if (rs[Rs_fade]) |
749 | if (rs[Rs_fade]) |
|
|
750 | for (i = 0; i < (display->depth <= 2 ? 2 : NRS_COLORS); i++) |
753 | pix_colors_unfocused[i] = xcol.fade (display, atoi (rs[Rs_fade])); |
751 | pix_colors_unfocused[i] = pix_colors_focused[i].fade (display, atoi (rs[Rs_fade]), pix_colors[Color_fade]); |
754 | #endif |
752 | #endif |
755 | SET_PIXCOLOR (i); |
|
|
756 | } |
|
|
757 | |
753 | |
758 | if (display->depth <= 2) |
754 | if (display->depth <= 2) |
759 | { |
755 | { |
760 | if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg]; |
756 | if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg]; |
761 | if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg]; |
757 | if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg]; |
… | |
… | |
769 | * from the fvwm window manager. |
765 | * from the fvwm window manager. |
770 | */ |
766 | */ |
771 | #ifdef KEEP_SCROLLCOLOR |
767 | #ifdef KEEP_SCROLLCOLOR |
772 | |
768 | |
773 | if (display->depth <= 2) |
769 | if (display->depth <= 2) |
|
|
770 | { |
774 | { /* Monochrome */ |
771 | /* Monochrome */ |
775 | pix_colors[Color_scroll] = pix_colors[Color_fg]; |
772 | pix_colors[Color_scroll] = pix_colors[Color_fg]; |
776 | pix_colors[Color_topShadow] = pix_colors[Color_bg]; |
773 | pix_colors[Color_topShadow] = pix_colors[Color_bg]; |
777 | pix_colors[Color_bottomShadow] = pix_colors[Color_bg]; |
774 | pix_colors[Color_bottomShadow] = pix_colors[Color_bg]; |
778 | } |
775 | } |
779 | else |
776 | else |
… | |
… | |
967 | mwmhints.flags = MWM_HINTS_DECORATIONS; |
964 | mwmhints.flags = MWM_HINTS_DECORATIONS; |
968 | mwmhints.decorations = 0; |
965 | mwmhints.decorations = 0; |
969 | } |
966 | } |
970 | } |
967 | } |
971 | else |
968 | else |
972 | { |
|
|
973 | mwmhints.flags = 0; |
969 | mwmhints.flags = 0; |
974 | } |
|
|
975 | #endif |
970 | #endif |
976 | |
971 | |
977 | /* grab colors before netscape does */ |
972 | /* grab colors before netscape does */ |
978 | Get_Colours (); |
973 | Get_Colours (); |
979 | |
974 | |
… | |
… | |
1033 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1028 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1034 | wmHint.input = True; |
1029 | wmHint.input = True; |
1035 | wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; |
1030 | wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; |
1036 | wmHint.window_group = top; |
1031 | wmHint.window_group = top; |
1037 | |
1032 | |
1038 | XSetWMProperties (disp, top, NULL, NULL, |
1033 | XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, |
1039 | (char **)argv, argc, &szHint, &wmHint, &classHint); |
1034 | &szHint, &wmHint, &classHint); |
1040 | |
1035 | |
1041 | /* Enable delete window protocol */ |
1036 | Atom protocols[] = { |
1042 | XSetWMProtocols (disp, top, &xa[XA_WM_DELETE_WINDOW], 1); |
1037 | xa[XA_WM_DELETE_WINDOW], |
|
|
1038 | #if ENABLE_EWMH |
|
|
1039 | xa[XA_NET_WM_PING], |
|
|
1040 | #endif |
|
|
1041 | }; |
1043 | |
1042 | |
1044 | #if ENABLE_FRILLS |
1043 | XSetWMProtocols (disp, top, protocols, sizeof (protocols) / sizeof (protocols[0])); |
|
|
1044 | |
|
|
1045 | #if ENABLE_EWMH |
1045 | long pid = getpid (); |
1046 | long pid = getpid (); |
1046 | |
1047 | |
1047 | XChangeProperty (disp, top, |
1048 | XChangeProperty (disp, top, |
1048 | xa[XA_NET_WM_PID], XA_CARDINAL, 32, |
1049 | xa[XA_NET_WM_PID], XA_CARDINAL, 32, |
1049 | PropModeReplace, (unsigned char *)&pid, 1); |
1050 | PropModeReplace, (unsigned char *)&pid, 1); |
|
|
1051 | |
|
|
1052 | // _NET_WM_WINDOW_TYPE is NORMAL, which is the default |
1050 | #endif |
1053 | #endif |
1051 | |
1054 | |
1052 | XSelectInput (disp, top, |
1055 | XSelectInput (disp, top, |
1053 | KeyPressMask |
1056 | KeyPressMask |
1054 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 |
1057 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 |