From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: master fe7c015b20: Support XFCE in wallpaper.el Date: Tue, 27 Sep 2022 07:21:23 +0000 Message-ID: <87y1u51ddf.fsf@posteo.net> References: <166336105908.23797.12319380359602540227@vcs2.savannah.gnu.org> <20220916204419.B124FC00872@vcs2.savannah.gnu.org> <87edwavjyc.fsf@yahoo.com> <87wna1tr7z.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 27 10:25:34 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 1od5uI-0003rh-9c for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Sep 2022 10:25:34 +0200 Original-Received: from localhost ([::1]:49154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od5uH-0006Md-9A for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Sep 2022 04:25:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od556-0005hV-QP for emacs-devel@gnu.org; Tue, 27 Sep 2022 03:32:40 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:56281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od554-0001wE-HG for emacs-devel@gnu.org; Tue, 27 Sep 2022 03:32:40 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 95E69240106 for ; Tue, 27 Sep 2022 09:32:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1664263955; bh=FnremZ/nlQkFkKbsQ18p63XJ20GRCwQ+nuUKIITPFAc=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=YbXhQcyVjfK2MJuukxr5EiVc6UrKs+u03bPwUcsXb/mpXxHV1JhRNF4+3Z3b0RD8c 9sELv0wnAjGTnfkFF3RMAJ5WuqUEjCUg+jzEICufYjjfFbub8TGloSif1WbqPlV8UT Tnr4LnbpO/TYoSGQIh0/x9yVclAye/gu1L5RJTf+mlaOptuzRsOcMGnY6+seMKwD5e ktNt/ZjA6l9h2RBtpyaX5L/1TQgGEmOJh+VMegKEJSFpSyaoS8hAczf31tp7HU6hw0 2ybFetyZUZip6aMoqHRTNw/ePdD6m1c8+gl3UfzZB29airwJmS5dQRWRPgOZqaojTk 212x0qMuj/cIQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4McBD16lhXz6tr7; Tue, 27 Sep 2022 09:32:31 +0200 (CEST) In-reply-to: Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata= mQGNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA AbQSdGhpZXZvbEBwb3N0ZW8ubmV0iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQa OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=thievol@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:296326 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Stefan, Stefan Kangas writes: > Po Lu writes: > >> The screen number should be the following part of the `display' frame >> parameter: >> >> 1.1.1.1:0.5 >> ^ screen number is 5 >> >> if there is no period after the separator, then the screen number is 0. >> >> The currently active workspace can be obtained like so: >> >> (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) >> >> if it fails by returning NULL, then you should fall back to: >> >> (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t) >> >> and failing that, 0. >> >> The monitor name should also be easy to extract with >> display-monitor-attributes-list, but if the source is anything other >> than "XRandr", "XRandr 1.5" or "Gdk", you should fall back to using "0". > > Thanks, I've pushed a fix to master based on the above. I very much > appreciated the clear instructions above, which saved me a ton of time. > > I had to jump through extra hoops to get it to work also in the > situation that Thierry described, however. See commit b0289e7f6d and in > particular bb9df76dc9. > > I installed XFCE on my machine to test the change and it works for me. > If someone with XFCE could test that the change works for them, that > would be welcome. It is working fine on graphic display but on emacs -nw there is two problem= s: 1) The function wallpaper--format-arg is evaluating the format-specs each time it is called and when display-graphic-p returns nil, user is prompted for height and width at each call. Here the xfce args: ("-c" "xfce4-desktop" "-p" "/backdrop/screen%S/monitor%M/workspace%W/last-i= mage" "-s" "%f") We are prompted for height and width for each of these args. Here how you could fix this: diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index 36bc7e91a69..9ac0fd1dc91 100644 =2D-- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -374,8 +374,10 @@ See also `wallpaper-default-width'.") =20 (defun wallpaper--get-height-or-width (desc fun default) (cond ((display-graphic-p) (funcall fun)) =2D (noninteractive default) =2D ((read-number (format "Wallpaper %s in pixels: " desc) default))= )) + ;; (noninteractive default) + (t + (lambda () + (read-number (format "Wallpaper %s in pixels: " desc) default))= ))) =20 (autoload 'ffap-file-at-point "ffap") =20 @@ -444,7 +446,9 @@ This is the default function for `wallpaper-set-functio= n'." (let* ((args (if (functionp wallpaper-command-args) (funcall wallpaper-command-args) wallpaper-command-args)) =2D (real-args (mapcar (lambda (arg) (wallpaper--format-arg arg fil= e)) + (real-args (mapcar (lambda (arg) + (let ((val (wallpaper--format-arg arg file))) + (if (functionp val) (funcall val) val))) args)) (bufname (format " *wallpaper-%s*" (random))) (process 2) display-monitor-attributes-list doesn't return the value of monitor: (display-monitor-attributes-list) On graphic display it is ok: =3D> (((name . "eDP") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 309 174) (frames #) (source . "XRandr"))) But not on emacs -nw =3D> (((geometry 0 0 238 57) (workarea 0 0 238 57) (mm-size nil nil) (frame= s #))) As a result the wallpaper is never set on emacs -nw. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmMypw0THHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk2ADDACbc0MSU3WOiq1UnCQJwnITa8MTUS1z QhcvzVpYrIjeuk2Qddd86ltYwmPsrI5aXllgVxOhbdinzd7CwNy80bV6+Olrg0Q3 2HNbVoCnGBeCd6KRSCOW223MEc6+e4r2ZQUDPS6ZIg9VgbE3OLiCPypgT17+LdkL 0JQizl/TLtQfJikem1xExRUmC57WBfa4UF8ewDJmUIPL+gTyn+MQuIO5v8n72McC 4gY1yayf67R3sGpsZJtPmEHhiRNZAGpZdHw6yJYlLenjKPixxlJptXQp3oVnNADS Op4aVF8ZtBcrfhLi500oYz3QP7sxdyRRRPgAUYJg1aPT3baseUoXVT6w1e9PD48x UmLtyQna4/eS/jImByz/xnfh7CZfJu4JxapNekK81mninVbAEHxuo/3gvxBaDl0c G5Rob4NZnvvSLcqa/R63x3eP6cx8dE7mu3i/q2BEzxJe3e0bYtUSJjpYoVuF3XmY 3rie+H2oqY2yAhYhM+ikBfH9zg/bMt9GoEo= =D/ta -----END PGP SIGNATURE----- --=-=-=--