From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#11732: Follow-up to bug#11732 Date: Sat, 30 Jun 2018 10:06:57 +0200 Message-ID: <5B373A21.9050407@gmx.at> References: <87obohkxga.fsf@XAVIER-PC.i-did-not-set--mail-host-address--so-tickle-me> <83y3f0p6n7.fsf@gnu.org> <5B35F120.9040807@gmx.at> <83fu16nepn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1530345968 25138 195.159.176.226 (30 Jun 2018 08:06:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2018 08:06:08 +0000 (UTC) Cc: 11732@debbugs.gnu.org, mhatta@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 30 10:06:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZAtP-0006Ns-Jb for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 10:06:03 +0200 Original-Received: from localhost ([::1]:46040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZAvV-0006P0-3q for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 04:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZAvO-0006OF-0M for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 04:08:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZAvK-00084W-PQ for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 04:08:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZAvK-00084F-L0 for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 04:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZAvK-0007Ed-AP for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 04:08: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: Sat, 30 Jun 2018 08:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11732 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 11732-submit@debbugs.gnu.org id=B11732.153034602927746 (code B ref 11732); Sat, 30 Jun 2018 08:08:02 +0000 Original-Received: (at 11732) by debbugs.gnu.org; 30 Jun 2018 08:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:40309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZAuS-0007DS-Pr for submit@debbugs.gnu.org; Sat, 30 Jun 2018 04:07:08 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:53693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZAuQ-0007Cx-VP for 11732@debbugs.gnu.org; Sat, 30 Jun 2018 04:07:07 -0400 Original-Received: from [192.168.1.101] ([212.95.5.200]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MIdYi-1fbMlf32Cm-002JMI; Sat, 30 Jun 2018 10:06:59 +0200 In-Reply-To: <83fu16nepn.fsf@gnu.org> X-Provags-ID: V03:K1:V9lhfhPyGf6xcJMMl8d8G0m/VCTG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s.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147992 Archived-At: > Will do, just not today. > >> > + SetWindowPos (dialog, HWND_TOPMOST, 0, 0, 0, 0, >> > + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE >> > + | SWP_NOOWNERZORDER); >> > + SetWindowPos (FRAME_W32_WINDOW (SELECTED_FRAME ()), >> > + dialog, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); >> >> What was the more or less precise rationale for this unless it was >> pure experimenting (in particular the SWP_NOACTIVATE in the first >> call)? > > SWP_NOACTIVATE was just a copy-paste from similar calls elsewhere. > The rationale for the code was to tell windows to put the frame from > which the file-selection dialog popped behind the dialog. IMO these two calls are not entirely kosher - after all the dialog box is in the topmost group and the selected frame not. So some other application that interrupts the dialog might mess things up. Anyway, I would try moving the SWP_NOACTIVATE from the dialog to the selected frame call like SetWindowPos (dialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER); SetWindowPos (FRAME_W32_WINDOW (SELECTED_FRAME ()), dialog, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); Note that I can't test it because nothing is broken here in the first place. > If > w32_dialog_in_progress is meant to do that, I don't understand how it > does that; can you explain? All w32_dialog_in_progress does is moving frames from and to the topmost group. I don't like putting frames in the topmost group - but if one doesn't use child frames and wants a support frame on top of a normal frame, setting just the z-order is not enough: You run into an eternal loop where Emacs tries to put the support frame above the normal one and Windows immediately reverses that because I obviously want the normal frame to retain focus. > (Btw, as long as we are discussing this: the above-suspended value of > the z-group frame parameter appears to be completely undocumented.) Conceptually, users should never see it: It is set only during dialogs. But if you think it should be documented I'll do that. > Below. It's possible I've put the code in the wrong WM_* message, but > I'm really stabbing in the dark in these matters. > >> In w32_dialog_in_progress I tried to solve a relatively simple >> problem: When a frame is in the TOPMOST group and I start a dialog, >> that frame would obscure the dialog box. So I temporarily remove the >> frame from the TOPMOST group and move it back when the dialog ends. > > Can you show me some Lisp to try this situation? > > Here's the patch I used with the font-selection dialog: > + if (msg == WM_NOTIFY) > + { > + SetWindowPos (hdlg, HWND_NOTOPMOST, 0, 0, 0, 0, > + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE > + | SWP_NOOWNERZORDER); The HWND_NOTOPMOST doesn't look good - dialog boxes should be topmost. Could you try with static UINT_PTR CALLBACK font_dialog_callback (HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) { static HWND cf_hwnd; if (msg == WM_INITDIALOG) cf_hwnd = ((CHOOSEFONT *)lParam)->hwndOwner; if (msg == WM_NOTIFY) { SetWindowPos (hdlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER); SetWindowPos (cf_hwnd, hdlg, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } return 0; } It doesn't show any strange effects here, at least. martin