I have both the previous questions answered (enough). I'm trying to properly use the IPC mechanism to handle the menu and page refreshes, but I'm failing miserably ... can somebody tell me what I'm missing? Here's the code:
Code:
gboolean
sys_startup_complete(void *vp)
{
View *v = (View *) vp;
const int xid = GDK_WINDOW_XID(v->window->window);
eripc_sysd_startup_complete( eipccc, getpid(), TRUE, xid);
return FALSE;
}
...
void menu_handler(eripc_context_t *context,
const eripc_event_info_t *info,
void *user_data)
{
const eripc_arg_t *arg_array = info->args;
printf("FEH!\n");
if ((arg_array[0].type == ERIPC_TYPE_STRING) &&
(arg_array[1].type == ERIPC_TYPE_STRING) &&
(arg_array[2].type == ERIPC_TYPE_STRING) &&
(arg_array[3].type == ERIPC_TYPE_STRING))
{
const char *item = arg_array[0].value.s;
const char *group = arg_array[1].value.s;
const char *menu = arg_array[2].value.s;
const char *state = arg_array[3].value.s;
printf("%s %s %s %s\n", state, menu, group, item);
}
}
...
int main() {
...
eripc_callback_function_t callbacks[] = {
{ menu_handler, "menuItemActivated", NULL },
{ NULL }
};
...
/* set up eripc */
eipccc = eripc_client_context_new(
"techpdf", "0.1", "org.codu.techpdf", "/org/codu/techpdf", "org.codu.techpdf", callbacks);
eripc_menu_add_group(eipccc, "GTest", "", "folder");
eripc_menu_add_item(eipccc, "Test", "GTest", "folder");
eripc_menu_add_menu(eipccc, "main", "GTest", NULL, NULL, NULL);
eripc_menu_set_group_label(eipccc, "GTest", "GTest");
eripc_menu_set_item_label(eipccc, "Test", "GTest", "Test");
eripc_menu_show_menu(eipccc, "main");
...
}
sys_startup_complete is called as a g_idle_add. The .desktop file calls the binary directly (not via a shell script). The menu displays properly, but doesn't call back properly. I get no callbacks at all
At this point I'm stumped, I'm sure I'm just missing some important call, but I haven't found it ...