From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs X/GTK code trouble with Maemo Date: Tue, 23 Jan 2007 08:16:08 +0100 Message-ID: <45B5B638.2070808@swipnet.se> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169536630 5371 80.91.229.12 (23 Jan 2007 07:17:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Jan 2007 07:17:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 23 08:17:03 2007 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 1H9Ftu-0006N3-Ag for ged-emacs-devel@m.gmane.org; Tue, 23 Jan 2007 08:17:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9Ftt-0005Ht-Sq for ged-emacs-devel@m.gmane.org; Tue, 23 Jan 2007 02:17:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H9Fth-0005Hi-Vx for emacs-devel@gnu.org; Tue, 23 Jan 2007 02:16:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H9Ftg-0005FJ-7z for emacs-devel@gnu.org; Tue, 23 Jan 2007 02:16:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9Ftg-0005Ez-0M for emacs-devel@gnu.org; Tue, 23 Jan 2007 02:16:48 -0500 Original-Received: from [81.228.9.180] (helo=av6-2-sn3.vrr.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H9Ftf-0000Ox-Ep for emacs-devel@gnu.org; Tue, 23 Jan 2007 02:16:47 -0500 Original-Received: by av6-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 4484D37FF7; Tue, 23 Jan 2007 08:16:44 +0100 (CET) Original-Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av6-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 3146337FEC; Tue, 23 Jan 2007 08:16:44 +0100 (CET) Original-Received: from husetbladh.homeip.net (81-235-205-78-no59.tbcn.telia.com [81.235.205.78]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id B6EEF37E4C; Tue, 23 Jan 2007 08:16:43 +0100 (CET) User-Agent: Thunderbird 1.5.0.9 (X11/20070102) Original-To: Ted Zlatanov In-Reply-To: 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:65402 Archived-At: Ted Zlatanov skrev: > I'm having a problem with the Emacs X code. Specifically, on the > Maemo platform, standard GTK widgets that accept text entry will get a > pop-up keyboard. With Emacs, however, I am not able to get that > keyboard with Emacs buffer windows. I was pointed to some > documentation, which suggests that either I need to use standard GTK > widgets or manually call the functions Window::AcquireKeyboardInput() > and Window::ReleaseKeyboardInput(), plus handle some X events. > > I'm using this post as reference: > http://www.gossamer-threads.com/lists/maemo/developers/13600?search_string=input;#13600 > > Plus these snippets: > https://garage.maemo.org/snippet/browse.php?by=lang&lang=2 > > You can get more information about input methods for Maemo here: > http://maemo.org/platform/docs/tutorials/Maemo_tutorial.html#input > > You can install the Maemo SDK easily on a Debian system: > http://maemo.org/platform/docs/howtos/Maemo_tutorial_bora.html > > My questions: > > 1) are buffer windows text-input-capable GTK widgets when --with-gtk > is used? If yes, something is going wrong in the setup phase, and > they don't accept keyboard input when they should. No, buffer windows are GTK drawing areas. Text is handeled with X primitives, like XDrawImageString. GTK text input widgets just don't have what it takes to handle all Emacs requirements for text. Also, there is no GTK-specific drawing code for text, it is generic for all X platforms. > > 2) Assuming "no" to (1), if I have to use the manual acquire/release > keyboard functions, where would I make that change? I couldn't find a > gain/lose focus event in the C code. Also, where would I handle the X > events? I need to handle them to tell Maemo that the keyboard is safe > to bring up. The main event loop is, as you say below, in src/xterm.c:XTread_socket. The individual events are handeled in handle_one_xevent. Focus changes are dealt with in x_focus_changed. > > I think I can use src/window.c:select-window() to acquire the > keyboard. X Events seem to be processed in > src/xterm.c:XTread_socket(). My inexperience with GTK and X, however, > is making it hard for me to understand what's going on, and I would > like some help from people that understand the Emacs X internals better. Jan D.