all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
@ 2020-10-06 19:40 Andrii Kolomoiets
  2020-10-06 20:37 ` Alan Third
  2020-10-07  7:03 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Andrii Kolomoiets @ 2020-10-06 19:40 UTC (permalink / raw)
  To: 43837

In 'emacs -Q':

1. M-: (setq test-frame (make-frame '((left . 50) (top . 50))))
2. C-x 5 o
3. M-: (set-face-background 'internal-border "blue" test-frame)
4. M-: (modify-frame-parameters test-frame '((background-color . "black")))

Now (face-background 'internal-border test-frame) returns nil.
If we skip step 2, then the internal border color remains.


In GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.6 (Build 19G2021))
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.6





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-06 19:40 bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color Andrii Kolomoiets
@ 2020-10-06 20:37 ` Alan Third
  2020-10-07  6:46   ` Andrii Kolomoiets
  2020-10-07  7:19   ` Eli Zaretskii
  2020-10-07  7:03 ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Alan Third @ 2020-10-06 20:37 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43837

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

On Tue, Oct 06, 2020 at 10:40:33PM +0300, Andrii Kolomoiets wrote:
> In 'emacs -Q':
> 
> 1. M-: (setq test-frame (make-frame '((left . 50) (top . 50))))
> 2. C-x 5 o
> 3. M-: (set-face-background 'internal-border "blue" test-frame)
> 4. M-: (modify-frame-parameters test-frame '((background-color . "black")))
> 
> Now (face-background 'internal-border test-frame) returns nil.
> If we skip step 2, then the internal border color remains.

This isn't an NS specific problem. Eli actually spotted the bug last
year and put in a FIXME.

I can't think of a good reason for the code to use the selected frame,
but perhaps I'm missing something.

Patch attached.
-- 
Alan Third

[-- Attachment #2: 0001-Prevent-mixing-of-faces-from-different-frames-bug-43.patch --]
[-- Type: text/plain, Size: 1294 bytes --]

From b5f0e5a1c508a950a13941e15fc4bd1c1a63bceb Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Tue, 6 Oct 2020 21:32:55 +0100
Subject: [PATCH] Prevent mixing of faces from different frames (bug#43837)

* lisp/frame.el (frame-set-background-mode): Use the face spec from
the frame that's the target of the function instead of the currently
selected frame.
---
 lisp/frame.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/frame.el b/lisp/frame.el
index 7751ae1303..26b23f8229 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1247,10 +1247,7 @@ frame-set-background-mode
                          (assq face (frame-face-alist))
                          (face-spec-match-p face
                                             (face-user-default-spec face)
-                                            ;; FIXME: why selected-frame and
-                                            ;; not the frame that is the
-                                            ;; argument to this function?
-                                            (selected-frame))))
+                                            frame)))
 		   (push face locally-modified-faces)))
 	    ;; Now change to the new frame parameters
 	    (modify-frame-parameters frame params)
-- 
2.26.1


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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-06 20:37 ` Alan Third
@ 2020-10-07  6:46   ` Andrii Kolomoiets
  2020-10-07  7:19   ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Andrii Kolomoiets @ 2020-10-07  6:46 UTC (permalink / raw)
  To: Alan Third; +Cc: 43837

Alan Third <alan@idiocy.org> writes:

> This isn't an NS specific problem. Eli actually spotted the bug last
> year and put in a FIXME.

Sorry, was too lazy to check on other OS :)

> I can't think of a good reason for the code to use the selected frame,
> but perhaps I'm missing something.
>
> Patch attached.

Looks great and works perfect!





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-06 19:40 bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color Andrii Kolomoiets
  2020-10-06 20:37 ` Alan Third
@ 2020-10-07  7:03 ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2020-10-07  7:03 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43837

> From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> Date: Tue, 06 Oct 2020 22:40:33 +0300
> 
> In 'emacs -Q':
> 
> 1. M-: (setq test-frame (make-frame '((left . 50) (top . 50))))
> 2. C-x 5 o
> 3. M-: (set-face-background 'internal-border "blue" test-frame)
> 4. M-: (modify-frame-parameters test-frame '((background-color . "black")))
> 
> Now (face-background 'internal-border test-frame) returns nil.
> If we skip step 2, then the internal border color remains.

I think I fixed this on the master branch now.

Thanks.





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-06 20:37 ` Alan Third
  2020-10-07  6:46   ` Andrii Kolomoiets
@ 2020-10-07  7:19   ` Eli Zaretskii
  2020-10-07  7:42     ` Andrii Kolomoiets
  2020-10-07  8:32     ` Alan Third
  1 sibling, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2020-10-07  7:19 UTC (permalink / raw)
  To: Alan Third; +Cc: 43837, andreyk.mad

> Date: Tue, 6 Oct 2020 21:37:15 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: 43837@debbugs.gnu.org
> 
> > 1. M-: (setq test-frame (make-frame '((left . 50) (top . 50))))
> > 2. C-x 5 o
> > 3. M-: (set-face-background 'internal-border "blue" test-frame)
> > 4. M-: (modify-frame-parameters test-frame '((background-color . "black")))
> > 
> > Now (face-background 'internal-border test-frame) returns nil.
> > If we skip step 2, then the internal border color remains.
> 
> This isn't an NS specific problem. Eli actually spotted the bug last
> year and put in a FIXME.

It was me?

> I can't think of a good reason for the code to use the selected frame,
> but perhaps I'm missing something.

Heh, I went through the rabbit hole and arrived at the same fix, now
installed on master.  Let's see what will it break, and then perhaps
we will understand why the old code used selected-frame there...

Thanks.





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  7:19   ` Eli Zaretskii
@ 2020-10-07  7:42     ` Andrii Kolomoiets
  2020-10-07  8:27       ` Eli Zaretskii
  2020-10-07  8:32     ` Alan Third
  1 sibling, 1 reply; 11+ messages in thread
From: Andrii Kolomoiets @ 2020-10-07  7:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Alan Third, 43837

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alan Third <alan@idiocy.org>
>> I can't think of a good reason for the code to use the selected frame,
>> but perhaps I'm missing something.
>
> Heh, I went through the rabbit hole and arrived at the same fix, now
> installed on master.  Let's see what will it break, and then perhaps
> we will understand why the old code used selected-frame there...

Well, with recent master:

1. M-: (custom-set-faces '(default ((t :foreground "white" :background "black"))))
2. C-x 5 2

And to fix the colors in the created frame:
M-: (frame-set-background-mode (selected-frame))





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  7:42     ` Andrii Kolomoiets
@ 2020-10-07  8:27       ` Eli Zaretskii
  2020-10-07  8:37         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2020-10-07  8:27 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: alan, 43837

> From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> Cc: Alan Third <alan@idiocy.org>,  43837@debbugs.gnu.org
> Date: Wed, 07 Oct 2020 10:42:13 +0300
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Heh, I went through the rabbit hole and arrived at the same fix, now
> > installed on master.  Let's see what will it break, and then perhaps
> > we will understand why the old code used selected-frame there...
> 
> Well, with recent master:
> 
> 1. M-: (custom-set-faces '(default ((t :foreground "white" :background "black"))))
> 2. C-x 5 2
> 
> And to fix the colors in the created frame:
> M-: (frame-set-background-mode (selected-frame))

So are you okay with reverting the fix and enduring the lesser problem
we had before?





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  7:19   ` Eli Zaretskii
  2020-10-07  7:42     ` Andrii Kolomoiets
@ 2020-10-07  8:32     ` Alan Third
  1 sibling, 0 replies; 11+ messages in thread
From: Alan Third @ 2020-10-07  8:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43837, andreyk.mad

On Wed, Oct 07, 2020 at 10:19:35AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 6 Oct 2020 21:37:15 +0100
> > From: Alan Third <alan@idiocy.org>
> > Cc: 43837@debbugs.gnu.org
> > 
> > This isn't an NS specific problem. Eli actually spotted the bug last
> > year and put in a FIXME.
> 
> It was me?

Yup! 6a1dcf594a8b6aa72820f04b529aa3454cf3fc61 :)

-- 
Alan Third





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  8:27       ` Eli Zaretskii
@ 2020-10-07  8:37         ` Eli Zaretskii
  2020-10-07  8:45           ` Andrii Kolomoiets
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2020-10-07  8:37 UTC (permalink / raw)
  To: andreyk.mad; +Cc: alan, 43837

> Date: Wed, 07 Oct 2020 11:27:25 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: alan@idiocy.org, 43837@debbugs.gnu.org
> 
> > From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> > Cc: Alan Third <alan@idiocy.org>,  43837@debbugs.gnu.org
> > Date: Wed, 07 Oct 2020 10:42:13 +0300
> > 
> > 1. M-: (custom-set-faces '(default ((t :foreground "white" :background "black"))))
> > 2. C-x 5 2
> > 
> > And to fix the colors in the created frame:
> > M-: (frame-set-background-mode (selected-frame))
> 
> So are you okay with reverting the fix and enduring the lesser problem
> we had before?

Never mind, I fixed this now, I think.





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  8:37         ` Eli Zaretskii
@ 2020-10-07  8:45           ` Andrii Kolomoiets
  2020-10-18 11:52             ` Stefan Kangas
  0 siblings, 1 reply; 11+ messages in thread
From: Andrii Kolomoiets @ 2020-10-07  8:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: alan, 43837

Eli Zaretskii <eliz@gnu.org> writes:

> Never mind, I fixed this now, I think.

Can confirm.

Thanks!





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

* bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color
  2020-10-07  8:45           ` Andrii Kolomoiets
@ 2020-10-18 11:52             ` Stefan Kangas
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Kangas @ 2020-10-18 11:52 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43837, alan

close 43837 28.1
thanks

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Never mind, I fixed this now, I think.
>
> Can confirm.

It seems like this was fixed, but the bug was never closed.  I'm
therefore closing this bug report.

If this conclusion is incorrect and this is still an issue, please reply
to this email (use "Reply to all" in your email client) and we can
reopen the bug report.





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

end of thread, other threads:[~2020-10-18 11:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-06 19:40 bug#43837: 28.0.50; [NS] Internal border of inactive frame loses color Andrii Kolomoiets
2020-10-06 20:37 ` Alan Third
2020-10-07  6:46   ` Andrii Kolomoiets
2020-10-07  7:19   ` Eli Zaretskii
2020-10-07  7:42     ` Andrii Kolomoiets
2020-10-07  8:27       ` Eli Zaretskii
2020-10-07  8:37         ` Eli Zaretskii
2020-10-07  8:45           ` Andrii Kolomoiets
2020-10-18 11:52             ` Stefan Kangas
2020-10-07  8:32     ` Alan Third
2020-10-07  7:03 ` Eli Zaretskii

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.