Drop Shadow Effect for GTK+-2.2.x/GTK+-2.4.x Menus

Last update: 2004-06-20 - Olivier Fourdan < fourdan at xfce dot org>

Introduction

The following patches are based on the work from Iain published on the GNOME desktop devel list in February 2003.

I took Iain's patch and tried to fix all the issues I found, while improving the overall look of the drop shadow.

It's not perfect (and I doubt it will ever be unless someone comes up with true alpha blendering on X11), it's still a hack, but it works fairly well (for me at least). I've tried this patch with plenty of gtk2 based software, like xfce4, Eclipse 2.1, gnome 2.2, Ximian evolution 1.4, Abiword-2.0 and it worked all right so far.

The patched library should be binary compatible with an unpatched version.

This comes with ABSOLUTELY NO WARRANTY OF ANY KIND - USE IT AT YOUR OWN RISK.
Make sure you backup the original gtk+-2.x library before installing the patched version
.

Screenshot

Most people will wonder how it looks, some will even wonder what I'm talking about. So here comes a screenshot.

Notice the thin shadow under the menu :


Applying the patch

The most recent version of the patch applies to gtk+-2.4. You should use this one if you are running a recent Linux distribution that ships gtk+-2.4 (such as fedora Core 2).
  1. Get the patch here (15Kb) and save it on your hard drive
  2. Get gtk+-2.4.? sources from here
  3. Untar it in some location of your hard drive
  4. Change directory to gtk+-2.4.?/ (change "?" to the correct value)
  5. Apply the patch with "cat <path_to_the_patch>/gtk+-2.4.0-menushadow.patch | patch -p1"
  6. Compile and install the patched version of gtk+ (I use "./configure --prefix=/usr --sysconfdir=/etc && make && make install" myself, adjust to your taste)
  7. Run a gtk2 based application and enjoy :)
The older patch applies on a gtk+-2.2 source tree. This version should be used for those who run an older version of Linux that ships with gtk+-2.2 (do not use this patch on a gtk+-2.0 source tree, that won't work and there is no plan to backport this patch to gtk+-2.0.x)
  1. Get the patch here (15Kb) and save it on your hard drive
  2. Get gtk+-2.2.? sources from here
  3. Untar it in some location of your hard drive
  4. Change directory to gtk+-2.2.?/ (change "?" to the correct value)
  5. Apply the patch with "cat <path_to_the_patch>/gtk+-menushadow.patch | patch -p1"
  6. Compile and install the patched version of gtk+ (I use "./configure --prefix=/usr --sysconfdir=/etc && make && make install" myself, adjust to your taste)
  7. Run a gtk2 based application and enjoy :)

Getting a pre-patched RPM

Note this version also includes patches from Red Hat and Ximian Desktop 2.

Getting a pre-patched tarball

This version also includes patches from Red Hat and Ximian Desktop 2.

Configuration

There are a couple of parameters that can be adjusted using the gtkrc file (either from a theme or from $HOME/.gtkrc-2.0)

Feedback

Well, I make this available, but I don't have much time to support it. Use it at your own risk! However, if you really want to send some feedback, you can mail me here:

Olivier Fourdan <fourdan at xfce dot org>

Changes

2003-05-20
Olivier Fourdan
  • Initial Release
2003-05-21
Olivier Fourdan
  • Make shadow 5 pixels wide (instead of 4)
  • Fix a display bug and a memory leak when the menu is located on a screen edge
2003-05-23
Olivier Fourdan
  • Bug fix
2003-06-05
Olivier Fourdan
  • Move files to sf.net
  • Make Red Hat 9 rpms available
2003-06-21
Olivier Fourdan
  • Fix a bug in multiscreen mode (not Xinerama) that caused GNOME panel to crash
  • Update to gtk version 2.2.2
  • Add some patches from Ximian Desktop 2 to prebuilt rpms and tarball
Gert-Jan Brink
  • Smoother shadows and corners
2003-07-06
Olivier Fourdan
  • Fix src rpm so it builds on non Red Hat systems (ie w/out patched fontconfig)
2003-09-09
Olivier Fourdan
  • Update to gtk version 2.2.4
2004-03-10
Olivier Fourdan
  • Port to gtk version 2.3.6
2004-03-20
Olivier Fourdan
  • Port to gtk version 2.4.0
2004-05-02
Olivier Fourdan
  • Prepare gtk+-2.4.1 pre-patched version
2004-06-20
Olivier Fourdan
  • Prepare gtk+-2.4.3 pre-patched version

SourceForge.net Logo