From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix rendering issues on window managers without _NET_WM_STATE Date: Sat, 15 May 2021 09:09:03 +0200 Message-ID: <87sg2omq28.fsf@omarpolo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16499"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Tom Gillespie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 15 09:09:53 2021 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 1lhoQr-00046c-DT for ged-emacs-devel@m.gmane-mx.org; Sat, 15 May 2021 09:09:53 +0200 Original-Received: from localhost ([::1]:53698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhoQp-0004xk-LP for ged-emacs-devel@m.gmane-mx.org; Sat, 15 May 2021 03:09:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhoQJ-0004Is-MT for emacs-devel@gnu.org; Sat, 15 May 2021 03:09:19 -0400 Original-Received: from mail.omarpolo.com ([144.91.116.244]:55732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhoQG-0003DX-JG for emacs-devel@gnu.org; Sat, 15 May 2021 03:09:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1621062550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mmj3LaH0AXNLv09xCrypsNGjGaQARyT0xws9+fExdhc=; b=luTHTGMBQ6zvJvVC/pymoaes9tX3WH1WDDUJbfhU+kK8/dZE7RwVVkW1CQe407IYy0GMkc nExvbfXUzMdlmiI5+UHIOymZmm4+G4d2hGmzQoCJnMlw6CmV2kWkYbUs4exhOq07KdrRDL csGSTvOm61sEn/20OprHG+9ZBOQy+uI= Original-Received: from localhost ( [87.13.101.227]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id e1044d6c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 15 May 2021 09:09:10 +0200 (CEST) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 04eaa49f; Sat, 15 May 2021 09:09:04 +0200 (CEST) In-reply-to: Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.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, 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.23 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:269299 Archived-At: Tom Gillespie writes: > Hi, > This patch fixes a bug that occurs when running Emacs in a window > manager that does not set _NET_WM_STATE. The patch is simplest fix > that restores expected behavior for window managers that do not set > _NET_WM_STATE, but I have no idea whether there are other issues that > may be occurring. > > I'm guessing that there are also likely issues with other logic in the > MapNotify case that uses not_hidden for window managers that does not > set _NET_WM_STATE. > > Thus, the more complex solution, which I am not knowledgeable enough > to implement correctly, is to fix x_get_current_wm_state so that it > works on window managers that do not set _NET_WM_STATE. > > I am unfamiliar with this section of the code, so my explanation may > be off and a sanity check would be appreciated. Best, > Tom > > > A description of the bug for the record. > > The bug manifests as frames rendering as solid background after > changing desktops on window managers that do not set _NET_WM_STATE. > > When changing desktops and returning to a desktop with Emacs frames, > any frame that is not focused will render the whole frame as only the > background color for the current theme. > > I have run a git bisect and found that the first bad commit is > 483c5e953c12a95382bef4a3b6769a680c32fe86 Fix two GTK3 event handling > issues. > > I think that the bug is occurring because 483c5e953c1 changed calls to > SET_FRAME_VISIBLE and friends from being unconditional to being > conditional on not_hidden, which returns incorrect information when > _NET_WM_STATE is not set (I think). > > I encountered the bug on fluxbox but the behavior should happen for > any window manager that does not set _NET_WM_STATE. I can confirm that the bug was present also with cwm and that your patch fixes it, thanks!! > It should be possible to reproduce the bug using the following steps. > Run a window manager that does not set _NET_WM_STATE, e.g. fluxbox. > In a terminal run the following and when the newly built Emacs > launches alt-tab to the terminal window, and then leave and return to > the desktop with the Emacs frame. > #+begin_src bash > pushd ~/git/emacs > git checkout 483c5e953c12a95382bef4a3b6769a680c32fe86 > git clean -dfx && ./autogen.sh && ./configure && make && \ > src/emacs -q > #+end_src