[oe-commits] org.oe.dev matchbox-applet-inputmanager 0.6: Implement smart IM visibility protocol.
pfalcon commit
openembedded-commits at lists.openembedded.org
Fri Nov 30 15:06:04 UTC 2007
matchbox-applet-inputmanager 0.6: Implement smart IM visibility protocol.
* One of the very noticeable pain points in matchbox' IM handling is high
latency of IM popping up, which can take up to half-second with complex
screen layouts. This is rooted in the fact that IM process is killed when
IM window is hidden, and started again afterwards.
* I wanted to address this on inputmanager level, transparently to actual
IM implementation, by hiding/showing IM's window by the manager. Unfortunately,
there appears to be no reliable method to figure out window IDs from process
properties (for example, _MB_CLIENT_EXEC_MAP X property, maintained by matcbox,
doesm't capture all apps started, in particular, it captures neither xkbd
nor matchbox-keyboard, GPE's term app is not caught too, while either GPE apps
are). Then, wanted to implement custom PropertyNotify-based protocol, though
there would be left issue of distinguishing IMs which support this protocol
and ones which don't. Finally, by random gerpping, I found that xkbd supports
Unix signal based visibility protocol! By receiving SIGUSR1, it hides/shows
its window. This seems like 100% win, as the default behavior for SIGUSR1
is process termination, so unsupporting clients will be just terminated as
before.
Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: 9dd1db4bb3cf89ee4dbec0e39b70c637c8ded624
ViewMTN: http://monotone.openembedded.org/revision/info/9dd1db4bb3cf89ee4dbec0e39b70c637c8ded624
Files:
1
packages/matchbox-applet-inputmanager/files/visibility-protocol.patch
packages/matchbox-applet-inputmanager/matchbox-applet-inputmanager_0.6.bb
Diffs:
#
# mt diff -r40c1310e22eafc45885f6438107bdd74a52442ee -r9dd1db4bb3cf89ee4dbec0e39b70c637c8ded624
#
#
#
# add_file "packages/matchbox-applet-inputmanager/files/visibility-protocol.patch"
# content [799b8565843ed42198f73e6a69c4dbb841a1fa87]
#
# patch "packages/matchbox-applet-inputmanager/matchbox-applet-inputmanager_0.6.bb"
# from [589947a0096409723c091db255f66db086f41085]
# to [041a30d86d81e7e5ca3cc3d5cd51f7eb0362daf8]
#
============================================================
--- packages/matchbox-applet-inputmanager/files/visibility-protocol.patch 799b8565843ed42198f73e6a69c4dbb841a1fa87
+++ packages/matchbox-applet-inputmanager/files/visibility-protocol.patch 799b8565843ed42198f73e6a69c4dbb841a1fa87
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User "Paul Sokolovsky <pfalcon at users.sourceforge.net>"
+# Date 1196333272 -7200
+# Node ID 4ec785864bbe896eda3b933e65a5f2d71864b9b3
+# Parent 375f9e4a30d3de9852b00cd1decb259f4f04446e
+Implement an IM [Unix-]signal-based visibility protocol, as supported
+by xkbd. By receiving SISUSR1, IM implementation toggles its visibility.
+The most valuable, default action for SIGUSR1 is process termination, so
+we can send SIGUSR1 unconditionally, replacing old method of sending
+SIGTERM (and there's also check for process existence before sending
+signal, so if process is dead, it will be just restarted).
+
+diff -r 375f9e4a30d3 -r 4ec785864bbe mbinputmgr.c
+--- a/mbinputmgr.c Wed Nov 28 03:41:20 2007 +0200
++++ b/mbinputmgr.c Thu Nov 29 12:47:52 2007 +0200
+@@ -1,3 +1,4 @@
++#include <signal.h>
+ #include "mbinputmgr.h"
+
+ static void
+@@ -233,8 +234,10 @@ mbinputmgr_toggle_selected_method (MBInp
+ if ( (inpmgr->PidCurrent != -1) /* Something running */
+ && (kill(inpmgr->PidCurrent, 0) != -1) )
+ {
+- kill(inpmgr->PidCurrent, 15); /* kill it */
+- inpmgr->PidCurrent = -1;
++ /* Send a SIGUSR1. Smart IMs will toggle their visibility.
++ Dumb, which don't handle it at all, will just die
++ per default action for SIGUSR1, termination. */
++ kill(inpmgr->PidCurrent, SIGUSR1);
+ }
+ else fork_exec(inpmgr, inpmgr->MethodSelected->exec);
+ }
============================================================
--- packages/matchbox-applet-inputmanager/matchbox-applet-inputmanager_0.6.bb 589947a0096409723c091db255f66db086f41085
+++ packages/matchbox-applet-inputmanager/matchbox-applet-inputmanager_0.6.bb 041a30d86d81e7e5ca3cc3d5cd51f7eb0362daf8
@@ -1,13 +1,14 @@ SECTION = "x11/wm"
DESCRIPTION = "Matchbox input manager"
LICENSE = "GPL"
DEPENDS = "matchbox-wm libmatchbox"
SECTION = "x11/wm"
-PR = "r3"
+PR = "r4"
SRC_URI = "http://projects.o-hand.com/matchbox/sources/mb-applet-input-manager/${PV}/mb-applet-input-manager-${PV}.tar.gz \
file://update-to-svn.diff;patch=1 \
file://mbinputmgr-libgtkinput.patch;patch=1 \
+ file://visibility-protocol.patch;patch=1 \
"
S = "${WORKDIR}/mb-applet-input-manager-${PV}"
More information about the Openembedded-commits
mailing list