Aw: Re: New panel in trunk

Fabian Nowak timystery at arcor.de
Thu Oct 13 18:28:24 CEST 2005


Am Donnerstag, den 13.10.2005, 18:12 +0200 schrieb Jasper Huijsmans:
> Fabian Nowak schreef:
> > hmm, launcher is still not better than before. try this:
> > 
> > :~/tmp/xfce4-panel/plugins/launcher$ diff launcher.c launcher_fabian.c 
> > 801a802,803
> > 
> >>    else 
> >>        entry->name = g_strdup ("");
> > 
> > 804a807,808
> > 
> >>    else
> >>        entry->exec = g_strdup ("");
> > 
> > 811a816,817
> > 
> >>    else 
> >>        entry->comment = g_strdup ("");
> > 
> > 812a819,821
> > 
> >>/* be careful: what about having no icon specified? it will try
> >>    to read x-fce-icon-category!
> >>    so FIXME! */
> > 
> > 
> > 
> > Works.
> > 
> 
> This is the wrong fix IMO. What exactly does it solve (what works 
> afterwards that didn't work before)?

yes, it's wrong. totally correct qould be to have default
initializations of the entry->value|command|...
this one circumvents that you don not save values when writing the rc
files, which aren't loaded as the result from the s = xfce_rc_read()
calls is s==NULL and therfore s is not initiallized in your code,
leading to the strange behaviour that items in menus are missing when
having no exec or no comment in config file or that even the panel
element wouldn't show up because it had no command and was therfor
ignored.

the panel does now _always_ show _any_ previous items after restarting
the panel, even if exec or comment fields was left empty before and
wasn't written before.

anopther option is to write empty entries to the config file, i.e. to
_not_check 

if (entry->exec) write_it()

but to always write it even if it's empty.


> 
> [...]
> >>>
> >>>
> >>>>>got the impression you check for unknown commands only when reading the
> >>>>>config files?
> >>>>
> >>>>As far as I know, I don't check anything...
> >>>>
> >>>>	Jasper
> > 
> > 
> > true. there is no signal handler registered:
> > 
> > 
> > launcher_dialog_response (OK) ->  launcher_save(plugin , launcher) ->
> > launcher_write_rc_file (..) -> 
> > 
> > i suggest adding 
> > 
> > g_signal_connect (mi, "activate", G_CALLBACK
> > (launcher_menu_item_activate), entry); to launcher_save() after writing
> > the rc file.
> > 
> > then you have the signal handler. but i'm too lazy to search around on
> > whether plugin or launcher has this 'entry' to be given as parameter.
> > 
> 
> Huh?? This doesn't make any sense. What's this 'mi'. What are you trying 
> to do?

just searched on how menu items were executed, mi is for menuitem from
your code. see next email.


> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev




More information about the Xfce4-dev mailing list