From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6468: closed (Re: bug#6468: A couple of problem related to frame raising (partly w32)) Date: Thu, 6 Oct 2011 22:39:35 +0200 Message-ID: References: <8omxddhn8z.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1317933663 10168 80.91.229.12 (6 Oct 2011 20:41:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2011 20:41:03 +0000 (UTC) To: 6468@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 06 22:40:58 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RBukU-000367-99 for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 22:40:58 +0200 Original-Received: from localhost ([::1]:41356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBukT-0004KF-JT for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 16:40:57 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBukQ-0004KA-Ou for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 16:40:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBukP-0002Fd-CR for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 16:40:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBukP-0002FX-Am for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 16:40:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RBukZ-0006mp-43 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 16:41:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2011 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 6468-submit@debbugs.gnu.org id=B6468.131793363326049 (code B ref 6468); Thu, 06 Oct 2011 20:41:02 +0000 Original-Received: (at 6468) by debbugs.gnu.org; 6 Oct 2011 20:40:33 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBuk1-0006m3-65 for submit@debbugs.gnu.org; Thu, 06 Oct 2011 16:40:31 -0400 Original-Received: from mail-gy0-f172.google.com ([209.85.160.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBujk-0006lR-2r for 6468@debbugs.gnu.org; Thu, 06 Oct 2011 16:40:22 -0400 Original-Received: by gyd12 with SMTP id 12so2975048gyd.3 for <6468@debbugs.gnu.org>; Thu, 06 Oct 2011 13:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=wStPEGvQQpXdVBpTwjvy7/G1cy75fg6p0t0EZ2riJ/U=; b=SsfFq4LP44jYng5k+1a2/ADGavqrR3dRWKIkfWlrm+hnNhauldSyYUnY54dDQQZiqR w513vn2uRlBjX/5EL7sLnY8K4bLhnP9X4I45CIgUInbYgMedTr5NNtfVLrB5+qhOfAT1 9GMmIzxscheO4UtBclsAOh+ZRjnD6Fps5xMfY= Original-Received: by 10.223.62.15 with SMTP id v15mr5812215fah.22.1317933595337; Thu, 06 Oct 2011 13:39:55 -0700 (PDT) Original-Received: by 10.152.20.229 with HTTP; Thu, 6 Oct 2011 13:39:35 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 06 Oct 2011 16:41:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52312 Archived-At: I prefer to give up. If it is enough to call it rant then I have no one to eplain to. And I have no time to waste on such answers. On Thu, Oct 6, 2011 at 22:36, GNU bug Tracking System wrote: > Your bug report > > #6468: A couple of problem related to frame raising (partly w32) > > which was filed against the emacs package, has been closed. > > The explanation is attached below, along with your original report. > If you require more details, please reply to 6468@debbugs.gnu.org. > > -- > 6468: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6468 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems > > > ---------- Forwarded message ---------- > From:=C2=A0Glenn Morris > To:=C2=A06468-done@debbugs.gnu.org > Date:=C2=A0Thu, 06 Oct 2011 16:35:24 -0400 > Subject:=C2=A0Re: bug#6468: A couple of problem related to frame raising = (partly w32) > tags 6468 notabug > stop > > Eli Zaretskii wrote: > >> Would you please describe the problem(s) you are talking about? >> >> How about a reproducible recipe for them? > > This was never answered. > > This isn't a bug a report, just a rambling discussion that goes nowhere. > > If there is a problem, open a new, self-contained report that actually > gives details. > > > > ---------- Forwarded message ---------- > From:=C2=A0Lennart Borgman > To:=C2=A0Emacs Bugs > Date:=C2=A0Sat, 19 Jun 2010 20:23:29 +0200 > Subject:=C2=A0A couple of problem related to frame raising (partly w32) > After struggling with the getting raise-frame to workaround the > current problems with raise-frame I gave up. There are a couple of > problems so I am not sure where to begin. > > I think the basic problem is that there is no hook so you can be sure > when a call to raise-frame (and other frame functions) will work after > frame creation. Since part of the frame creation as I understand it is > done asynchronously be the OS/window manager I think this is a really > basic need to get Emacs to work. > > But I tried to do the raise-frame in a hook to and that does not work > either in all situations and I am not quite sure why. > > One problem is that the system API calls currently is not checked and > partly in bad order. Here is the relevant part from w32fns.c: > > =C2=A0 =C2=A0case WM_EMACS_SETFOREGROUND: > =C2=A0 =C2=A0 =C2=A0{ > =C2=A0 =C2=A0 =C2=A0 =C2=A0HWND foreground_window; > =C2=A0 =C2=A0 =C2=A0 =C2=A0DWORD foreground_thread, retval; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* On NT 5.0, and apparently Windows 98, it is= necessary to > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 attach to the thread that currently ha= s focus in order to > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pull the focus away from it. =C2=A0*/ > =C2=A0 =C2=A0 =C2=A0 =C2=A0foreground_window =3D GetForegroundWindow (); > =C2=A0 =C2=A0 =C2=A0 =C2=A0foreground_thread =3D GetWindowThreadProcessId= (foreground_window, NULL); > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!foreground_window > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| foreground_thread =3D=3D GetC= urrentThreadId () > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| !AttachThreadInput (GetCurren= tThreadId (), > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 foreground_thread, TRUE)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0foreground_thread =3D 0; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D SetForegroundWindow ((HWND) wParam)= ; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Detach from the previous foreground thread.= =C2=A0*/ > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (foreground_thread) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AttachThreadInput (GetCurrentThreadId (= ), > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 foreground_thread, FALSE); > > =C2=A0 =C2=A0 =C2=A0 =C2=A0return retval; > =C2=A0 =C2=A0 =C2=A0} > > The first call to GetWindowThreadProcessId should not be done if the > call to GetForegroundWindow does not succeed. > > If there had been error checking this problem should have been > detected long ago. I have suggested adding that but the answer so far > has not been positive. In my opinion this is a huge waste of time. (I > can surely add this to my patched version but in the current situation > where I unfortunately have to keep a lot of bug fixes in my code it > costs my just too much time.) > > Next problem is that if foreground_window is not 0 then the value of > foreground_thread will be erased if do not misunderstand the C > priorities. Can someone please confirm/disconfirm this? > > > >