From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#49959: 28.0.50; Emacs got quasi freeze Date: Sun, 22 Aug 2021 18:54:11 +0200 Message-ID: References: <87r1f3vv5r.wl-m.nomiya@gmail.com> <8735r3idtj.wl-nomiya@galaxy.dti.ne.jp> <871r6ni8z5.wl-nomiya@galaxy.dti.ne.jp> <824dbfdc-e25a-5884-69a0-e5d4e9bc9d48@gmx.at> <1df6be5b-7041-d70f-1ae7-8e792b8147b5@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------061E0EDF75BBDFEF9355169E" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27456"; mail-complaints-to="usenet@ciao.gmane.io" To: m.nomiya@gmail.com, 49959@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 22 18:55:09 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 1mHqkX-0006t5-EQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 18:55:09 +0200 Original-Received: from localhost ([::1]:58764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHqkV-00048N-Sa for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 12:55:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHqkQ-00048F-Cl for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 12:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHqkQ-0004N4-3x for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 12:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHqkQ-0004bJ-21 for bug-gnu-emacs@gnu.org; Sun, 22 Aug 2021 12:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Aug 2021 16:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 49959-submit@debbugs.gnu.org id=B49959.162965126317629 (code B ref 49959); Sun, 22 Aug 2021 16:55:02 +0000 Original-Received: (at 49959) by debbugs.gnu.org; 22 Aug 2021 16:54:23 +0000 Original-Received: from localhost ([127.0.0.1]:39737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHqjm-0004aG-IH for submit@debbugs.gnu.org; Sun, 22 Aug 2021 12:54:22 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:59561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHqjj-0004a2-Uk for 49959@debbugs.gnu.org; Sun, 22 Aug 2021 12:54:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1629651253; bh=b+R2FmwgfPKB+VxzPhTN8JSiN64Scx+iCeXGTTE7juc=; h=X-UI-Sender-Class:Subject:From:To:References:Date:In-Reply-To; b=aXpCPo2r6afiMLyEMWFUwg6Y8jMwuN/oUMTqigghWcEYdZcfK3WpUFhwiFve5WzKO nPCkCsLZFcmbaQ6wiv1vq1pKy+RvNspVsextg6hSXJfUY7xadRcTblXelexPSkrR2p Wcbsoph8u1dUV0rQnzKexgfMyGNLNRQ+wwo3r2GY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([213.142.97.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MBDnC-1mBqiQ3p1y-00Ci8K; Sun, 22 Aug 2021 18:54:13 +0200 In-Reply-To: <1df6be5b-7041-d70f-1ae7-8e792b8147b5@gmx.at> Content-Language: en-US X-Provags-ID: V03:K1:dEIQ2AwVRxBV74fll4Y4Gv2hy4QXaIFr30+q3EFvNDc4drbckZf yerEEQbiWIp29Xb3islV0oPVtrUdCqOAJ1LjARLst74922tzXi8MaOb3kEBW08oCxTpYSvu jkiPfkME8hUWKFkDuNOsDo8oOUefElZr0WWc7Ah18WtnlXEIRPK2bL2NOgMh+2CQLRU2hhm uH+/8AfPpzfnWcGXIf74A== X-UI-Out-Filterresults: notjunk:1;V03:K0:rouNtn9WVa4=:fcsAU9mT5ETxTSplz9G2oj 8jeTbmtS7Y2JHHEFKMsVgtG5ME5rsbA5oVsX7s4tH3iM3C4lFDEB6c6pKh1R2tGl+XIAm72qB a2WSiPMDv7ZDOO++4kqPbsftiDqaj47gbQBycZHYFijRpJREvNh2I8+n8PBoitSn54xA93DCA DF/7Ox0QzgReqCceY/nl4eGAzzvG+isk02W8lcIzwDmi8CcY24Ph0LUOmeAx0y58QLUqbZIbU uOR+rHN/om4bhsGCxpwStZwIa+qZ9GdO1dmWFJ7D0oU+vlDo4wrRbGpCR9am5Vy+djcIhHUaV 1478Y/VdJ60tMX0iMjPAMhpgNo6g+UoVT+LVYazwk43RH0/KN0S6dH/gbi0t5u2gls+bYQRvN 1zJfbFU67JYcHexMUR8xrIcrxDSqX695qqxf5HMII+LkCsxBnbZmD2yja8qe97ykUxuK9dDyL TCmFsZ8kbaOJ8WsRMG8fZYkJNP7ijV+fewp8/AFydzamS7p7UcQHQkcL8LoFVKAU+S4A6gDOK gqhD9oCvL4o8IUF9EviexDSmdHHmOSkBV/QTJpaZxIV+fuTIAhq62CPnLp1Mcs3JJVYGDodUN ZcBOnM3DTA1+aHZ3ki1qQAEQ6/PyJ59LXHgqrG4w+nFqKXmU6MXR9HEpx6TxSnz1NvRiBfxhT UJJWvDDP3HoFZGE6yppZwmAbmleBz2FLlg5qIZNf+V8MLl2e94+bLOsyPedC/JN2dILmLlZwR i6kef/F4Q2yqcLIYlt3e5otCwwYALxB0/bI6MvdTujC4UDzK+PR4qCUhJrBeaigq9Tr+Oud7 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:212427 Archived-At: This is a multi-part message in MIME format. --------------061E0EDF75BBDFEF9355169E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > Maybe the problem can be summarized as follows: > > - Emacs is in a state where a frame is hidden but not iconified. > > - Emacs gets a PropertyNotify event but does not react because the frame > was in its understanding _not_ iconified before. Elightenment thinks > that Emacs should understand that the frame is visible now and react > properly. > > If that's the case, then Emacs had this problem ever since. Actually, > Emacs here waits for a MapNotify event to arrive but apparently this > does not happen with Elightenment. A preliminary patch based on the above remarks is attached. martin --------------061E0EDF75BBDFEF9355169E Content-Type: text/x-patch; name="deiconify.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="deiconify.diff" diff --git a/src/termhooks.h b/src/termhooks.h index 1d3cdc8fe8..479b8a1c29 100644 =2D-- a/src/termhooks.h +++ b/src/termhooks.h @@ -168,7 +168,8 @@ #define EMACS_TERMHOOKS_H Lisp-level event value. (Only the toolkit version uses these.) */ ICONIFY_EVENT, /* An X client iconified this window. */ - DEICONIFY_EVENT, /* An X client deiconified this window. */ + DEICONIFY_EVENT, /* An X client deiconified this window + or made it visible. */ MENU_BAR_ACTIVATE_EVENT, /* A button press in the menu bar (toolkit version only). */ DRAG_N_DROP_EVENT, /* A drag-n-drop event is generated when diff --git a/src/xterm.c b/src/xterm.c index 6c6a62adb2..a4958c39de 100644 =2D-- a/src/xterm.c +++ b/src/xterm.c @@ -8166,22 +8166,18 @@ handle_one_xevent (struct x_display_info *dpyinfo, f =3D x_top_window_to_frame (dpyinfo, event->xproperty.window); if (f && event->xproperty.atom =3D=3D dpyinfo->Xatom_net_wm_state) { + bool was_iconified =3D FRAME_ICONIFIED_P (f); bool not_hidden =3D x_handle_net_wm_state (f, &event->xproperty= ); - if (not_hidden && FRAME_ICONIFIED_P (f)) + if (not_hidden) { if (CONSP (frame_size_history)) frame_size_history_plain - (f, build_string ("PropertyNotify, not hidden & iconified")); + (f, build_string ("PropertyNotify, not hidden")); - /* Gnome shell does not iconify us when C-z is pressed. - It hides the frame. So if our state says we aren't - hidden anymore, treat it as deiconified. */ SET_FRAME_VISIBLE (f, 1); - SET_FRAME_ICONIFIED (f, false); - f->output_data.x->has_been_visible =3D true; - inev.ie.kind =3D DEICONIFY_EVENT; + #if defined USE_GTK && defined HAVE_GTK3 /* If GTK3 wants to impose some old size here (Bug#24526), tell it that the current size is what we want. */ @@ -8192,18 +8188,27 @@ handle_one_xevent (struct x_display_info *dpyinfo, f->was_invisible =3D false; } #endif - XSETFRAME (inev.ie.frame_or_window, f); + if (was_iconified) + { + SET_FRAME_ICONIFIED (f, false); + inev.ie.kind =3D DEICONIFY_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + } } - else if (!not_hidden && !FRAME_ICONIFIED_P (f)) + else { if (CONSP (frame_size_history)) frame_size_history_plain - (f, build_string ("PropertyNotify, hidden & not iconified")); + (f, build_string ("PropertyNotify, hidden")); SET_FRAME_VISIBLE (f, 0); - SET_FRAME_ICONIFIED (f, true); - inev.ie.kind =3D ICONIFY_EVENT; - XSETFRAME (inev.ie.frame_or_window, f); + + if (!was_iconified) + { + SET_FRAME_ICONIFIED (f, true); + inev.ie.kind =3D ICONIFY_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + } } } @@ -8402,7 +8407,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, f =3D x_top_window_to_frame (dpyinfo, event->xmap.window); if (f) { - bool iconified =3D FRAME_ICONIFIED_P (f); + bool was_iconified =3D FRAME_ICONIFIED_P (f); int value; bool sticky; bool not_hidden =3D x_get_current_wm_state (f, event->xmap.wind= ow, &value, &sticky); @@ -8410,7 +8415,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (CONSP (frame_size_history)) frame_size_history_extra (f, - iconified + was_iconified ? (not_hidden ? build_string ("MapNotify, not hidden & iconified") : build_string ("MapNotify, hidden & iconified")) @@ -8434,7 +8439,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif /* Not USE_GTK */ } - if (!iconified) + if (!was_iconified) { /* The `z-group' is reset every time a frame becomes invisible. Handle this here. */ @@ -8459,13 +8464,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #endif f->output_data.x->has_been_visible =3D true; - } - if (not_hidden && iconified) - { - inev.ie.kind =3D DEICONIFY_EVENT; - XSETFRAME (inev.ie.frame_or_window, f); - } + if (was_iconified) + { + inev.ie.kind =3D DEICONIFY_EVENT; + XSETFRAME (inev.ie.frame_or_window, f); + } + } } goto OTHER; --------------061E0EDF75BBDFEF9355169E--