From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Seltenreich Newsgroups: gmane.emacs.devel Subject: [patch] use proper color when drawing border of non-toolkit scroll bars Date: Mon, 29 Jan 2007 23:37:11 +0100 Message-ID: <87r6tdv4rs.fsf@gate450.dyndns.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1170110257 20828 80.91.229.12 (29 Jan 2007 22:37:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Jan 2007 22:37:37 +0000 (UTC) Cc: david.hansen@physik.fu-berlin.de To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 29 23:37:35 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HBf7z-0004eg-7b for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2007 23:37:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBf7y-0004rt-OL for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2007 17:37:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HBf7n-0004o9-6I for emacs-devel@gnu.org; Mon, 29 Jan 2007 17:37:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HBf7l-0004mR-Ji for emacs-devel@gnu.org; Mon, 29 Jan 2007 17:37:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBf7l-0004mO-Gn for emacs-devel@gnu.org; Mon, 29 Jan 2007 17:37:17 -0500 Original-Received: from smtp2.rz.uni-karlsruhe.de ([129.13.185.218]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HBf7l-0003i8-0A for emacs-devel@gnu.org; Mon, 29 Jan 2007 17:37:17 -0500 Original-Received: from rzstud3.stud.uni-karlsruhe.de (rzstud3.stud.uni-karlsruhe.de [193.196.41.39]) by smtp2.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1HBf7h-0003MK-M0; Mon, 29 Jan 2007 23:37:13 +0100 Original-Received: from uwi7 by rzstud3.stud.uni-karlsruhe.de with local (Exim 4.43) id 1HBf7h-0007lu-Fc; Mon, 29 Jan 2007 23:37:13 +0100 X-Hashcash: 1:24:070129:emacs-devel@gnu.org::6///OZQITSWed4+i:K0IO User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65602 Archived-At: Hi, the border of non-toolkit scroll bars seems to ignore attempts to customize it via the scroll-bar-foreground frame parameter or the scroll-bar face. Attached is a trivial patch to fix it, although I'm not really sure if it qualifies as a bug. regards, andreas Index: ChangeLog =================================================================== RCS file: /sources/emacs/emacs/src/ChangeLog,v retrieving revision 1.5527 diff -c -0 -r1.5527 ChangeLog *** ChangeLog 29 Jan 2007 17:06:15 -0000 1.5527 --- ChangeLog 29 Jan 2007 22:18:56 -0000 *************** *** 0 **** --- 1,6 ---- + 2007-01-29 Andreas Seltenreich + + * xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose): Use + the foreground color of the scroll-bar face when drawing the + scroll-bar's border. + Index: xterm.c =================================================================== RCS file: /sources/emacs/emacs/src/xterm.c,v retrieving revision 1.938 diff -c -r1.938 xterm.c *** xterm.c 21 Jan 2007 04:18:14 -0000 1.938 --- xterm.c 29 Jan 2007 22:19:08 -0000 *************** *** 5279,5284 **** --- 5279,5289 ---- x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1); + /* Switch to scroll bar foreground color. */ + if (f->output_data.x->scroll_bar_foreground_pixel != -1) + XSetForeground (FRAME_X_DISPLAY (f), gc, + f->output_data.x->scroll_bar_foreground_pixel); + /* Draw a one-pixel border just inside the edges of the scroll bar. */ XDrawRectangle (FRAME_X_DISPLAY (f), w, gc, *************** *** 5287,5292 **** --- 5292,5302 ---- XINT (bar->width) - 1 - width_trim - width_trim, XINT (bar->height) - 1); + /* Restore the foreground color of the GC if we changed it above. */ + if (f->output_data.x->scroll_bar_foreground_pixel != -1) + XSetForeground (FRAME_X_DISPLAY (f), gc, + f->output_data.x->foreground_pixel); + UNBLOCK_INPUT; }