viability of implementing global shortcuts via KDED and DBus
Lubos Lunak
l.lunak at suse.cz
Fri May 11 10:45:40 BST 2007
On Friday 11 of May 2007, Andreas Hartmetz wrote:
> On Friday 11 May 2007 07:44:08 Thomas Zander wrote:
> > On Friday 11 May 2007 02:46:43 Andreas Hartmetz wrote:
> > > I have recently reimplemented KGlobalAccel to implement proper global
> > > shortcut conflict resolution. To that end, every application has to
> > > have a list of all global shortcuts that has to be loaded from a global
> > > config file. This is neither space nor CPU efficient, especially at
> > > application startup time (bad!).
> > >
> > > It would be nice to have a KDED module that listens to keypresses like
> > > the current KGlobalAccel does and that also does the bookkeeping.
> > > As I have no DBus experience, there are some issues on which I am
> > > asking anyone with DBus/QtDBus knowledge for comments.
> >
> > I suggest turning it around; let the application query some global object
> > via dbus and get a list of conflicting keypresses only (low memory).
> > You should do this (shortly) after the app shown its window to avoid
> > network latency slowing down the startup, but my guess would be that it
> > would be faster than loading / parsing files from disk.
>
> OK, nice idea but not fully thought through, or I didn't get what you mean.
I think what Thomas meant was that the conflict resolution should be handled
by IPC, instead of parsing a config file all the time; it wasn't about where
XGrabKey() should be done (where kded module would be a best place it seems).
> Erm by the way, can one rely on the presence of KDED, even when running a
> KDE application in another DE's session?
Kdeinit (which also launches kded) can be started on-demand if needed. See
e.g. KToolInvocation::klauncher().
>
> (*) Global shortcuts of applications that are not running should be
> remembered to protect them from conflicts, especially user made conflicts
> by shortcut editing. The old system cannot do this, which arguably needs to
> be fixed.
Arguably. If I have both KSCD and Amarok and they both have 'Next track'
global shortcut, should I really be prevented from using the same shortcut?
Not that I really know the right answer.
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http//www.suse.cz
More information about the kde-core-devel
mailing list