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: Sat, 10 May 2008 23:07:37 +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 1210453924 7293 80.91.229.12 (10 May 2008 21:12:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 May 2008 21:12:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 10 23:12:41 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 1JuwMw-000777-M0 for ged-emacs-devel@m.gmane.org; Sat, 10 May 2008 23:12:38 +0200 Original-Received: from localhost ([127.0.0.1]:53393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JuwME-0002E5-36 for ged-emacs-devel@m.gmane.org; Sat, 10 May 2008 17:11:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JuwM9-0002D6-NZ for emacs-devel@gnu.org; Sat, 10 May 2008 17:11:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JuwM8-0002CH-92 for emacs-devel@gnu.org; Sat, 10 May 2008 17:11:49 -0400 Original-Received: from [199.232.76.173] (port=33156 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JuwM8-0002CE-3t for emacs-devel@gnu.org; Sat, 10 May 2008 17:11:48 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:52696 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 1JuwM7-0006Mx-Jg for emacs-devel@gnu.org; Sat, 10 May 2008 17:11:47 -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 m4ALBhEV031905 for ; Sat, 10 May 2008 23:11:44 +0200 In-Reply-To: (joakim@verona.se's message of "Thu, 08 May 2008 01:23:09 +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:96947 Archived-At: I can now xembed emacs within emacs. The embedded emacs, however, can't receive keyboard focus. It's possible, though, to click in the embedded emacs with the mouse to acivate menus and move the emacs cursor. Heres the code I'm trying: DEFUN("xwidget-set-keyboard-grab", Fxwidget_set_keyboard_grab,Sxwidget_set_keyboard_grab, 2,2,0, doc: /* set unset kbd grab for xwidget.*/) (xwidget_id,kbd_grab) Lisp_Object xwidget_id, kbd_grab; { struct xwidget *xw; int xid=XFASTINT(xwidget_id); xw=&xwidgets[xid]; int kbd_flag=XFASTINT(kbd_grab); printf("kbd grab: %d %d\n",xid,kbd_flag); if (kbd_flag) { // int rv=gtk_widget_activate(xw->widget); //ok, but how deactivate? //printf("activation:%d\n",rv); // gtk_window_present(GTK_WINDOW(xw->widget)); gtk_widget_grab_focus(xw->widget); } /* gdk_keyboard_grab(xw->widget,TRUE,GDK_CURRENT_TIME); else gdk_keyboard_ungrab(GDK_CURRENT_TIME); */ return Qnil; } As you can see I've tried several aproaches to get the gtk socket to get keyboard events, but none work. Any hints? I'm going also to try to send a plain XEMBED_WINDOW_ACTIVATE X message to the widget, but I dont really see why that would work and the aproaches above wouldnt. -- Joakim Verona