all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#37359: [PATCH] Fix ignored Motif scrollbar resources.
@ 2019-09-09 18:27 Matt Bisson
  2019-09-10  7:56 ` martin rudalics
  0 siblings, 1 reply; 15+ messages in thread
From: Matt Bisson @ 2019-09-09 18:27 UTC (permalink / raw)
  To: 37359

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

Hi Emacs maintainers,

I noticed that I was only able to set the "truck" color for scrollbars on Motif.  I tried a variety of methods, including explicitly setting resources for the scrollbar class as documented by the libXm API, and using foreground and background faces, but to no avail.  After looking at the code in src/xterm.c, I noticed that the creation code was not quite correct, so I patched the code (attached):

On Motif scrollbars, "foreground" has no meaning, while "background" means the truck and arrow colors, and "trough" means the background of the entire widget.  I have hooked up the Emacs scrollbar "foreground" color to the XmNbackground resource, and the "background" color to XmNtroughColor.  This is more in line with how Xaw scrollbars behave.

I am still a little flummoxed as to why the more sweeping resource settings like "*XmScrollBar*troughColor" seem to have no effect, but that's an issue for another day, and I may look into it further as I have time.

My Emacs environment is 26.3 (but I noticed this code has been like this a long time) running on 64-bit Linux (Gentoo).  The Motif version is 2.3.8.

Thanks,
-Matt

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-ignored-Motif-scrollbar-resources.patch --]
[-- Type: text/x-patch; name=0001-Fix-ignored-Motif-scrollbar-resources.patch, Size: 1448 bytes --]

From 60cf87f9fc6104ae44c31125b2f5050cb31b9e4a Mon Sep 17 00:00:00 2001
From: Matt Bisson <mbisson@vmware.com>
Date: Mon, 9 Sep 2019 10:46:20 -0400
Subject: [PATCH] Fix ignored Motif scrollbar resources.

On Motif scrollbars, "foreground" has no meaning, while "background"
means the truck and arrow colors, and "trough" means the background of
the entire widget.  I have hooked up the Emacs scrollbar "foreground"
color to the XmNbackground resource, and the "background" color to
XmNtroughColor.  This is more in line with how Xaw scrollbars behave.
---
 src/xterm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 3cadf69380..70e45a964b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5925,17 +5925,19 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
   XtSetArg (av[ac], XmNincrement, 1); ++ac;
   XtSetArg (av[ac], XmNpageIncrement, 1); ++ac;
 
+  /* Note: "background" is the thumb color, and "trough" is the color behind
+     everything. */
   pixel = f->output_data.x->scroll_bar_foreground_pixel;
   if (pixel != -1)
     {
-      XtSetArg (av[ac], XmNforeground, pixel);
+      XtSetArg (av[ac], XmNbackground, pixel);
       ++ac;
     }
 
   pixel = f->output_data.x->scroll_bar_background_pixel;
   if (pixel != -1)
     {
-      XtSetArg (av[ac], XmNbackground, pixel);
+      XtSetArg (av[ac], XmNtroughColor, pixel);
       ++ac;
     }
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-10-07 13:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-09 18:27 bug#37359: [PATCH] Fix ignored Motif scrollbar resources Matt Bisson
2019-09-10  7:56 ` martin rudalics
2019-09-10 13:26   ` Matt Bisson
2019-09-10 20:25     ` martin rudalics
2019-09-10 20:35       ` Matt Bisson
2019-09-16 20:00         ` Glenn Morris
2019-09-16 20:14           ` Matt Bisson
2019-09-17  1:13             ` Glenn Morris
2019-09-17 15:41       ` Matt Bisson
2019-09-17 15:55         ` Eli Zaretskii
2019-09-18  7:46         ` martin rudalics
2019-09-19  8:16         ` martin rudalics
2019-10-07  4:54           ` Lars Ingebrigtsen
2019-10-07  9:26             ` martin rudalics
2019-10-07 13:27               ` Matt Bisson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.