[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GTK pixmap background support?

From: Miles Bader
Subject: GTK pixmap background support?
Date: 13 Aug 2003 20:04:36 +0900


I've been working on my pixmap background patch for emacs, and have run
into a slight bad interaction with the GTK toolkit support; I think it
can be worked around, but would like to see if it's possible to solve
it more cleanly.

Basically, when emacs sets the default background color, it this (in

   x_set_background_color (f, arg, oldval)
         XSetWindowBackground (dpy, FRAME_X_WINDOW (f), bg);
   #ifdef USE_GTK
         xg_set_background_color (f, bg);

`xg_set_background_color' looks like this:

   xg_set_background_color (f, bg)
        gtk_widget_modify_bg (FRAME_GTK_WIDGET (f), GTK_STATE_NORMAL, &gdk_bg);

This means that calls to XClear*, and exposures, will start out with the
correct background color, and emacs need only worry about changing other
things.  When using the GTK toolkit, GTK itself apparently uses
XSetWindowBackground for its own purposes, but the xg_set_background gives
GTK enough info to keep things basically how emacs likes.

However, with pixmap backgrounds, I want to use `XSetWindowBackgroundPixmap'
instead -- but there doesn't appear to be any equivalent call to
`gtk_widget_modify_bg' that takes a pixmap instead of a color!  So you can
see the problem:  even though I've done a XSetWindowBackgroundPixmap, GTK
will at some point set the window background to a color, and there doesn't
seem to be any way to tell it not to, so clears/exposures come out

As it happens, I think I have to support more complete redrawing modes in
emacs anyway (for more complicated background tiling than just simple
frame-relative pixmaps), but it would be nice to be able to use the native X
calls when possible, as it's more efficient, and probably going to be less
buggy for a while... :-)

So can you see any possible GTK solution to this qunadary?  I thought maybe
it would possible to do something tricky by consing up a theme or something,
but that seems rather hairy and certainly beyond my limited experience.


.Numeric stability is probably not all that important when you're guessing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]