unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: joakim@verona.se
To: emacs-devel@gnu.org
Subject: Re: embedding gtk widgets in a buffer
Date: Sat, 10 May 2008 23:07:37 +0200	[thread overview]
Message-ID: <m3wsm1vpeu.fsf@verona.se> (raw)
In-Reply-To: <m3ej8dhf6q.fsf@verona.se> (joakim@verona.se's message of "Thu, 08 May 2008 01:23:09 +0200")


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




  parent reply	other threads:[~2008-05-10 21:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 23:23 embedding gtk widgets in a buffer joakim
2008-05-08  0:21 ` joakim
2008-05-08  9:02 ` BVK
2008-05-08 22:28 ` Richard M Stallman
2008-05-08 23:13   ` joakim
2008-05-08 23:24     ` Lennart Borgman (gmail)
2008-05-10  8:55     ` Richard M Stallman
2008-05-10 11:55       ` joakim
2008-05-10  8:55     ` Richard M Stallman
2008-05-10  9:58       ` joakim
2008-05-10 10:22         ` Lennart Borgman (gmail)
2008-05-11  7:34         ` Richard M Stallman
2008-05-09  8:34   ` YAMAMOTO Mitsuharu
2008-05-10 21:07 ` joakim [this message]
2008-05-11  7:35   ` Richard M Stallman
2008-05-11  8:25     ` joakim
2008-05-11 12:32       ` David Kastrup
2008-05-11 12:48       ` joakim
2008-05-11 12:58         ` Lennart Borgman (gmail)
2008-05-12  4:38           ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wsm1vpeu.fsf@verona.se \
    --to=joakim@verona.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).