From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Rahul M. Juliato" Newsgroups: gmane.emacs.bugs Subject: bug#68766: 29.2; Windows dark/light mode changes does not reflect on Emacs Title bar/Scrollbar Date: Sat, 27 Jan 2024 23:08:45 -0300 Message-ID: <87il3enr9u.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25111"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 68766@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 28 03:10:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rTucj-0006Kn-3D for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jan 2024 03:10:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTucU-0007EG-Pb; Sat, 27 Jan 2024 21:10:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTucQ-0007Dm-NN for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 21:10:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTucN-00044b-GQ for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 21:09:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTucU-0004zJ-CT for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 21:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Rahul M. Juliato" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 02:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68766 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170640775019108 (code B ref -1); Sun, 28 Jan 2024 02:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jan 2024 02:09:10 +0000 Original-Received: from localhost ([127.0.0.1]:56207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTube-0004y8-5r for submit@debbugs.gnu.org; Sat, 27 Jan 2024 21:09:10 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:39248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTuba-0004xc-At for submit@debbugs.gnu.org; Sat, 27 Jan 2024 21:09:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTubN-00079m-8r for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 21:08:53 -0500 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTubL-0003yo-DN for bug-gnu-emacs@gnu.org; Sat, 27 Jan 2024 21:08:53 -0500 Original-Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-29026523507so1564828a91.0 for ; Sat, 27 Jan 2024 18:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706407729; x=1707012529; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=ioZlNdhVFFp1YR+umVhKPytfhVA3rNE8t9IrHnAlzrU=; b=XHiGOzvV2wd5U9M6KpadktyVvXfImpi6w4zFKHUzWRUle7OicNlycmCq7xa8j4t/Nk sd84aymrX6E5m5K3ZY01jrUSqx5JizJQnIDCs7NYmAuy3cLSt9QPEQK+cL+jjRdsHRGV 8BU8HqBsKPf6m/MUz1hM/9mWQmC3LNR3dVb6IdpK+hQqckDiZuVqR5zcx+Cd4qqQDJaY 8UAPQ+0mTzK6WxAynrzWbQNzfdWqYCKxSMIwIh9R0i8PvisjAt8Z5yqkjuWAt9WntnFp ElbDTTAfmBvMVLB8ZegIlnivR/i9AWyNOmJoxuLaPWyI0oi7ALdqFn6JwfNCEPykj8eh Gqsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706407729; x=1707012529; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ioZlNdhVFFp1YR+umVhKPytfhVA3rNE8t9IrHnAlzrU=; b=dcukWpljKpVQbraa4RmMR5jnIvcnIQeGVZxxC6gnAaFEpms/rpJTJFrj8FSBlI3anm 3Le2avab9+SsX81ijcdOtUO/yWZ+3/Q/r1+iXfSTUCcvcu1r8r0/EgzzoMzORnURRIL6 3pu3a5hjw24iYBKz6vHyReXfY5bwUeKKpovy4Bk8QRgdnPKk6sTtJxQDMaVSJA937kd0 /0CaxHsdWSKs8H/qHoC95hLpdhkKzJaHWMG0fZgsFhY+J5jVCk5KOuP5Q8xHowsh4BG1 sKvMoC7Qcru8lhwoL91zIvPhHZkY3iSy5NAlPcTm+hNKiUFH6V+9WM+ETX27O8VzqoUV bqCQ== X-Gm-Message-State: AOJu0Yz8oo+Qmrbxd5JZ/nqeNXNF1q4EMQAVU8wxt/LJzRVQUvYzSa2C 8CTh5OWB3vT2Hg/53SQ0FjkAqvlFnLbWhwvIa/+gTTgYVX7BrMFif9W1fm5RtNY= X-Google-Smtp-Source: AGHT+IEDurKL2c8tyKpItUXUAYwXWoRc9cIezwV0znho1MVCvnx2AjXsg+zJ8dkoM0Frpue/Zd0ZXg== X-Received: by 2002:a17:90b:46d3:b0:28b:95f0:b6fa with SMTP id jx19-20020a17090b46d300b0028b95f0b6famr1514070pjb.28.1706407729059; Sat, 27 Jan 2024 18:08:49 -0800 (PST) Original-Received: from debian ([2804:7f0:9181:5bbe:6d6b:5989:d41d:aad8]) by smtp.gmail.com with ESMTPSA id st12-20020a17090b1fcc00b0028ffc524086sm3544353pjb.24.2024.01.27.18.08.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 18:08:48 -0800 (PST) X-Google-Original-From: "Rahul M. Juliato" Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=rahuljuliato@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279045 Archived-At: Hello there! I'm the maintainer of ~auto-dark~ for Emacs. Which is an utility package aimed to change Emacs theme when the OS changes it's dark/light mode settings (more here: https://github.com/LionyxML/auto-dark-emacs). Currently I've been contacted by a Windows user that reported me a strange behaviour on Emacs 29 with Windows 10/11. In order to reproduce this behaviour: 1.) Download Emacs from the nearest mirror: https://mirror.us-midwest-1.nexcess.net/gnu/emacs/windows/emacs-29/emacs-29.1_2.zip Unzip it and run ~runemacs.exe~. 2.) Prepare a Powershell Script to Toggle between modes during test Create a file named ~ToggleDarkMode.ps1~ with the following content: #+BEGIN_SRC ps1 $k = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" $v = (Get-ItemProperty -Path $k).SystemUsesLightTheme -bxor 1 Set-ItemProperty -Path $k -Name "SystemUsesLightTheme" -Value $v Set-ItemProperty -Path $k -Name "AppsUseLightTheme" -Value $v #+END_SRC Open PowerShell as system administrator Cd into where you created ~ToggleDarkMode.ps1~ and execute it with: #+BEGIN_SRC shell powershell.exe -noprofile -executionpolicy bypass -file .\ToggleDarkMode.ps1 #+END_SRC Executing this will toggle your Windows looks between dark/light modes. 3.) As shown here in this pictures sequence ~https://imgur.com/a/zSSx2tk~ (If you guys have any Libre imgur alternative, please let me know!) 3.1) We open Emacs + calculator + notepad The only package I have installed is ~auto-dark-mode~, responsible for changing Emacs theme. As the testing Windows machine was on Dark Mode when Emacs opened, both title bar and scrollbar remains as "dark". 3.2) We now run the toggle script (2) again. All Windows apps be come "light", auto-dark changes the theme to a light one, but both the title bar and scrollbar remains "dark". 3.3) I now close Emacs and reopen it Auto-dark changes the theme to "light" and both the title bar and scrollbar becomes "light". 3.2) We now run the toggle script (2) again. All windows apps change to "dark", auto-dark puts Emacs theme to dark, but both title bar and scrollbar remains "light". And you might continue with this and the results is always the same. The problem: It seems Emacs only sets it's title bar and scrollbar colors during initialization, not during run time. I do not know if this is "by design" or "a bug", hence my bug-report. I'd also like to mention that ~auto-dark~ has a hook after changing to both light/dark modes that could be used to run some extra elisp code if needed. Is it possible to change the system title bar/scrollbar colors or "theme" from inside Emacs with Elisp? Could we write some Powershell script and call it from Emacs using ~auto-dark~ hooks? Thanks, Rahul M. Juliato