From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 5743b74d4b 1/2: Improve mouse dragging Date: Thu, 12 May 2022 10:31:54 +0300 Message-ID: <83sfpfp5p1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29363"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 12 09:35:54 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1np3MX-0007Rr-K8 for ged-emacs-devel@m.gmane-mx.org; Thu, 12 May 2022 09:35:53 +0200 Original-Received: from localhost ([::1]:49618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1np3MW-0007vo-7b for ged-emacs-devel@m.gmane-mx.org; Thu, 12 May 2022 03:35:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np3Ii-0005YB-A7 for emacs-devel@gnu.org; Thu, 12 May 2022 03:32:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np3Ii-0005Fk-0n; Thu, 12 May 2022 03:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=Q2N52uqGEfdlIAvFU5TAR5SlGUzfJTn+WK7dPzflDBA=; b=oMW+MniBv4BahB ip68hN5gje+oo9da8KdibAr6WaHVl4XkBKJKRPAz2jGvSFAUsTuWxbg1l6PNifFm+HiC2pzYyApHI HKMLEWdbbcrMVur2bgJ4cDcDwTbKR/EDnub1AsT7L27o1AY47DKa93WcTmVAfLZIpcsC3lIAsnr5w mBwCcxTT0sUP0rCCJUuGmzspMz6QW60TEmS3ifWxsp9rSjdnn3OCGRLjqpdBU66cjJ21x60/2KmFB Z72FmU5YofSRypihr2AbxOYyv2BKzK6STKNYlc38Y9LZcuy4QWdsPZDj7tX2BFiOpzLRrO9hNUtzC FnZgZvlaH1zSpdiN6Qzg==; Original-Received: from [87.69.77.57] (port=4224 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np3Ic-0004Pn-Ip; Thu, 12 May 2022 03:31:53 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289667 Archived-At: > branch: master > commit 5743b74d4b2e06ace233d6b170f193a72633f218 > Author: Po Lu > Commit: Po Lu > > Improve mouse dragging > > * lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip): > Respect foreground and background parameters. > (mouse-drag-and-drop-region): Enable fine grained tracking. > --- > lisp/mouse.el | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/lisp/mouse.el b/lisp/mouse.el > index 0446bc6dd8..4b5f6ed223 100644 > --- a/lisp/mouse.el > +++ b/lisp/mouse.el > @@ -3017,7 +3017,15 @@ highlight the original region when > "Display TOOLTIP, a tooltip string, using `x-show-tip'. > Call `tooltip-show-help-non-mode' instead on non-graphical displays." > (if (display-graphic-p) > - (x-show-tip tooltip) > + (let ((params (copy-sequence tooltip-frame-parameters)) > + (fg (face-attribute 'tooltip :foreground)) > + (bg (face-attribute 'tooltip :background))) > + (when (stringp fg) > + (setf (alist-get 'foreground-color params) fg) > + (setf (alist-get 'border-color params) fg)) > + (when (stringp bg) > + (setf (alist-get 'background-color params) bg)) > + (x-show-tip tooltip nil params)) > (tooltip-show-help-non-mode tooltip))) Maybe I'm missing something here, but this seems to force the faces of the tooltip frames to follow the attributes of faces of the frame that is the selected frame when the tooltip is shown. Since faces are per-frame, why is this a good idea, and what problems does the above change attempt to solve? (And why do we force the border color to be the same as the tooltip-frame's foreground color?)