From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: bug#1405: detached GTK+ tool bar Date: Sun, 01 Mar 2009 18:43:13 +0100 Message-ID: <878wnpkuku.fsf@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> 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 1235929481 24381 80.91.229.12 (1 Mar 2009 17:44:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Mar 2009 17:44:41 +0000 (UTC) Cc: Chong Yidong , Jan =?utf-8?Q?Dj=C3=A4rv?= , emacs-devel@gnu.org To: 1405@emacsbugs.donarmstrong.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 01 18:45:57 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ldpjh-0000ny-9H for ged-emacs-devel@m.gmane.org; Sun, 01 Mar 2009 18:45:57 +0100 Original-Received: from localhost ([127.0.0.1]:55218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdpiM-0004xM-AD for ged-emacs-devel@m.gmane.org; Sun, 01 Mar 2009 12:44:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdphB-0004Ql-EA for emacs-devel@gnu.org; Sun, 01 Mar 2009 12:43:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdphA-0004QN-KU for emacs-devel@gnu.org; Sun, 01 Mar 2009 12:43:20 -0500 Original-Received: from [199.232.76.173] (port=49597 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdphA-0004QG-GA for emacs-devel@gnu.org; Sun, 01 Mar 2009 12:43:20 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]:55845) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Ldph9-0004WG-SG for emacs-devel@gnu.org; Sun, 01 Mar 2009 12:43:20 -0500 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: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109387 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 ----