unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Can't start Emacs on a monochrome display
@ 2003-07-15 11:37 Kenichi Handa
  2003-07-30 13:17 ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2003-07-15 11:37 UTC (permalink / raw)


With the latest CVS HEAD, I can't start Emacs on a
monochrome display.

Starting program: /usr/local/work/emacs-head/src/emacs -display etlken:0.0

Breakpoint 2, x_error_quitter (display=0x84f99f8, error=0xbfffdc6c)
    at xterm.c:7829
(gdb) n
(gdb) n
(gdb) p buf1
$6 = "X protocol error: BadPixmap (invalid Pixmap parameter) on protocol request 54", '\0' <repeats 143 times>"...
(gdb) up 5
#5  0x080b9e2b in x_defined_color (f=0x840f4a0, color_name=0x84e1a00 "white", 
    color=0xbfffde20, alloc_p=1) at xfns.c:1028
(gdb) list
1023	  int success_p;
1024	  Display *dpy = FRAME_X_DISPLAY (f);
1025	  Colormap cmap = FRAME_X_COLORMAP (f);
1026	
1027	  BLOCK_INPUT;
1028	  success_p = XParseColor (dpy, cmap, color_name, color);
1029	  if (success_p && alloc_p)
1030	    success_p = x_alloc_nearest_color (f, cmap, color);
1031	  UNBLOCK_INPUT;
1032	

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-07-15 11:37 Can't start Emacs on a monochrome display Kenichi Handa
@ 2003-07-30 13:17 ` Kenichi Handa
  2003-07-31  0:58   ` Kenichi Handa
  2003-08-01  2:20   ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Kenichi Handa @ 2003-07-30 13:17 UTC (permalink / raw)
  Cc: terjeros

In article <200307151137.UAA15223@etlken.m17n.org>, Kenichi Handa <handa@m17n.org> writes:
> With the latest CVS HEAD, I can't start Emacs on a
> monochrome display.

> Starting program: /usr/local/work/emacs-head/src/emacs -display etlken:0.0

> Breakpoint 2, x_error_quitter (display=0x84f99f8, error=0xbfffdc6c)
>     at xterm.c:7829
> (gdb) n
> (gdb) n
> (gdb) p buf1
> $6 = "X protocol error: BadPixmap (invalid Pixmap parameter) on protocol request 54", '\0' <repeats 143 times>"...
> (gdb) up 5
> #5  0x080b9e2b in x_defined_color (f=0x840f4a0, color_name=0x84e1a00 "white", 
>     color=0xbfffde20, alloc_p=1) at xfns.c:1028

I tracked this problem down to this change:

2003-07-13  Terje Rosten  <terjeros@phys.ntnu.no>

	* xterm.c (x_bitmap_icon,x_wm_set_icon_pixmap): Modify to add mask,
	and use the Gtk+ function gtk_window_icon_from_file if available.

	* xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to
	handle mask of bitmaps.
	(x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the
	mask property.
	(xg_set_icon): New function, wrapper for gtk_window_icon_from_file.

	* xterm.h (xg_set_icon): New function.

When I cancel this change, Emacs starts up correctly on a
monochrome display.

Terje, don't you have any idea about what is wrong?

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-07-30 13:17 ` Kenichi Handa
@ 2003-07-31  0:58   ` Kenichi Handa
  2003-08-01  2:20   ` Richard Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Kenichi Handa @ 2003-07-31  0:58 UTC (permalink / raw)
  Cc: terjeros, emacs-devel

In article <200307301317.WAA06628@etlken.m17n.org>, Kenichi Handa <handa@m17n.org> writes:
> I tracked this problem down to this change:

> 2003-07-13  Terje Rosten  <terjeros@phys.ntnu.no>

> 	* xterm.c (x_bitmap_icon,x_wm_set_icon_pixmap): Modify to add mask,
> 	and use the Gtk+ function gtk_window_icon_from_file if available.

> 	* xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to
> 	handle mask of bitmaps.
> 	(x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the
> 	mask property.
> 	(xg_set_icon): New function, wrapper for gtk_window_icon_from_file.

> 	* xterm.h (xg_set_icon): New function.

> When I cancel this change, Emacs starts up correctly on a
> monochrome display.

I found what's wrong.  On monochrome display, Emacs calls
load_pixmap to make a stipple of a face.  This function
creates a pixmap without mask.  But, x_destroy_bitmap
unconditionaly tries to free a mask, thus xlib will free
unallocated memory.  So, I've installed these changes.

2003-07-31  Kenichi Handa  <handa@m17n.org>

	* xterm.h (struct x_bitmap_record): New member have_mask.

	* xfns.c (x_create_bitmap_from_data): Initialize have_mask member
	to 0.
	(x_create_bitmap_from_file): Likewise.
	(x_destroy_bitmap): Check have_mask member before freeing a mask.
	(x_destroy_all_bitmaps): Likewise.
	(x_create_bitmap_mask): Set have_mask member to 1.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-07-30 13:17 ` Kenichi Handa
  2003-07-31  0:58   ` Kenichi Handa
@ 2003-08-01  2:20   ` Richard Stallman
  2003-08-01  6:00     ` Jan D.
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2003-08-01  2:20 UTC (permalink / raw)
  Cc: terjeros, emacs-devel

I asked Jan Djarv to look at this, since it concerns GTK,
but he has not answered so I suspect he is on vacation.
If someone else can figure it out, that would be good.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-08-01  2:20   ` Richard Stallman
@ 2003-08-01  6:00     ` Jan D.
  2003-08-01  6:34       ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Jan D. @ 2003-08-01  6:00 UTC (permalink / raw)
  Cc: emacs-devel, terjeros, Kenichi Handa


> I asked Jan Djarv to look at this, since it concerns GTK,
> but he has not answered so I suspect he is on vacation.
> If someone else can figure it out, that would be good.

I got the impression Handa-san fixed this.  Is that the case?

	Jan D.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-08-01  6:00     ` Jan D.
@ 2003-08-01  6:34       ` Kenichi Handa
  2003-08-02 17:24         ` Terje Rosten
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2003-08-01  6:34 UTC (permalink / raw)
  Cc: emacs-devel, rms, terjeros

In article <64563F69-C3E5-11D7-8BF5-00039363E640@swipnet.se>, "Jan D." <jan.h.d@swipnet.se> writes:
>>  I asked Jan Djarv to look at this, since it concerns GTK,
>>  but he has not answered so I suspect he is on vacation.
>>  If someone else can figure it out, that would be good.

> I got the impression Handa-san fixed this.  Is that the case?

Yes.  I'll attach the relevant mail again.   

---
Ken'ichi HANDA
handa@m17n.org

----------------------------------------------------------------------
Date: Thu, 31 Jul 2003 09:58:45 +0900 (JST)
From: Kenichi Handa <handa@m17n.org>
To: handa@m17n.org
In-reply-to: <200307301317.WAA06628@etlken.m17n.org> (message from Kenichi	Handa on Wed, 30 Jul 2003 22:17:50 +0900 (JST))
Cc: terjeros@phys.ntnu.no, emacs-devel@gnu.org
Subject: Re: Can't start Emacs on a monochrome display
X-Mailman-Copy: yes
Sender: emacs-devel-bounces+handa=m17n.org@gnu.org

In article <200307301317.WAA06628@etlken.m17n.org>, Kenichi Handa <handa@m17n.org> writes:
> I tracked this problem down to this change:

> 2003-07-13  Terje Rosten  <terjeros@phys.ntnu.no>

> 	* xterm.c (x_bitmap_icon,x_wm_set_icon_pixmap): Modify to add mask,
> 	and use the Gtk+ function gtk_window_icon_from_file if available.

> 	* xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to
> 	handle mask of bitmaps.
> 	(x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the
> 	mask property.
> 	(xg_set_icon): New function, wrapper for gtk_window_icon_from_file.

> 	* xterm.h (xg_set_icon): New function.

> When I cancel this change, Emacs starts up correctly on a
> monochrome display.

I found what's wrong.  On monochrome display, Emacs calls
load_pixmap to make a stipple of a face.  This function
creates a pixmap without mask.  But, x_destroy_bitmap
unconditionaly tries to free a mask, thus xlib will free
unallocated memory.  So, I've installed these changes.

2003-07-31  Kenichi Handa  <handa@m17n.org>

	* xterm.h (struct x_bitmap_record): New member have_mask.

	* xfns.c (x_create_bitmap_from_data): Initialize have_mask member
	to 0.
	(x_create_bitmap_from_file): Likewise.
	(x_destroy_bitmap): Check have_mask member before freeing a mask.
	(x_destroy_all_bitmaps): Likewise.
	(x_create_bitmap_mask): Set have_mask member to 1.

---
Ken'ichi HANDA
handa@m17n.org


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't start Emacs on a monochrome display
  2003-08-01  6:34       ` Kenichi Handa
@ 2003-08-02 17:24         ` Terje Rosten
  0 siblings, 0 replies; 7+ messages in thread
From: Terje Rosten @ 2003-08-02 17:24 UTC (permalink / raw)
  Cc: jan.h.d, rms, emacs-devel

* Kenichi Handa
| 
| >>  I asked Jan Djarv to look at this, since it concerns GTK,
| >>  but he has not answered so I suspect he is on vacation.
| >>  If someone else can figure it out, that would be good.
| 
| > I got the impression Handa-san fixed this.  Is that the case?
| 
| Yes.  I'll attach the relevant mail again.   

I can confirm the patch is correct. It's not a GTK issue. Thanks for
fixing the problem.


 - Terje

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-08-02 17:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-15 11:37 Can't start Emacs on a monochrome display Kenichi Handa
2003-07-30 13:17 ` Kenichi Handa
2003-07-31  0:58   ` Kenichi Handa
2003-08-01  2:20   ` Richard Stallman
2003-08-01  6:00     ` Jan D.
2003-08-01  6:34       ` Kenichi Handa
2003-08-02 17:24         ` Terje Rosten

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).