From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Timo Savola Newsgroups: gmane.emacs.devel Subject: GTK scrollbar position Date: Tue, 11 Apr 2006 20:00:44 +0300 Message-ID: <1144774844.4302.20.camel@localhost.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-u8AJ9e3mULj4LvDa1O/J" X-Trace: sea.gmane.org 1144774869 20774 80.91.229.2 (11 Apr 2006 17:01:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2006 17:01:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 19:01:04 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTMEe-0001l0-J5 for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 19:01:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTMEe-0006hI-2W for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 13:01:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTMES-0006h3-3f for emacs-devel@gnu.org; Tue, 11 Apr 2006 13:00:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTMEN-0006gU-8C for emacs-devel@gnu.org; Tue, 11 Apr 2006 13:00:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTMEN-0006gM-1x for emacs-devel@gnu.org; Tue, 11 Apr 2006 13:00:43 -0400 Original-Received: from [62.236.91.5] (helo=dmgw.movial.fi) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FTMJG-0002u0-IH for emacs-devel@gnu.org; Tue, 11 Apr 2006 13:05:47 -0400 Original-Received: from movial.fi (hellmail.movial.fi [62.236.91.6]) by dmgw.movial.fi (Postfix) with ESMTP id 61AA64C8 for ; Tue, 11 Apr 2006 20:00:34 +0300 (EEST) Original-Received: from localhost (hellmail.movial.fi [127.0.0.1]) by movial.fi (Postfix) with ESMTP id 45C908007A for ; Tue, 11 Apr 2006 20:00:34 +0300 (EEST) Original-Received: from movial.fi ([127.0.0.1]) by localhost (hellmail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04644-04 for ; Tue, 11 Apr 2006 20:00:34 +0300 (EEST) Original-Received: from localhost.localdomain (ext-ssh.movial.fi [62.236.91.4]) by movial.fi (Postfix) with ESMTP id 09F1B8006A for ; Tue, 11 Apr 2006 20:00:34 +0300 (EEST) Original-To: emacs-devel@gnu.org X-Mailer: Evolution 2.4.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at movial.fi 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:52691 Archived-At: --=-u8AJ9e3mULj4LvDa1O/J Content-Type: text/plain Content-Transfer-Encoding: 7bit I've noticed that the GTK version leaves a one-pixel gap between the scroll bar and X window border. This happens independent of the scroll bar location (left/right). When embedding Emacs into another GTK application (using my XEmbed patches), it looks disconnected and ugly. I tracked down the code snippet that is probably responsible for making the crucial decision: xterm.c:XTset_vertical_scroll_bar() places the scroll bar at the center of the area reserved for it and in some situations leaves empty pixels around it. I made a patch that aligns the scroll bar to the left or right edge. I guess it is a matter of taste which way is best, or are there some situations where this causes harm? In my point of view this would be an improvement even when not embedding Emacs. Another approach would be to make the scroll bar's event box widget wider; it would fill the gap by drawing background colour on the right-hand side, but that would look ugly at least in the scroll-bar-on-left case. timo --=-u8AJ9e3mULj4LvDa1O/J Content-Disposition: attachment; filename=gtk-scrollbar-position.patch Content-Type: text/x-patch; name=gtk-scrollbar-position.patch; charset=us-ascii Content-Transfer-Encoding: 7bit Tue Apr 11 18:37:44 EEST 2006 Timo Savola * gtk-scrollbar-position diff -rN -u old-emacs/src/xterm.c new-emacs/src/xterm.c --- old-emacs/src/xterm.c 2006-04-11 19:57:30.000000000 +0300 +++ new-emacs/src/xterm.c 2006-04-11 18:35:35.000000000 +0300 @@ -4984,12 +4984,12 @@ if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) sb_left = (left + (WINDOW_RIGHTMOST_P (w) - ? width - sb_width - (width - sb_width) / 2 + ? width - sb_width : 0)); else sb_left = (left + (WINDOW_LEFTMOST_P (w) - ? (width - sb_width) / 2 + ? 0 : width - sb_width)); #else if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) --=-u8AJ9e3mULj4LvDa1O/J Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-u8AJ9e3mULj4LvDa1O/J--