Activating plugin with keyboard shortcut

mmassonnet at gmail.com mmassonnet at gmail.com
Tue Dec 25 14:18:26 CET 2007


Hi Enrico,

On Tue, Dec 25, 2007 at 12:07:50PM +0100, Enrico Tröger wrote:
> On Mon, 24 Dec 2007 13:53:56 +0100, mmassonnet at gmail.com wrote:
> 
> > Yeah, verve uses DBus, but there are also the windowlist/menu/...
> > plugins that have a focus interface however with XSelection.  They all
> Any details? What do you mean by XSelection?

Code, only the code[0][1] :-)  Basically, you set an XSelection inside
your plugin, and you can get the XSelection in other processes.  When
you get the XSelection, you can write messages to it.  Just like it
would work with a common Socket where you take care for new input, you
do it with GLib signals.  You listen for new messages.

[0] http://svn.xfce.org/index.cgi/xfce/blame/xfce4-panel/trunk/plugins/windowlist/windowlist.c lines 901 to 956
[1] http://svn.xfce.org/index.cgi/xfce/view/xfce4-panel/trunk/plugins/windowlist/xfce4-popup-windowlist.c

> > have a xfce4-popup-$something command or verve-focus.  The dict plugin
> > is missing such an interface, unfortunately.
> We can add something like this, no problem. But maybe we should think
> about a more generic way. If the verve plugin has similar needs and
> maybe other plugins too, maybe libxfce4panel can provide something
> useful for all plugins to avoid the same code in several plugins.

Let me factorize what you can share between different plugins: a
set_selection function that takes a "selection_name" (your plugin name),
a "callback", and a "user data" for the callback (a pointer on your
plugin).  And thats it.  Well then you have the popup command, where you
can share code for the check_is_running function…

IMHO, I'm not sure that a selection thing should end in libpanel.  There
are tons of ways to do this.  First idea that seems nice is a general
popup command (e.g. `xfce4-panel-popup plugin-name ...`), with a "popup"
signal to attach to inside the panel plugin interface.

static gboolean        popup_callback        (XfcePanelPlugin *panel_plugin,
                                              gchar ***argv,
                                              gpointer user_data);

That's what I can think of now… but there is maybe a 4.6 way.

> Regards,
> Enrico

mike



More information about the Xfce mailing list