Commit 8a8cdadf authored by Mark McLoughlin's avatar Mark McLoughlin
Browse files

Merge multihead branch into HEAD

parent 3d7c6162
......@@ -49,6 +49,11 @@
* gnome-panel/panel.c: (drop_directory):
remove uri_exists and use panel_uri_exists instead
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* configure.in: add check for gtk+ 2.1.x and
define HAVE_GTK_MULTIHEAD if found.
2002-06-21 Mark McLoughlin <mark@skynet.ie>
* configure.in: enable compile warnings.
......
......@@ -21,6 +21,14 @@
unconditionally get the pixmap directory, fixes
#88125.
2002-07-15 Mark McLoughlin <mark@skynet.ie>
* mailcheck.c:
(mailcheck_execute_shell): add mailcheck arg and set
screen upon which the dialog should realise.
(after_mail_check), (mail_check_timeout),
(exec_clicked_cmd): update for above change.
2002-05-21 Jorn Baayen <jorn@nl.linux.org>
* pager.glade: use GTK_SHADOW_IN for consistency
......@@ -64,6 +72,30 @@
* tasklist.glade: #85344 - s/Tasklist/Window List/
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add multihead-hacks.h.
* multihead-hacks.h: some hacks to reduce the number
of HAVE_GTK_MULTIHEADs needed.
* clock.c, mailcheck.c: make sure all dialogs realize on
the right screen.
* pager.c: (applet_get_screen): impl helper method.
(applet_realized): set the screen that the pager controls
when the applet is realized.
(response_cb), (fill_pager_applet), (display_help_dialog),
(display_about_dialog), (display_properties_dialog): make
sure all dialogs realize on the right screen.
* tasklist.c: (applet_get_screen): impl helper method.
(applet_realized): set the screen that the tasklist
controls when the applet is realized.
(response_cb), (fill_tasklist_applet), (display_help_dialog),
(display_about_dialog), (display_properties_dialog): make
sure all dialogs realize on the right screen.
2002-06-18 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: use $(prefix)/$(DATADIRNAME)/locale instead
......
......@@ -39,7 +39,8 @@ libgen_util_applet_2_la_SOURCES = \
popcheck.c \
popcheck.h \
remote-helper.c \
remote-helper.h
remote-helper.h \
multihead-hacks.h
libgen_util_applet_2_la_LDFLAGS = -module -avoid-version
libgen_util_applet_2_la_LIBADD = \
......
......@@ -27,6 +27,8 @@
#include "clock.h"
#include "multihead-hacks.h"
#define INTERNETSECOND (864)
#define INTERNETBEAT (86400)
......@@ -845,7 +847,9 @@ set_gmt_time_cb (GtkWidget *w,
}
static void
properties_response_cb (GtkWidget *widget, gint id, gpointer data)
properties_response_cb (GtkWidget *widget,
int id,
ClockData *cd)
{
if (id == GTK_RESPONSE_HELP) {
......@@ -877,6 +881,8 @@ properties_response_cb (GtkWidget *widget, gint id, gpointer data)
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (cd->applet));
gtk_widget_show (dialog);
g_error_free (error);
}
......@@ -908,7 +914,9 @@ display_properties_dialog (BonoboUIComponent *uic,
GSList *list;
char *file;
if (cd->props != NULL) {
if (cd->props) {
gtk_window_set_screen (GTK_WINDOW (cd->props),
gtk_widget_get_screen (cd->applet));
gtk_window_present (GTK_WINDOW (cd->props));
return;
}
......@@ -922,6 +930,8 @@ display_properties_dialog (BonoboUIComponent *uic,
gtk_dialog_set_has_separator (GTK_DIALOG (cd->props), FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (cd->props), GTK_RESPONSE_CLOSE);
gtk_window_set_screen (GTK_WINDOW (cd->props),
gtk_widget_get_screen (cd->applet));
file = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
"gnome-clock.png", TRUE, NULL);
......@@ -1061,7 +1071,7 @@ display_properties_dialog (BonoboUIComponent *uic,
g_signal_connect (G_OBJECT (cd->props), "destroy",
G_CALLBACK (gtk_widget_destroyed), &(cd->props));
g_signal_connect (G_OBJECT (cd->props), "response",
G_CALLBACK (properties_response_cb), NULL);
G_CALLBACK (properties_response_cb), cd);
/* sets up atk relation */
list = g_slist_append (NULL, twelvehour);
......@@ -1109,6 +1119,8 @@ display_help_dialog (BonoboUIComponent *uic,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (cd->applet));
gtk_widget_show (dialog);
g_error_free (error);
}
......@@ -1137,8 +1149,9 @@ display_about_dialog (BonoboUIComponent *uic,
/* Translator credits */
const char *translator_credits = _("translator_credits");
if (about != NULL)
{
if (about) {
gtk_window_set_screen (GTK_WINDOW (about),
gtk_widget_get_screen (cd->applet));
gtk_window_present (GTK_WINDOW (about));
return;
}
......@@ -1162,6 +1175,8 @@ display_about_dialog (BonoboUIComponent *uic,
pixbuf);
gtk_window_set_wmclass (GTK_WINDOW (about), "clock", "Clock");
gtk_window_set_screen (GTK_WINDOW (about),
gtk_widget_get_screen (cd->applet));
if (pixbuf) {
gtk_window_set_icon (GTK_WINDOW (about), pixbuf);
......
......@@ -10,6 +10,18 @@
* fish.c: (get_location): clean up a bit to
fix warning.
2002-07-17 Mark McLoughlin <mark@skynet.ie>
* fish.c: (something_fishy_going_on): fix build breakage.
2002-07-15 Mark McLoughlin <mark@skynet.ie>
* fish.c:
(something_fishy_going_on): add fish arg and set dialog
screen.
(fish_locate_fortune_command), (update_fortune_dialog): upd
for above change.
2002-07-12 Mark McLoughlin <mark@skynet.ie>
* fish.c: (something_fishy_going_on): impl.
......@@ -22,6 +34,17 @@
* fish.c (update_fortune_dialog): Convert the fortune string from
the user locale to UTF-8. This fixes bug #82254
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* fish.c: (fishy_root_window),
(fishy_window_set_screen): impl helper methods.
(load_image_file): create the pixmap using the correct
root window.
(fish_properties_apply), (display_properties_dialog),
(update_fortune_dialog), (change_water),
(display_about_dialog): set the screen on which the window
is to realize.
2002-06-21 Mark McLoughlin <mark@skynet.ie>
* fish.c: (load_image_file), (create_fish_widget),
......
......@@ -53,6 +53,29 @@ typedef struct {
PanelAppletOrient orient;
} Fish;
/* Multihead support:
* Move these inline when we require gtk+ with multihead.
*/
static inline GdkWindow *
fishy_root_window (Fish *fish)
{
#ifdef HAVE_GTK_MULTIHEAD
return gdk_screen_get_root_window (
gtk_widget_get_screen (fish->applet));
#else
return gdk_get_default_root_window ();
#endif
}
static inline void
fishy_window_set_screen (GtkWindow *window,
GtkWidget *widget)
{
#ifdef HAVE_GTK_MULTIHEAD
gtk_window_set_screen (window, gtk_widget_get_screen (widget));
#endif
}
/*
* set_access_name_desc
* Description : Set Accessible Name and Description.
......@@ -282,7 +305,7 @@ load_image_file (Fish *fish)
fish->w = frames * fish->size;
fish->h = fish->size;
}
fish->pix = gdk_pixmap_new (GDK_ROOT_PARENT (),
fish->pix = gdk_pixmap_new (fishy_root_window (fish),
fish->w, fish->h, -1);
return;
}
......@@ -348,7 +371,7 @@ load_image_file (Fish *fish)
fish->w = w;
fish->h = h;
fish->pix = gdk_pixmap_new (GDK_ROOT_PARENT (),
fish->pix = gdk_pixmap_new (fishy_root_window (fish),
fish->w,fish->h,-1);
gc = gdk_gc_new (fish->pix);
......@@ -587,6 +610,7 @@ fish_properties_apply (GtkDialog *pb, Fish *fish)
"which would make the applet "
"\"practical\" or useful."));
gtk_window_set_wmclass (GTK_WINDOW (w), "fish_useful_warning", "Fish");
fishy_window_set_screen (GTK_WINDOW (w), fish->applet);
gtk_widget_show_all (w);
......@@ -681,7 +705,8 @@ display_properties_dialog (BonoboUIComponent *uic,
gboolean rotate;
GtkWidget *apply_button;
if (fish->pb != NULL) {
if (fish->pb) {
fishy_window_set_screen (GTK_WINDOW (fish->pb), fish->applet);
gtk_window_present (GTK_WINDOW (fish->pb));
return;
}
......@@ -705,6 +730,7 @@ display_properties_dialog (BonoboUIComponent *uic,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
gtk_window_set_wmclass (GTK_WINDOW (fish->pb), "fish", "Fish");
fishy_window_set_screen (GTK_WINDOW (fish->pb), fish->applet);
gtk_dialog_set_default_response (GTK_DIALOG (fish->pb), GTK_RESPONSE_OK);
......@@ -835,7 +861,8 @@ display_properties_dialog (BonoboUIComponent *uic,
}
static void
something_fishy_going_on (const char *message)
something_fishy_going_on (Fish *fish,
const char *message)
{
GtkWidget *dialog;
......@@ -850,6 +877,7 @@ something_fishy_going_on (const char *message)
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
fishy_window_set_screen (GTK_WINDOW (dialog), fish->applet);
gtk_widget_show (dialog);
}
......@@ -860,7 +888,7 @@ fish_locate_fortune_command (Fish *fish)
retval = panel_applet_gconf_get_string (PANEL_APPLET (fish->applet), FISH_PREFS_COMMAND, NULL);
if (!retval) {
something_fishy_going_on (_("Unable to get the name of the command to execute"));
something_fishy_going_on (fish, _("Unable to get the name of the command to execute"));
return NULL;
}
......@@ -876,7 +904,7 @@ fish_locate_fortune_command (Fish *fish)
retval = g_strdup ("/usr/games/fortune");
if (!retval)
something_fishy_going_on (_("Unable to locate the command to execute"));
something_fishy_going_on (fish, _("Unable to locate the command to execute"));
return retval;
}
......@@ -951,6 +979,7 @@ update_fortune_dialog (Fish *fish)
g_signal_connect (G_OBJECT (fish->fortune_dialog), "response",
G_CALLBACK (response), NULL);
gtk_window_set_wmclass (GTK_WINDOW (fish->fortune_dialog), "fish", "Fish");
fishy_window_set_screen (GTK_WINDOW (fish->fortune_dialog), fish->applet);
gnome_window_icon_set_from_file (GTK_WINDOW (fish->fortune_dialog),
GNOME_ICONDIR"/gnome-fish.png");
......@@ -992,6 +1021,8 @@ update_fortune_dialog (Fish *fish)
gtk_widget_show_all (fish->fortune_dialog);
} else {
set_access_name_desc (NULL, fish);
fishy_window_set_screen (GTK_WINDOW (fish->fortune_dialog),
fish->applet);
gtk_window_present (GTK_WINDOW (fish->fortune_dialog));
}
......@@ -1003,7 +1034,7 @@ update_fortune_dialog (Fish *fish)
message = g_strdup_printf (_("Unable to execute '%s'\n\nDetails : %s"),
fortune_command, error->message);
something_fishy_going_on (message);
something_fishy_going_on (fish, message);
g_free (message);
g_error_free (error);
}
......@@ -1039,6 +1070,7 @@ change_water (Fish *fish)
_("The water needs changing!\n"
"(Look at today's date)"));
gtk_window_set_wmclass (GTK_WINDOW (w), "fish", "Fish");
fishy_window_set_screen (GTK_WINDOW (w), fish->applet);
gtk_widget_show_all (w);
......@@ -1207,7 +1239,8 @@ display_about_dialog (BonoboUIComponent *uic,
gchar *file;
gchar *name;
if (fish->aboutbox != NULL) {
if (fish->aboutbox) {
fishy_window_set_screen (GTK_WINDOW (fish->aboutbox), fish->applet);
gtk_window_present (GTK_WINDOW (fish->aboutbox));
return;
}
......@@ -1252,6 +1285,7 @@ display_about_dialog (BonoboUIComponent *uic,
gdk_pixbuf_unref (pixbuf);
gtk_window_set_wmclass (GTK_WINDOW (fish->aboutbox), "fish", "Fish");
fishy_window_set_screen (GTK_WINDOW (fish->aboutbox), fish->applet);
gnome_window_icon_set_from_file (GTK_WINDOW (fish->aboutbox),
GNOME_ICONDIR"/gnome-fish.png");
gtk_signal_connect (GTK_OBJECT (fish->aboutbox), "destroy",
......
......@@ -21,6 +21,14 @@
unconditionally get the pixmap directory, fixes
#88125.
2002-07-15 Mark McLoughlin <mark@skynet.ie>
* mailcheck.c:
(mailcheck_execute_shell): add mailcheck arg and set
screen upon which the dialog should realise.
(after_mail_check), (mail_check_timeout),
(exec_clicked_cmd): update for above change.
2002-05-21 Jorn Baayen <jorn@nl.linux.org>
* pager.glade: use GTK_SHADOW_IN for consistency
......@@ -64,6 +72,30 @@
* tasklist.glade: #85344 - s/Tasklist/Window List/
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add multihead-hacks.h.
* multihead-hacks.h: some hacks to reduce the number
of HAVE_GTK_MULTIHEADs needed.
* clock.c, mailcheck.c: make sure all dialogs realize on
the right screen.
* pager.c: (applet_get_screen): impl helper method.
(applet_realized): set the screen that the pager controls
when the applet is realized.
(response_cb), (fill_pager_applet), (display_help_dialog),
(display_about_dialog), (display_properties_dialog): make
sure all dialogs realize on the right screen.
* tasklist.c: (applet_get_screen): impl helper method.
(applet_realized): set the screen that the tasklist
controls when the applet is realized.
(response_cb), (fill_tasklist_applet), (display_help_dialog),
(display_about_dialog), (display_properties_dialog): make
sure all dialogs realize on the right screen.
2002-06-18 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: use $(prefix)/$(DATADIRNAME)/locale instead
......
......@@ -39,7 +39,8 @@ libgen_util_applet_2_la_SOURCES = \
popcheck.c \
popcheck.h \
remote-helper.c \
remote-helper.h
remote-helper.h \
multihead-hacks.h
libgen_util_applet_2_la_LDFLAGS = -module -avoid-version
libgen_util_applet_2_la_LIBADD = \
......
......@@ -27,6 +27,8 @@
#include "clock.h"
#include "multihead-hacks.h"
#define INTERNETSECOND (864)
#define INTERNETBEAT (86400)
......@@ -845,7 +847,9 @@ set_gmt_time_cb (GtkWidget *w,
}
static void
properties_response_cb (GtkWidget *widget, gint id, gpointer data)
properties_response_cb (GtkWidget *widget,
int id,
ClockData *cd)
{
if (id == GTK_RESPONSE_HELP) {
......@@ -877,6 +881,8 @@ properties_response_cb (GtkWidget *widget, gint id, gpointer data)
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (cd->applet));
gtk_widget_show (dialog);
g_error_free (error);
}
......@@ -908,7 +914,9 @@ display_properties_dialog (BonoboUIComponent *uic,
GSList *list;
char *file;
if (cd->props != NULL) {
if (cd->props) {
gtk_window_set_screen (GTK_WINDOW (cd->props),
gtk_widget_get_screen (cd->applet));
gtk_window_present (GTK_WINDOW (cd->props));
return;
}
......@@ -922,6 +930,8 @@ display_properties_dialog (BonoboUIComponent *uic,
gtk_dialog_set_has_separator (GTK_DIALOG (cd->props), FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (cd->props), GTK_RESPONSE_CLOSE);
gtk_window_set_screen (GTK_WINDOW (cd->props),
gtk_widget_get_screen (cd->applet));
file = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
"gnome-clock.png", TRUE, NULL);
......@@ -1061,7 +1071,7 @@ display_properties_dialog (BonoboUIComponent *uic,
g_signal_connect (G_OBJECT (cd->props), "destroy",
G_CALLBACK (gtk_widget_destroyed), &(cd->props));
g_signal_connect (G_OBJECT (cd->props), "response",
G_CALLBACK (properties_response_cb), NULL);
G_CALLBACK (properties_response_cb), cd);
/* sets up atk relation */
list = g_slist_append (NULL, twelvehour);
......@@ -1109,6 +1119,8 @@ display_help_dialog (BonoboUIComponent *uic,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (cd->applet));
gtk_widget_show (dialog);
g_error_free (error);
}
......@@ -1137,8 +1149,9 @@ display_about_dialog (BonoboUIComponent *uic,
/* Translator credits */
const char *translator_credits = _("translator_credits");
if (about != NULL)
{
if (about) {
gtk_window_set_screen (GTK_WINDOW (about),
gtk_widget_get_screen (cd->applet));
gtk_window_present (GTK_WINDOW (about));
return;
}
......@@ -1162,6 +1175,8 @@ display_about_dialog (BonoboUIComponent *uic,
pixbuf);
gtk_window_set_wmclass (GTK_WINDOW (about), "clock", "Clock");
gtk_window_set_screen (GTK_WINDOW (about),
gtk_widget_get_screen (cd->applet));
if (pixbuf) {
gtk_window_set_icon (GTK_WINDOW (about), pixbuf);
......
......@@ -28,6 +28,8 @@
#include "remote-helper.h"
#include "mailcheck.h"
#include "multihead-hacks.h"
typedef enum {
MAILBOX_LOCAL,
MAILBOX_LOCALDIR,
......@@ -161,7 +163,8 @@ static void set_atk_relation (GtkWidget *label, GtkWidget *entry, AtkRelationTyp
#define WANT_BITMAPS(x) (x == REPORT_MAIL_USE_ANIMATION || x == REPORT_MAIL_USE_BITMAP)
static void
mailcheck_execute_shell (const char *command)
mailcheck_execute_shell (MailCheck *mailcheck,
const char *command)
{
GError *error = NULL;
......@@ -182,6 +185,8 @@ mailcheck_execute_shell (const char *command)
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (mailcheck->applet)));
gtk_widget_show (dialog);
......@@ -233,7 +238,7 @@ calc_dir_contents (char *dir)
}
static char *
get_remote_password (void)
get_remote_password (MailCheck *mc)
{
GtkWidget *dialog;
GtkWidget *hbox;
......@@ -270,6 +275,8 @@ get_remote_password (void)
gtk_widget_grab_focus (GTK_WIDGET (entry));
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
response = gtk_dialog_run (GTK_DIALOG (dialog));
......@@ -362,7 +369,7 @@ check_mail_file_status (MailCheck *mc)
gtk_timeout_remove(mc->mail_timeout);
mc->mail_timeout = 0;
}
mc->real_password = get_remote_password();
mc->real_password = get_remote_password(mc);
mc->mail_timeout = gtk_timeout_add(mc->update_freq,
mail_check_timeout,
mc);
......@@ -531,7 +538,7 @@ after_mail_check (MailCheck *mc)
if (mc->newmail_enabled &&
mc->newmail_cmd &&
(strlen(mc->newmail_cmd) > 0))
mailcheck_execute_shell (mc->newmail_cmd);
mailcheck_execute_shell (mc, mc->newmail_cmd);
}
switch (mc->report_mail_mode) {
......@@ -601,7 +608,7 @@ mail_check_timeout (gpointer data)
mc->mail_timeout = 0;
}
mailcheck_execute_shell (mc->pre_check_cmd);
mailcheck_execute_shell (mc, mc->pre_check_cmd);
mc->mail_timeout = gtk_timeout_add(mc->update_freq, mail_check_timeout, mc);
}
......@@ -641,7 +648,7 @@ exec_clicked_cmd (GtkWidget *widget, GdkEventButton *event, gpointer data)
if (event->button == 1) {
if (mc->clicked_enabled && mc->clicked_cmd && (strlen(mc->clicked_cmd) > 0))
mailcheck_execute_shell (mc->clicked_cmd);
mailcheck_execute_shell (mc, mc->clicked_cmd);
if (mc->reset_on_clicked) {
mc->newmail = mc->unreadmail = 0;
......@@ -1554,7 +1561,7 @@ mailcheck_properties_page (MailCheck *mc)
}
static void
phelp_cb (GtkDialog *w, gint tab, gpointer data)
phelp_cb (GtkDialog *w, gint tab, MailCheck *mc)
{
GError *error = NULL;
static GnomeProgram *applet_program = NULL;
......@@ -1583,37 +1590,37 @@ phelp_cb (GtkDialog *w, gint tab, gpointer data)
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
gtk_widget_show (dialog);
g_error_free (error);
}
}
static void
response_cb (GtkDialog *dialog, gint id, gpointer data)
response_cb (GtkDialog *dialog, gint id, MailCheck *mc)
{
MailCheck *mc = data;
if(id == GTK_RESPONSE_HELP)
{
phelp_cb (dialog,id,data);
if (id == GTK_RESPONSE_HELP) {
phelp_cb (dialog, id, mc);
return;
}
gtk_widget_destroy (GTK_WIDGET (dialog));
mc->property_window = NULL;
}
static void
mailcheck_properties (BonoboUIComponent *uic, gpointer data, const gchar *verbname)
mailcheck_properties (BonoboUIComponent *uic, MailCheck *mc, const gchar *verbname)
{
GtkWidget *p;
GtkWidget *notebook;
MailCheck *mc = data;
if (mc->property_window != NULL) {
if (mc->property_window) {
gtk_window_set_screen (GTK_WINDOW (mc->property_window),
gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
gtk_window_present (GTK_WINDOW (mc->property_window));
return; /* Only one instance of the properties dialog! */
return;
}
mc->property_window = gtk_dialog_new_with_buttons (_("Inbox Monitor Preferences"),
......@@ -1627,7 +1634,8 @@ mailcheck_properties (BonoboUIComponent *uic, gpointer data, const gchar *verbna
gtk_dialog_set_default_response (GTK_DIALOG (mc->property_window), GTK_RESPONSE_CLOSE);
gnome_window_icon_set_from_file (GTK_WINDOW (mc->property_window),
GNOME_ICONDIR"/gnome-mailcheck.png");
gtk_window_set_screen (GTK_WINDOW (mc->property_window),
gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
notebook = gtk_notebook_new ();
gtk_widget_show (notebook);
......@@ -1688,9 +1696,8 @@ applet_load_prefs(MailCheck *mc)
}
static void