qulogic/libgnt

b0ffb602e7e5
Parents 99ad336bd8bf
Children 216209ee8d5f
wms/s: Remove libpurple dependency from sample wms

As far as I could tell, wms/s.c is a sample window manager, made
to demonstrate how to use various features of libgnt. Therefore,
it's a little silly to depend on libpurple functionality for it.
This patch removes the dependency of libpurple from the sample wms
by changing it from trying to toggle the buddy list visibility upon
pressing the keyboard shortcut, to simply presenting any window
named "buddylist".
  • +4 -7
    wms/meson.build
  • +5 -9
    wms/s.c
  • --- a/wms/meson.build Fri Nov 30 01:40:38 2018 -0500
    +++ b/wms/meson.build Fri Nov 30 18:17:33 2018 -0600
    @@ -5,10 +5,7 @@
    name_prefix : '',
    install : true, install_dir : plugindir)
    -if PURPLE_AVAILABLE
    - # These custom wms depend on libpurple
    - s = library('s', 's.c',
    - dependencies : [ncurses, gobject, libgnt_dep, libpurple_dep],
    - name_prefix : '',
    - install : true, install_dir : plugindir)
    -endif
    +s = library('s', 's.c',
    + dependencies : [ncurses, gobject, libgnt_dep],
    + name_prefix : '',
    + install : true, install_dir : plugindir)
    --- a/wms/s.c Fri Nov 30 01:40:38 2018 -0500
    +++ b/wms/s.c Fri Nov 30 18:17:33 2018 -0600
    @@ -20,7 +20,7 @@
    * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    */
    -#include "internal.h"
    +#include "gntinternal.h"
    #include <string.h>
    #include <sys/types.h>
    @@ -33,8 +33,6 @@
    #include "gntwindow.h"
    #include "gntlabel.h"
    -#include "buddylist.h"
    -
    #define TYPE_S (s_get_type())
    #ifdef _S
    @@ -188,14 +186,12 @@
    }
    static gboolean
    -toggle_buddylist(GntBindable *bindable, GList *null)
    +raise_buddylist(GntBindable *bindable, GList *null)
    {
    GntWM *wm = GNT_WM(bindable);
    GntWidget *blist = find_widget(wm, "buddylist");
    if (blist)
    - gnt_widget_destroy(blist);
    - else
    - purple_blist_show();
    + gnt_wm_raise_window(wm, blist);
    return TRUE;
    }
    @@ -211,8 +207,8 @@
    pclass->window_update = s_window_update;
    pclass->mouse_clicked = s_mouse_clicked;
    - gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-buddylist",
    - toggle_buddylist, "\033" "b", NULL);
    + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass),
    + "raise-buddylist", raise_buddylist, "\033" "b", NULL);
    gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));
    GNTDEBUG;
    }