From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#42655: 27.1; iconify-frame on a Lucid build may stuck the frame Date: Mon, 10 Aug 2020 19:52:39 +0200 Message-ID: <87o8ni9ymw.fsf@gmail.com> References: <87lfiycihg.fsf@calancha-pc.dy.bbexcite.jp> <83lfiu9xes.fsf@gnu.org> <83h7ti9qmb.fsf@gnu.org> <83v9hx7x21.fsf@gnu.org> <874kpgj4z5.fsf@gmail.com> <83sgd08q2v.fsf@gnu.org> <871rkki44t.fsf@gmail.com> <83k0yb999n.fsf@gnu.org> <835z9v80iw.fsf@gnu.org> <87mu36wuch.fsf@gmail.com> <83wo2a7jb1.fsf@gnu.org> <87r1siees8.fsf@gmail.com> <83pn827awm.fsf@gnu.org> <87y2mpmk16.fsf@gmail.com> <83a6z36glb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: eggert@cs.ucla.edu, monnier@iro.umontreal.ca, 42655@debbugs.gnu.org, uyennhi.qm@gmail.com, bhavin7392@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 10 20:17:12 2020 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 1k5CMC-0009zD-7H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 20:17:12 +0200 Original-Received: from localhost ([::1]:43322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5CMB-00030T-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 14:17:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5Byo-0001Da-V8 for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 13:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5Byo-00088d-Jd for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 13:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5Byo-0004C3-Eu for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 13:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Aug 2020 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42655 X-GNU-PR-Package: emacs Original-Received: via spool by 42655-submit@debbugs.gnu.org id=B42655.159708196916095 (code B ref 42655); Mon, 10 Aug 2020 17:53:02 +0000 Original-Received: (at 42655) by debbugs.gnu.org; 10 Aug 2020 17:52:49 +0000 Original-Received: from localhost ([127.0.0.1]:37467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5Byb-0004BX-D1 for submit@debbugs.gnu.org; Mon, 10 Aug 2020 13:52:49 -0400 Original-Received: from mail-ej1-f68.google.com ([209.85.218.68]:45544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5ByZ-0004BJ-C0 for 42655@debbugs.gnu.org; Mon, 10 Aug 2020 13:52:48 -0400 Original-Received: by mail-ej1-f68.google.com with SMTP id c16so10256344ejx.12 for <42655@debbugs.gnu.org>; Mon, 10 Aug 2020 10:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=c94BBymh5GDOL2kMj7IjHxWo5AVGBI32aSMC80EvRFk=; b=lVZVJ2Jo2y5HhXOq0i1H9fSKKnJCIkkRUn1b2JrHS2r1bG71CEIoQMqQ35eK70eLH5 UmrsRgkH6J5tikgFa1OSaTxP9OFQ53c+DHdgXifBJxVpTHLh+ktB07WfkHNMcs1Ie43d ZW3OGKg+NXSGD2w3OetY4QQ1xlNj/p8M+9+Z8/+4OEAvE2urq1mAgU7wgU/6XTnp3gQT 5biQIHIviL6tsc0IwuRl5abaQFlCCI2X/Xrargn9EiDJciUmE1qxFY9mffmGOY2nh+7J x78y5O0GgwnNn6RYjpbigTVgNdmk02FDVQ5fffwBqOQhPeK9jvRgyGUTvQmfo6aFtR1O QaSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=c94BBymh5GDOL2kMj7IjHxWo5AVGBI32aSMC80EvRFk=; b=pgNzcRMMDuMga9OjvlNKCcwnIwB6a4yr8kx7qkucf9b5z1yc3zHg+d2wWIPXeC3l4y o0Fk2RgSZmT8y4kd7g+5bv9LoFZ4Iondx+UHy2MT2ZTPr/rk6H5j5zNj5nWT7+RxRzRT 0QyBsaN7cb5vgCYh3bc+Bxk8mMXCyP9Z/q/dhISZvpUJKn9fJKfS279deQfkFVvU0OXy 33TGiujGAI8Mr3d/XylR3qPFtEP/4lY3GeJPbRBd5opqNayAUxIbl4frUdDemkBCS3BJ NksqfOV3swkdrwCNFeYNpmjHCMQVrfyKspz5FDYeNyEl0ua/A5fS+VVVsLd/WgUSybP0 xQHQ== X-Gm-Message-State: AOAM531LW0dBRGyjNjg/dd61p+bVVGkUMJO2178Kg2e07IEfH7VpZebh hRA6WmKKEWAr++tTjPpUCuk= X-Google-Smtp-Source: ABdhPJx0YCbqzXfQ+mFywgb3nJcHjMoDp8PRbvRB13xFHMhkmvJMAtGDm+RMVcO+QSiVEtNeWLcoRA== X-Received: by 2002:a17:906:3b18:: with SMTP id g24mr22220527ejf.508.1597081961275; Mon, 10 Aug 2020 10:52:41 -0700 (PDT) Original-Received: from localhost.example.com ([31.7.242.222]) by smtp.gmail.com with ESMTPSA id o2sm4111690ejr.19.2020.08.10.10.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2020 10:52:40 -0700 (PDT) In-Reply-To: <83a6z36glb.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Aug 2020 17:26:08 +0300") 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:184568 Archived-At: Eli Zaretskii writes: CC Daniel whom might have some ideas. A bit of context. Some WMs (e.g. Mutter in Gnome Shell or Muffin) follow a new trend: they don't unmap windows when they are iconified. https://gitlab.gnome.org/GNOME/mutter/-/issues/185 Since they are never unmapped, the windows are not mapped back when they are deconified. This might cause an unresponsive frame in Lucid Emacs builds, because we redisplay when we get the MapNotify signal (that we don't receive in those WMs). Apparentely, GTK3 Emacs builds are not affected by this issue. > I see in xterm.c that we already have some special treatment of the > Gnome Shell, see below. Could you please put a breakpoint there, and > tell why we don't set the frame's visible flag and don't reset its > iconified flag when the PropertyNotify event is received? Your event > log seems to indicate we get quite a few of PropertyNotify events when > the frame is de-iconified. That break point is only reached while creating the frame or clicking the menu bars. Once the frame is created, I am not able to reach that part by minimize/unminimize. I have printed out `event->type` right before the switch(event->type) I enter the break point at PropertyNotify when `event->type` equals 28. The xev utility is printing out PropertyNotify for a bunch of different values of `event->type`, not just for 28. Naively, I can workaround this issue by checking for an iconified frame at FocusIn: this fixes this issue in both `emacs -Q` and my custom Emacs session. I am not sure if this is a convenient way. We might also want to make it more specific for checking some condition. --8<-----------------------------cut here---------------start------------->8--- commit d9b06705a045336e1ef307cdfd523a1d5cbb9e7a Author: Tino Calancha Date: Mon Aug 10 19:32:17 2020 +0200 Fix bug 42655 Some WMs (e.g. mutter in Gnome Shell) don't unmap iconized windows, thus we won't get a MapNotify when deconifying them. Check if we are deconifying a window elsewhere. - src/xterm.c (handle_one_xevent): Check for window deconify when receiving a FocusIn signal. diff --git a/src/xterm.c b/src/xterm.c index 6340700cb8..de1da2d4d4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8760,6 +8760,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto OTHER; case FocusIn: + /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap minimized/iconified windows; + thus, for those WMs we won't get a MapNotify when unminimizing/deconifying. + Check here if we are deconizing a window (Bug42655). */ + f = any; + if (f && FRAME_ICONIFIED_P (f)) + { + SET_FRAME_VISIBLE (f, 1); + SET_FRAME_ICONIFIED (f, false); + f->output_data.x->has_been_visible = true; + inev.ie.kind = DEICONIFY_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + } + x_detect_focus_change (dpyinfo, any, event, &inev.ie); goto OTHER; --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.21, cairo version 1.16.0) of 2020-08-09 built on localhost.example.com Repository revision: dcce2b57bb91d490787dffd437b61196f1029b41 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: openSUSE Tumbleweed