diff options
| author | Kenichi Handa | 2003-09-08 11:56:09 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-09-08 11:56:09 +0000 |
| commit | 463f5630a5e7cbe7f042bc1175d1fa1c4e98860f (patch) | |
| tree | 3287d0c628fea2249abf4635b3a4f45bedd6f8c4 /src/xterm.c | |
| parent | 4256310de631bd57c78b88b5131caa073315b3d7 (diff) | |
| download | emacs-463f5630a5e7cbe7f042bc1175d1fa1c4e98860f.tar.gz emacs-463f5630a5e7cbe7f042bc1175d1fa1c4e98860f.zip | |
New directory
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 64 |
1 files changed, 8 insertions, 56 deletions
diff --git a/src/xterm.c b/src/xterm.c index 3874f3db82f..5463ce8e192 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10120,34 +10120,6 @@ same_x_server (name1, name2) | |||
| 10120 | } | 10120 | } |
| 10121 | #endif | 10121 | #endif |
| 10122 | 10122 | ||
| 10123 | /* Count number of set bits in mask and number of bits to shift to | ||
| 10124 | get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET | ||
| 10125 | to 5. */ | ||
| 10126 | static void | ||
| 10127 | get_bits_and_offset (mask, bits, offset) | ||
| 10128 | unsigned long mask; | ||
| 10129 | int *bits; | ||
| 10130 | int *offset; | ||
| 10131 | { | ||
| 10132 | int nr = 0; | ||
| 10133 | int off = 0; | ||
| 10134 | |||
| 10135 | while (!(mask & 1)) | ||
| 10136 | { | ||
| 10137 | off++; | ||
| 10138 | mask >>= 1; | ||
| 10139 | } | ||
| 10140 | |||
| 10141 | while (mask & 1) | ||
| 10142 | { | ||
| 10143 | nr++; | ||
| 10144 | mask >>= 1; | ||
| 10145 | } | ||
| 10146 | |||
| 10147 | *offset = off; | ||
| 10148 | *bits = nr; | ||
| 10149 | } | ||
| 10150 | |||
| 10151 | struct x_display_info * | 10123 | struct x_display_info * |
| 10152 | x_term_init (display_name, xrm_option, resource_name) | 10124 | x_term_init (display_name, xrm_option, resource_name) |
| 10153 | Lisp_Object display_name; | 10125 | Lisp_Object display_name; |
| @@ -10164,7 +10136,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10164 | if (!x_initialized) | 10136 | if (!x_initialized) |
| 10165 | { | 10137 | { |
| 10166 | x_initialize (); | 10138 | x_initialize (); |
| 10167 | ++x_initialized; | 10139 | x_initialized = 1; |
| 10168 | } | 10140 | } |
| 10169 | 10141 | ||
| 10170 | #ifdef USE_GTK | 10142 | #ifdef USE_GTK |
| @@ -10180,6 +10152,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10180 | if (x_initialized > 1) | 10152 | if (x_initialized > 1) |
| 10181 | return 0; | 10153 | return 0; |
| 10182 | 10154 | ||
| 10155 | x_initialized++; | ||
| 10156 | |||
| 10183 | for (argc = 0; argc < NUM_ARGV; ++argc) | 10157 | for (argc = 0; argc < NUM_ARGV; ++argc) |
| 10184 | argv[argc] = 0; | 10158 | argv[argc] = 0; |
| 10185 | 10159 | ||
| @@ -10220,7 +10194,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10220 | s = make_string (file, strlen (file)); | 10194 | s = make_string (file, strlen (file)); |
| 10221 | abs_file = Fexpand_file_name(s, Qnil); | 10195 | abs_file = Fexpand_file_name(s, Qnil); |
| 10222 | 10196 | ||
| 10223 | if (! NILP (abs_file) && !NILP (Ffile_readable_p (abs_file))) | 10197 | if (! NILP (abs_file) && Ffile_readable_p (abs_file)) |
| 10224 | gtk_rc_parse (SDATA (abs_file)); | 10198 | gtk_rc_parse (SDATA (abs_file)); |
| 10225 | 10199 | ||
| 10226 | UNGCPRO; | 10200 | UNGCPRO; |
| @@ -10369,7 +10343,6 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10369 | dpyinfo->height = HeightOfScreen (dpyinfo->screen); | 10343 | dpyinfo->height = HeightOfScreen (dpyinfo->screen); |
| 10370 | dpyinfo->width = WidthOfScreen (dpyinfo->screen); | 10344 | dpyinfo->width = WidthOfScreen (dpyinfo->screen); |
| 10371 | dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen); | 10345 | dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen); |
| 10372 | dpyinfo->client_leader_window = 0; | ||
| 10373 | dpyinfo->grabbed = 0; | 10346 | dpyinfo->grabbed = 0; |
| 10374 | dpyinfo->reference_count = 0; | 10347 | dpyinfo->reference_count = 0; |
| 10375 | dpyinfo->icon_bitmap_id = -1; | 10348 | dpyinfo->icon_bitmap_id = -1; |
| @@ -10395,20 +10368,6 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10395 | dpyinfo->x_highlight_frame = 0; | 10368 | dpyinfo->x_highlight_frame = 0; |
| 10396 | dpyinfo->image_cache = make_image_cache (); | 10369 | dpyinfo->image_cache = make_image_cache (); |
| 10397 | 10370 | ||
| 10398 | /* See if we can construct pixel values from RGB values. */ | ||
| 10399 | dpyinfo->red_bits = dpyinfo->blue_bits = dpyinfo->green_bits = 0; | ||
| 10400 | dpyinfo->red_offset = dpyinfo->blue_offset = dpyinfo->green_offset = 0; | ||
| 10401 | |||
| 10402 | if (dpyinfo->visual->class == TrueColor) | ||
| 10403 | { | ||
| 10404 | get_bits_and_offset (dpyinfo->visual->red_mask, | ||
| 10405 | &dpyinfo->red_bits, &dpyinfo->red_offset); | ||
| 10406 | get_bits_and_offset (dpyinfo->visual->blue_mask, | ||
| 10407 | &dpyinfo->blue_bits, &dpyinfo->blue_offset); | ||
| 10408 | get_bits_and_offset (dpyinfo->visual->green_mask, | ||
| 10409 | &dpyinfo->green_bits, &dpyinfo->green_offset); | ||
| 10410 | } | ||
| 10411 | |||
| 10412 | /* See if a private colormap is requested. */ | 10371 | /* See if a private colormap is requested. */ |
| 10413 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) | 10372 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
| 10414 | { | 10373 | { |
| @@ -10453,8 +10412,6 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10453 | = XInternAtom (dpyinfo->display, "WM_CONFIGURE_DENIED", False); | 10412 | = XInternAtom (dpyinfo->display, "WM_CONFIGURE_DENIED", False); |
| 10454 | dpyinfo->Xatom_wm_window_moved | 10413 | dpyinfo->Xatom_wm_window_moved |
| 10455 | = XInternAtom (dpyinfo->display, "WM_MOVED", False); | 10414 | = XInternAtom (dpyinfo->display, "WM_MOVED", False); |
| 10456 | dpyinfo->Xatom_wm_client_leader | ||
| 10457 | = XInternAtom (dpyinfo->display, "WM_CLIENT_LEADER", False); | ||
| 10458 | dpyinfo->Xatom_editres | 10415 | dpyinfo->Xatom_editres |
| 10459 | = XInternAtom (dpyinfo->display, "Editres", False); | 10416 | = XInternAtom (dpyinfo->display, "Editres", False); |
| 10460 | dpyinfo->Xatom_CLIPBOARD | 10417 | dpyinfo->Xatom_CLIPBOARD |
| @@ -10609,12 +10566,6 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10609 | #endif | 10566 | #endif |
| 10610 | } | 10567 | } |
| 10611 | 10568 | ||
| 10612 | #ifdef HAVE_X_SM | ||
| 10613 | /* Only do this for the first display. */ | ||
| 10614 | if (x_initialized == 1) | ||
| 10615 | x_session_initialize (dpyinfo); | ||
| 10616 | #endif | ||
| 10617 | |||
| 10618 | UNBLOCK_INPUT; | 10569 | UNBLOCK_INPUT; |
| 10619 | 10570 | ||
| 10620 | return dpyinfo; | 10571 | return dpyinfo; |
| @@ -10828,6 +10779,10 @@ x_initialize () | |||
| 10828 | #endif /* SIGWINCH */ | 10779 | #endif /* SIGWINCH */ |
| 10829 | 10780 | ||
| 10830 | signal (SIGPIPE, x_connection_signal); | 10781 | signal (SIGPIPE, x_connection_signal); |
| 10782 | |||
| 10783 | #ifdef HAVE_X_SM | ||
| 10784 | x_session_initialize (); | ||
| 10785 | #endif | ||
| 10831 | } | 10786 | } |
| 10832 | 10787 | ||
| 10833 | 10788 | ||
| @@ -10930,6 +10885,3 @@ default is nil, which is the same as `super'. */); | |||
| 10930 | } | 10885 | } |
| 10931 | 10886 | ||
| 10932 | #endif /* HAVE_X_WINDOWS */ | 10887 | #endif /* HAVE_X_WINDOWS */ |
| 10933 | |||
| 10934 | /* arch-tag: 6d4e4cb7-abc1-4302-9585-d84dcfb09d0f | ||
| 10935 | (do not change this comment) */ | ||