view plugins/iconaway.c @ 134:00c1ee609648

[gaim-migrate @ 144] Heh, whoops. Silly bug. If you only have one plugin loaded, and it's configurable, and you unload it, the 'configure' button wouldn't deactivate, and so you could still click on it, and it would segfault. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 19 Apr 2000 02:23:30 +0000
parents e277d5f0c1dd
children e8ea1e2fdf0c
line wrap: on
line source

#define GAIM_PLUGINS
#include "gaim.h"

#include <gdk/gdkx.h>
#include <X11/Xlib.h>

void *handle;

extern GtkWidget *imaway;
extern GtkWidget *blist;

extern void set_applet_draw_closed();

void iconify_windows(void *data) {
	XIconifyWindow(GDK_DISPLAY(),
			GDK_WINDOW_XWINDOW(imaway->window),
			((_XPrivDisplay)GDK_DISPLAY())->default_screen);
#ifdef USE_APPLET
	gnome_buddy_hide();
	set_applet_draw_closed();
#else
	XIconifyWindow(GDK_DISPLAY(),
			GDK_WINDOW_XWINDOW(blist->window),
			((_XPrivDisplay)GDK_DISPLAY())->default_screen);
#endif
}

void gaim_plugin_init(void *h) {
	handle = h;

	gaim_signal_connect(handle, event_away, iconify_windows, NULL);
}

char *name() {
	return "Iconify On Away";
}

char *description() {
	return "Iconifies the away box and the buddy list when you go away.";
}