diff options
| author | Gerd Moellmann | 2000-03-05 10:23:14 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-05 10:23:14 +0000 |
| commit | 5ff67d81bc2162b5901a09e3a3507f96ffa72096 (patch) | |
| tree | 45fdb6134cf7b5a6012d633584db71bff223dbc4 | |
| parent | 28ee91c0e5d64c8e88805cdd24e853be9a9e03e6 (diff) | |
| download | emacs-5ff67d81bc2162b5901a09e3a3507f96ffa72096.tar.gz emacs-5ff67d81bc2162b5901a09e3a3507f96ffa72096.zip | |
(x_term_init): Create a colormap if not using the
default visual.
| -rw-r--r-- | src/xterm.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/xterm.c b/src/xterm.c index 82e3cc308dd..26d87fe3b4e 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -12988,8 +12988,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 12988 | 12988 | ||
| 12989 | dpyinfo->screen = ScreenOfDisplay (dpyinfo->display, | 12989 | dpyinfo->screen = ScreenOfDisplay (dpyinfo->display, |
| 12990 | DefaultScreen (dpyinfo->display)); | 12990 | DefaultScreen (dpyinfo->display)); |
| 12991 | dpyinfo->visual = select_visual (dpyinfo->display, dpyinfo->screen, | 12991 | select_visual (dpyinfo); |
| 12992 | &dpyinfo->n_planes); | ||
| 12993 | dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen); | 12992 | dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen); |
| 12994 | dpyinfo->height = HeightOfScreen (dpyinfo->screen); | 12993 | dpyinfo->height = HeightOfScreen (dpyinfo->screen); |
| 12995 | dpyinfo->width = WidthOfScreen (dpyinfo->screen); | 12994 | dpyinfo->width = WidthOfScreen (dpyinfo->screen); |
| @@ -13018,19 +13017,24 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 13018 | dpyinfo->image_cache = make_image_cache (); | 13017 | dpyinfo->image_cache = make_image_cache (); |
| 13019 | 13018 | ||
| 13020 | /* See if a private colormap is requested. */ | 13019 | /* See if a private colormap is requested. */ |
| 13021 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen) | 13020 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
| 13022 | && dpyinfo->visual->class == PseudoColor) | 13021 | { |
| 13023 | { | 13022 | if (dpyinfo->visual->class == PseudoColor) |
| 13024 | Lisp_Object value; | 13023 | { |
| 13025 | value = display_x_get_resource (dpyinfo, | 13024 | Lisp_Object value; |
| 13026 | build_string ("privateColormap"), | 13025 | value = display_x_get_resource (dpyinfo, |
| 13027 | build_string ("PrivateColormap"), | 13026 | build_string ("privateColormap"), |
| 13028 | Qnil, Qnil); | 13027 | build_string ("PrivateColormap"), |
| 13029 | if (STRINGP (value) | 13028 | Qnil, Qnil); |
| 13030 | && (!strcmp (XSTRING (value)->data, "true") | 13029 | if (STRINGP (value) |
| 13031 | || !strcmp (XSTRING (value)->data, "on"))) | 13030 | && (!strcmp (XSTRING (value)->data, "true") |
| 13032 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); | 13031 | || !strcmp (XSTRING (value)->data, "on"))) |
| 13032 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); | ||
| 13033 | } | ||
| 13033 | } | 13034 | } |
| 13035 | else | ||
| 13036 | dpyinfo->cmap = XCreateColormap (dpyinfo->display, dpyinfo->root_window, | ||
| 13037 | dpyinfo->visual, AllocNone); | ||
| 13034 | 13038 | ||
| 13035 | { | 13039 | { |
| 13036 | int screen_number = XScreenNumberOfScreen (dpyinfo->screen); | 13040 | int screen_number = XScreenNumberOfScreen (dpyinfo->screen); |