From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#1405: detached GTK+ tool bar Date: Sun, 01 Mar 2009 18:43:13 +0100 Message-ID: <878wnpkuku.fsf__24287.3598159806$1235930775$gmane$org@escher.local.home> References: <87hc5zcug7.fsf@cyd.mit.edu> <492937F5.1040301__9972.48901189796$1227438707$gmane$org@swipnet.se> <87ej12m1ar.fsf@escher.local.home> <494A9B6E.6060307__43219.0094412819$1229627215$gmane$org@swipnet.se> <87tz91ky8s.fsf__3258.61482783711$1229634381$gmane$org@escher.local.home> <87d4el4r59.fsf__38436.7469735027$1232225105$gmane$org@escher.local.home> Reply-To: Stephen Berman , 1405@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1235930692 28112 80.91.229.12 (1 Mar 2009 18:04:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Mar 2009 18:04:52 +0000 (UTC) Cc: Chong Yidong , Jan =?UTF-8?Q?Dj=C3=A4rv?= , emacs-devel@gnu.org To: 1405@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 01 19:06:08 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ldq2R-0006dp-3K for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Mar 2009 19:05:39 +0100 Original-Received: from localhost ([127.0.0.1]:49184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ldq16-0006PN-46 for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Mar 2009 13:03:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ldq0t-0006DM-3P for bug-gnu-emacs@gnu.org; Sun, 01 Mar 2009 13:03:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ldq0r-0006Ag-UL for bug-gnu-emacs@gnu.org; Sun, 01 Mar 2009 13:03:42 -0500 Original-Received: from [199.232.76.173] (port=34233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ldq0r-0006AO-FC for bug-gnu-emacs@gnu.org; Sun, 01 Mar 2009 13:03:41 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43995) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ldq0q-0007aO-Q5 for bug-gnu-emacs@gnu.org; Sun, 01 Mar 2009 13:03:41 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n21I3cfH025139; Sun, 1 Mar 2009 10:03:38 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n21Ho3b1021597; Sun, 1 Mar 2009 09:50:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stephen Berman Original-Sender: steve@escher.local.home Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 01 Mar 2009 17:50:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1405 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1405-submit@emacsbugs.donarmstrong.com id=B1405.123592941220305 (code B ref 1405); Sun, 01 Mar 2009 17:50:03 +0000 Original-Received: (at 1405) by emacsbugs.donarmstrong.com; 1 Mar 2009 17:43:32 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n21HhR1C020299 for <1405@emacsbugs.donarmstrong.com>; Sun, 1 Mar 2009 09:43:29 -0800 Original-Received: (qmail invoked by alias); 01 Mar 2009 17:43:16 -0000 Original-Received: from i59F54629.versanet.de (EHLO escher.local.home) [89.245.70.41] by mail.gmx.net (mp047) with SMTP; 01 Mar 2009 18:43:16 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/qZtsTo5nqZqVpm/gTdQAng+1eS8L0f31hvonAiZ 9Xcx319HUW2qmT Original-Received: by escher.local.home (Postfix, from userid 1000) id 1C9FD1D108C; Sun, 1 Mar 2009 18:43:13 +0100 (CET) In-Reply-To: <87d4el4r59.fsf__38436.7469735027$1232225105$gmane$org@escher.local.home> (Stephen Berman's message of "Sat, 17 Jan 2009 21:24:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.49 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 01 Mar 2009 13:03:41 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25881 Archived-At: On Sat, 17 Jan 2009 21:24:50 +0100 Stephen Berman = wrote: > On Thu, 18 Dec 2008 21:46:27 +0100 Stephen Berman wrote: > >> On Thu, 18 Dec 2008 19:50:22 +0100 Jan Dj=C3=A4rv w= rote: >> >>> Stephen Berman skrev: >>>> On Sun, 23 Nov 2008 12:01:09 +0100 Jan Dj=C3=A4rv = wrote: >>>>> >>>>> I'd rather see if the focus can be kept to the frame. We can perhaps= put some >>>>> hints to the window manager. I'll look in to it. Can the OP please = tell us >>>>> what window manager he is using and what kind of focus model he has (= click to >>>>> focus, focus follows mouse)? >>>>=20 >>>> I'm using KDE/kwin and click to focus. But I also see the same behavi= or >>>> (i.e. focus not returning to the window/frame the tool bar was detached >>>> from) with a focus follows mouse policy. >>>>=20 >>> >>> I've made a change, can you test it? >>> >>> Thanks, >>> >>> Jan D. >> >> I just did, and confirm that focus now switches back to the frame after >> clicking a button on the detached tool bar. Thanks!=20=20 > > I just learned about the variable x-gtk-whole-detached-tool-bar; when > this is non-nil and the tool bar is detached, focus fails to switch back > to the frame after clicking a button on the detached tool bar. So your > fix does not work with x-gtk-whole-detached-tool-bar non-nil. > > In GNU Emacs 23.0.60.29 (i686-pc-linux-gnu, GTK+ Version 2.14.4) of > 2009-01-11 on escher=20 > > Steve Berman The patch below (against the current CVS trunk) makes focus return to the frame regardless of the value of x-gtk-whole-detached-tool-bar (i.e., it works both with the proxy (arrow) and the whole detached tool bar). Jan D. or somebody else who's familiar with GTK+ should check to make sure it does not cause any problems elsewhere. Steve Berman 2009-03-01 Stephen Berman * gtkutil.c (xg_tool_bar_callback): Return focus to the frame after we have clicked on a detached tool bar button (bug#1405). This replaces the reverted change below. (xg_tool_bar_proxy_callback): Revert previous change (bug#1405). =09 *** emacs/src/gtkutil.c.~1.146.~ 2009-03-01 17:06:07.000000000 +0100 --- emacs/src/gtkutil.c 2009-03-01 17:41:39.000000000 +0100 *************** *** 3461,3466 **** --- 3461,3470 ---- this is written. */ event.modifiers =3D x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), m= od); kbd_buffer_store_event (&event); +=20 + /* Return focus to the frame after we have clicked on a detached + tool bar button. */ + Fx_focus_frame (frame); } =20=20 /* Callback function invoked when a tool bar item is pressed in a detached *************** *** 3480,3490 **** xg_tool_bar_callback (wbutton, client_data); FRAME_PTR f =3D (FRAME_PTR) g_object_get_data (G_OBJECT (wbutton), XG_FRAME_DATA); - /* Put focus back to the frame after we have clicked on a detached - tool bar button. */ - Lisp_Object frame; - XSETFRAME (frame, f); - Fx_focus_frame (frame); } =20=20 /* This callback is called when a tool item should create a proxy item, --- 3484,3489 ----