From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: GTK pixmap background support? Date: Thu, 14 Aug 2003 18:30:04 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <8F1738F1-CE74-11D7-BA9D-00039363E640@swipnet.se> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1060879034 31115 80.91.224.253 (14 Aug 2003 16:37:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2003 16:37:14 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Aug 14 18:37:12 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19nL68-0007rC-00 for ; Thu, 14 Aug 2003 18:37:12 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19nL6l-0007qP-00 for ; Thu, 14 Aug 2003 18:37:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19nL1r-0003NK-TV for emacs-devel@quimby.gnus.org; Thu, 14 Aug 2003 12:32:47 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19nL1U-0003GE-C0 for emacs-devel@gnu.org; Thu, 14 Aug 2003 12:32:24 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19nL0x-0002Yl-Ff for emacs-devel@gnu.org; Thu, 14 Aug 2003 12:32:22 -0400 Original-Received: from [193.201.16.94] (helo=stubby.bodenonline.com) by monty-python.gnu.org with esmtp (Exim 4.20) id 19nL0w-0002YZ-NW; Thu, 14 Aug 2003 12:31:50 -0400 Original-Received: from accessno42.bodenonline.com (accessno42.bodenonline.com [193.201.16.44]) by stubby.bodenonline.com (8.12.1/8.12.1) with ESMTP id h7EHI3jJ004297; Thu, 14 Aug 2003 19:18:04 +0200 Original-To: Miles Bader In-Reply-To: X-Mailer: Apple Mail (2.552) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15947 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15947 > 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. Yes, since the display engine in Emacs uses X calls, GTK must be kept in sync so it doesn't mess things up. > > 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 > incorrectly. > > 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. I have no solution to this. I disabled setting of a background pixmap by GTK themes because of the problems you are seeing. I suspect you need to look at the GTK (or rather GDK) code to see exactly what it is doing, and how Emacs can work with it. In general you set a background pixmap with styles. If you look at xg_create_frame_widgets (near the end) in gtkutil.c, you can see how it is disabled. By setting bg_pixmap in a GtkStyle to a suitable GdkPixmap, and the apply the style to the widget, you can set a background pixmap for the GTK widget. Jan D.