From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Platon Pronko Newsgroups: gmane.emacs.bugs Subject: bug#48413: 28.0.50; emacs does not repaint the window after switching workspaces in Xmonad Date: Fri, 14 May 2021 11:32:09 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="650"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 To: 48413@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 10:33:13 2021 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 1lhTFx-00006e-4H for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 10:33:13 +0200 Original-Received: from localhost ([::1]:59492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhTFw-0007xy-7r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 04:33:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhTFm-0007sM-M5 for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhTFm-00056C-Dw for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhTFm-0002r3-9n for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Platon Pronko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 08:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48413 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.162098113910922 (code B ref -1); Fri, 14 May 2021 08:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2021 08:32:19 +0000 Original-Received: from localhost ([127.0.0.1]:44956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhTF4-0002q6-SB for submit@debbugs.gnu.org; Fri, 14 May 2021 04:32:19 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhTF2-0002py-VX for submit@debbugs.gnu.org; Fri, 14 May 2021 04:32:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhTF2-0007Gz-PX for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:32:16 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:44680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhTF0-0004bG-Kv for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:32:16 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id t11so41977472lfl.11 for ; Fri, 14 May 2021 01:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=IqMLiXXNEvoTSwews7vaR8o8KMeuJEmcEYxu0fitVyc=; b=UI9lXLIGTdemZmcm1qTGOB7lT2cFFVcC441YFEy9fvfCM0rCDXIsCgJHVJzbxDZiCB 2s2Q266HwdFNHjcJXl2DKfIlgFjEE14hFbUw04m5LEvlhIlwk1wyl4fW0edYISmAdzji TZEvFwRY6jphLKLK7RPsQPt4heCyC4AOD6Gyvv+QE6+CVhJvFOpszDkoFgQjKynP3Yvm A1aDd5ViiqhGnP1/jTCh2iaHi9Wr5aaDn6m8CjjKRbsnBM4OiggVF2iKy0T1ZvMun2Cn MvIKIRvnyihtOZOQ1220F+X4CaRIqM9F+vHDRN7HaypfsP5/s8qrYqS5EaX3hwXNzE6W DIfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=IqMLiXXNEvoTSwews7vaR8o8KMeuJEmcEYxu0fitVyc=; b=HH9MldpaZJgIeK+umsdGIGT0Gs5h2SC9eJJvAInUZADSye46MaDEbGSJ8H1VnywG2b 5wg2aMT1diL2ZF2tlfIZ3TQajhIZOz7wxWnFAi46OpHtMaqSztwh+vF+qWZ5i13qCcRI m6Col6zC4Rwmt8Zn72Qe6cYZForhYuK+iuCVMimeAixaIJljZmUE00Fh7GCoOePT8ShX hlghQ5Bw0nB2NHkTXPGCeyJuXrslbFQ9+YXbxyhGebbCQrb/aLp5Pm55mkV5ZBOuNBSP LKzcYS4+zPGWC4gkMi8tTY6d/l5l9C5Ylg16hAR0cG7BV1TInBjIAa161bp5p03EdhGS dZMw== X-Gm-Message-State: AOAM531hgDd99S9ixIhuHX+CNhdI4hmqbYu8bWMLfEZ85ilfz4N9AwyB ffL5YSNhZBxWeSknZaaK2aY= X-Google-Smtp-Source: ABdhPJwRWv375d9DrnuJA4wveYQp6gcuSLyXjYh+OveVpdpUZf4vpx1mgY5qTZaBNmL9wcNFnpfEoQ== X-Received: by 2002:ac2:5497:: with SMTP id t23mr31502198lfk.52.1620981131544; Fri, 14 May 2021 01:32:11 -0700 (PDT) Original-Received: from [192.168.1.70] (109-252-80-247.nat.spd-mgts.ru. [109.252.80.247]) by smtp.gmail.com with ESMTPSA id b35sm543603lfv.82.2021.05.14.01.32.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 May 2021 01:32:10 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=platon7pronko@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" Xref: news.gmane.io gmane.emacs.bugs:206499 Archived-At: This looks like Xmonad-specific regression after commit 483c5e95 by Martin Rudalics. Steps to reproduce (under Xmonad): 1. Open a new frame (./src/emacs -Q); 2. Type something in a buffer; 3. Switch to a different workspace; 4. Switch back; 5. Observe buffer being blank and not responding to any interaction. I bisected this problem to commit 483c5e95 (from 2021-05-05). The trouble seems to be caused by this change in xterm.c: @@ -8232,33 +8238,36 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!FRAME_VISIBLE_P (f)) { block_input (); - SET_FRAME_VISIBLE (f, 1); - SET_FRAME_ICONIFIED (f, false); - if (FRAME_X_DOUBLE_BUFFERED_P (f)) + /* The following two are commented out to avoid that a + plain invisible frame gets reported as iconified. That + problem occurred first for Emacs 26 and is described in + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. */ +/** SET_FRAME_VISIBLE (f, 1); **/ +/** SET_FRAME_ICONIFIED (f, false); **/ + + if (FRAME_X_DOUBLE_BUFFERED_P (f)) font_drop_xrender_surfaces (f); f->output_data.x->has_been_visible = true; SET_FRAME_GARBAGED (f); Specifically the commenting of SET_FRAME_VISIBLE(f, 1) causes the problem (if I uncomment that line, buffer redisplay starts to work correctly). Trying the same with XFCE doesn't give the error. I compared the sequences of X events received under different WMs, here's the lists (without "other", "MotionNotify" and key events, for brevity): Xmonad: 1. When switching to different workspace: - FocusOut x3 - UnmapNotify x1 - LeaveNotify x2 - PropertyNotify x2 2. When switching back: - MapNotify x1 - VisibilityNotify x3 - Expose x4 - EnterNotify x2 - FocusIn x2 - ClientMessage x1 - PropertyNotify x1 - FocusIn x1 XFCE: 1. When switching to different workspace: - FocusOut x2 - FocusIn x1 - FocusOut x2 - LeaveNotify x2 - UnmapNotify x1 - PropertyNotify x3 2. When switching back: - VisibilityNotify x3 - Expose x4 - EnterNotify x2 - PropertyNotify x2 - FocusIn x2 - ClientMessage x1 - PropertyNotify x2 - FocusOut x2 - FocusIn x1 - FocusOut x2 - FocusIn x2 Further inspection of SET_FRAME_VISIBLE calls shows that under Xmonad first the frame is set to invisible when UnmapNotify event happens, then after switching back the only time when it could have been set to "visible" was in second "Expose" event (but this line is commented out in commit 483c5e95, so frame thinks it's invisible and thus no redraw happens). Under XFCE sequence is a bit less clear - frame is set to invisible after UnmapNotify event, but then it is set back to visible after second PropertyNotify event (comment near says "Gnome shell does not iconify us when C-z is pressed."). So Emacs thinks that the frame is visible even though it is on different workspace entirely. In GNU Emacs 28.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-05-14 built on the-big-maker Repository revision: 203ee33980571823147122dffb0789f92ea66b53 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Arch Linux Configured using: 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --with-x-toolkit=gtk3 --without-xaw3d' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_TIME: en_SE.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-mode cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 53379 13368) (symbols 48 6717 0) (strings 32 18827 2036) (string-bytes 1 618130) (vectors 16 13388) (vector-slots 8 176246 11054) (floats 8 22 47) (intervals 56 411 4) (buffers 992 12))