From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: embedding gtk widgets in a buffer Date: Sun, 11 May 2008 14:48:55 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210510411 26454 80.91.229.12 (11 May 2008 12:53:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2008 12:53:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 11 14:54:08 2008 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 1JvB41-00011M-KA for ged-emacs-devel@m.gmane.org; Sun, 11 May 2008 14:54:05 +0200 Original-Received: from localhost ([127.0.0.1]:55297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvB3I-0006He-Jj for ged-emacs-devel@m.gmane.org; Sun, 11 May 2008 08:53:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvB3E-0006HV-Oo for emacs-devel@gnu.org; Sun, 11 May 2008 08:53:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvB3C-0006H3-Tq for emacs-devel@gnu.org; Sun, 11 May 2008 08:53:16 -0400 Original-Received: from [199.232.76.173] (port=40639 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvB3C-0006H0-PS for emacs-devel@gnu.org; Sun, 11 May 2008 08:53:14 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:54326 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JvB37-0004G0-Hs; Sun, 11 May 2008 08:53:10 -0400 Original-Received: from chopper (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id m4BCr4bn003408; Sun, 11 May 2008 14:53:04 +0200 In-Reply-To: (joakim@verona.se's message of "Sun, 11 May 2008 10:25:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:96968 Archived-At: joakim@verona.se writes: > Richard M Stallman writes: >> Many programs would need to get keyboard focus. >> The xembed should set up a keymap with a command >> to give the focus to that program. >> >> That command could be RET and/or C-c C-c. Apparently this line in xterm.c steals kbd input: /* Don't pass keys to GTK. A Tab will shift focus to the tool bar in GTK 2.4. Keys will still go to menus and dialogs because in that case popup_activated is TRUE (see above). */ *finish = X_EVENT_DROP; When commented out, kbd input goes to embedder and embedded alike, which is not very convenient of course. Even though the case of embedding an emacs within an emacs is probably not a real world case, it exposes problems all more complex application embedding will have. Keyboard events would need to be filtered by the embedding emacs, and forwarded to the embedee on a key-by-key basis. The simplest filter would have 2 states and work somewhat like: 1: send nothing to the embedee 2: send everything except c-c c-c to the embedee c-c c-c could toggle between states. (initially I will probably have some single key for this for simplicity) This is not perfect in general since one might want to send c-c c-c to the embedee sometimes, but should be good enough to start with. A separate command might be made to send a synthetic c-c c-c to the embedee if needed. A brief summary of current issues with this patch: - xwidgets currently only works in 1 window in 1 frame. - some graphics bugs when moving widgets. - keyboard handling of xembedded widgets. All issues seems to be solvable. -- Joakim Verona