… | |
… | |
185 | "INCR", |
185 | "INCR", |
186 | "WM_PROTOCOLS", |
186 | "WM_PROTOCOLS", |
187 | "WM_DELETE_WINDOW", |
187 | "WM_DELETE_WINDOW", |
188 | "CLIPBOARD", |
188 | "CLIPBOARD", |
189 | #if ENABLE_FRILLS |
189 | #if ENABLE_FRILLS |
|
|
190 | "_MOTIF_WM_HINTS", |
|
|
191 | #endif |
|
|
192 | #if ENABLE_EWMH |
190 | "_NET_WM_PID", |
193 | "_NET_WM_PID", |
191 | "_MOTIF_WM_HINTS", |
|
|
192 | "_NET_WM_NAME", |
194 | "_NET_WM_NAME", |
193 | "_NET_WM_ICON_NAME", |
195 | "_NET_WM_ICON_NAME", |
|
|
196 | "_NET_WM_PING", |
194 | #endif |
197 | #endif |
195 | #if USE_XIM |
198 | #if USE_XIM |
196 | "WM_LOCALE_NAME", |
199 | "WM_LOCALE_NAME", |
197 | #endif |
200 | #endif |
198 | #ifdef TRANSPARENT |
201 | #ifdef TRANSPARENT |
… | |
… | |
341 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
344 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
342 | rs[Rs_display_name] = ":0"; |
345 | rs[Rs_display_name] = ":0"; |
343 | |
346 | |
344 | get_options (r_argc, r_argv); |
347 | get_options (r_argc, r_argv); |
345 | |
348 | |
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]))) |
349 | if (!(display = displays.get (rs[Rs_display_name]))) |
359 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
350 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
360 | |
351 | |
361 | extract_resources (); |
352 | extract_resources (); |
362 | free (r_argv); |
353 | free (r_argv); |
363 | |
354 | |
… | |
… | |
769 | * from the fvwm window manager. |
760 | * from the fvwm window manager. |
770 | */ |
761 | */ |
771 | #ifdef KEEP_SCROLLCOLOR |
762 | #ifdef KEEP_SCROLLCOLOR |
772 | |
763 | |
773 | if (display->depth <= 2) |
764 | if (display->depth <= 2) |
|
|
765 | { |
774 | { /* Monochrome */ |
766 | /* Monochrome */ |
775 | pix_colors[Color_scroll] = pix_colors[Color_fg]; |
767 | pix_colors[Color_scroll] = pix_colors[Color_fg]; |
776 | pix_colors[Color_topShadow] = pix_colors[Color_bg]; |
768 | pix_colors[Color_topShadow] = pix_colors[Color_bg]; |
777 | pix_colors[Color_bottomShadow] = pix_colors[Color_bg]; |
769 | pix_colors[Color_bottomShadow] = pix_colors[Color_bg]; |
778 | } |
770 | } |
779 | else |
771 | else |
… | |
… | |
967 | mwmhints.flags = MWM_HINTS_DECORATIONS; |
959 | mwmhints.flags = MWM_HINTS_DECORATIONS; |
968 | mwmhints.decorations = 0; |
960 | mwmhints.decorations = 0; |
969 | } |
961 | } |
970 | } |
962 | } |
971 | else |
963 | else |
972 | { |
|
|
973 | mwmhints.flags = 0; |
964 | mwmhints.flags = 0; |
974 | } |
|
|
975 | #endif |
965 | #endif |
976 | |
966 | |
977 | /* grab colors before netscape does */ |
967 | /* grab colors before netscape does */ |
978 | Get_Colours (); |
968 | Get_Colours (); |
979 | |
969 | |
… | |
… | |
1033 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1023 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1034 | wmHint.input = True; |
1024 | wmHint.input = True; |
1035 | wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; |
1025 | wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; |
1036 | wmHint.window_group = top; |
1026 | wmHint.window_group = top; |
1037 | |
1027 | |
1038 | XSetWMProperties (disp, top, NULL, NULL, |
1028 | XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, |
1039 | (char **)argv, argc, &szHint, &wmHint, &classHint); |
1029 | &szHint, &wmHint, &classHint); |
1040 | |
1030 | |
1041 | /* Enable delete window protocol */ |
1031 | Atom protocols[] = { |
1042 | XSetWMProtocols (disp, top, &xa[XA_WM_DELETE_WINDOW], 1); |
1032 | xa[XA_WM_DELETE_WINDOW], |
|
|
1033 | #if ENABLE_EWMH |
|
|
1034 | xa[XA_NET_WM_PING], |
|
|
1035 | #endif |
|
|
1036 | }; |
1043 | |
1037 | |
1044 | #if ENABLE_FRILLS |
1038 | XSetWMProtocols (disp, top, protocols, sizeof (protocols) / sizeof (protocols[0])); |
|
|
1039 | |
|
|
1040 | #if ENABLE_EWMH |
1045 | long pid = getpid (); |
1041 | long pid = getpid (); |
1046 | |
1042 | |
1047 | XChangeProperty (disp, top, |
1043 | XChangeProperty (disp, top, |
1048 | xa[XA_NET_WM_PID], XA_CARDINAL, 32, |
1044 | xa[XA_NET_WM_PID], XA_CARDINAL, 32, |
1049 | PropModeReplace, (unsigned char *)&pid, 1); |
1045 | PropModeReplace, (unsigned char *)&pid, 1); |
|
|
1046 | |
|
|
1047 | // _NET_WM_WINDOW_TYPE is NORMAL, which is the default |
1050 | #endif |
1048 | #endif |
1051 | |
1049 | |
1052 | XSelectInput (disp, top, |
1050 | XSelectInput (disp, top, |
1053 | KeyPressMask |
1051 | KeyPressMask |
1054 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 |
1052 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 |