diff options
| author | Karoly Lorentey <lorentey@elte.hu> | 2006-01-06 16:13:05 +0000 |
|---|---|---|
| committer | Karoly Lorentey <lorentey@elte.hu> | 2006-01-06 16:13:05 +0000 |
| commit | a8bf7299ee74781dd485c33c5eac20aee0f0ebef (patch) | |
| tree | d2bc1c0d3d7a64a19945b5bb5d175cae37088bca /src/gtkutil.c | |
| parent | e079ecf45241cc5d2904db7ede9592f9861bb9aa (diff) | |
| parent | 600bc46cd52fbdedf592158c6b03ccfca88dbade (diff) | |
| download | emacs-a8bf7299ee74781dd485c33c5eac20aee0f0ebef.tar.gz | |
Merged from miles@gnu.org--gnu-2005 (patch 683-684)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-683
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-684
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-493
Diffstat (limited to 'src/gtkutil.c')
| -rw-r--r-- | src/gtkutil.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index cb8e5a21860..ce66c5de35e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -322,43 +322,43 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) GdkPixmap *gmask; GdkDisplay *gdpy; - /* If we are on a one bit display, let GTK do all the image handling. + /* If we have a file, let GTK do all the image handling. This seems to be the only way to make insensitive and activated icons - look good. */ - if (x_screen_planes (f) == 1) - { - Lisp_Object specified_file = Qnil; - Lisp_Object tail; - extern Lisp_Object QCfile; - - for (tail = XCDR (img->spec); - NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail)); - tail = XCDR (XCDR (tail))) - if (EQ (XCAR (tail), QCfile)) - specified_file = XCAR (XCDR (tail)); + look good in all cases. */ + Lisp_Object specified_file = Qnil; + Lisp_Object tail; + extern Lisp_Object QCfile; - if (STRINGP (specified_file)) - { + for (tail = XCDR (img->spec); + NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail)); + tail = XCDR (XCDR (tail))) + if (EQ (XCAR (tail), QCfile)) + specified_file = XCAR (XCDR (tail)); - Lisp_Object file = Qnil; - struct gcpro gcpro1; - GCPRO1 (file); + if (STRINGP (specified_file)) + { + Lisp_Object file = Qnil; + struct gcpro gcpro1; + GCPRO1 (file); - file = x_find_image_file (specified_file); - /* We already loaded the image once before calling this - function, so this should not fail. */ - xassert (STRINGP (file) != 0); + file = x_find_image_file (specified_file); + /* We already loaded the image once before calling this + function, so this should not fail. */ + xassert (STRINGP (file) != 0); - if (! old_widget) - old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); - else - gtk_image_set_from_file (old_widget, SSDATA (file)); + if (! old_widget) + old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); + else + gtk_image_set_from_file (old_widget, SSDATA (file)); - UNGCPRO; - return GTK_WIDGET (old_widget); - } + UNGCPRO; + return GTK_WIDGET (old_widget); } + /* No file, do the image handling ourselves. This will look very bad + on a monochrome display, and sometimes bad on all displays with + certain themes. */ + gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; |
