* src/main.c
If claws-mail is running on another
display, warn instead of popping it up
on the other display
+2007-03-14 [colin] 2.8.1cvs9
+
+ * src/main.c
+ If claws-mail is running on another
+ display, warn instead of popping it up
+ on the other display
+
2007-03-12 [colin] 2.8.1cvs8
* src/wizard.c
2007-03-12 [colin] 2.8.1cvs8
* src/wizard.c
( cvs diff -u -r 1.207.2.150 -r 1.207.2.151 src/folderview.c; cvs diff -u -r 1.204.2.122 -r 1.204.2.123 src/prefs_common.c; cvs diff -u -r 1.103.2.76 -r 1.103.2.77 src/prefs_common.h; cvs diff -u -r 1.1.2.38 -r 1.1.2.39 src/prefs_summaries.c; ) > 2.8.1cvs6.patchset
( cvs diff -u -r 1.395.2.285 -r 1.395.2.286 src/summaryview.c; ) > 2.8.1cvs7.patchset
( cvs diff -u -r 1.1.2.50 -r 1.1.2.51 src/wizard.c; ) > 2.8.1cvs8.patchset
( cvs diff -u -r 1.207.2.150 -r 1.207.2.151 src/folderview.c; cvs diff -u -r 1.204.2.122 -r 1.204.2.123 src/prefs_common.c; cvs diff -u -r 1.103.2.76 -r 1.103.2.77 src/prefs_common.h; cvs diff -u -r 1.1.2.38 -r 1.1.2.39 src/prefs_summaries.c; ) > 2.8.1cvs6.patchset
( cvs diff -u -r 1.395.2.285 -r 1.395.2.286 src/summaryview.c; ) > 2.8.1cvs7.patchset
( cvs diff -u -r 1.1.2.50 -r 1.1.2.51 src/wizard.c; ) > 2.8.1cvs8.patchset
+( cvs diff -u -r 1.115.2.141 -r 1.115.2.142 src/main.c; ) > 2.8.1cvs9.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
static gint lock_socket = -1;
static gint lock_socket_tag = 0;
static gint lock_socket = -1;
static gint lock_socket_tag = 0;
+static gchar *x_display = NULL;
typedef enum
{
ONLINE_MODE_DONT_CHANGE,
typedef enum
{
ONLINE_MODE_DONT_CHANGE,
path = claws_get_socket_name();
uxsock = fd_connect_unix(path);
path = claws_get_socket_name();
uxsock = fd_connect_unix(path);
+
+ if (x_display == NULL)
+ x_display = g_strdup(g_getenv("DISPLAY"));
+
if (uxsock < 0) {
g_unlink(path);
return fd_open_unix(path);
if (uxsock < 0) {
g_unlink(path);
return fd_open_unix(path);
gchar *str = g_strdup_printf("select %s\n", cmd.target);
fd_write_all(uxsock, str, strlen(str));
g_free(str);
gchar *str = g_strdup_printf("select %s\n", cmd.target);
fd_write_all(uxsock, str, strlen(str));
g_free(str);
- } else
- fd_write_all(uxsock, "popup\n", 6);
+ } else {
+ gchar buf[BUFSIZ];
+ fd_write_all(uxsock, "get_display\n", 12);
+ fd_gets(uxsock, buf, sizeof(buf));
+ if (strcmp2(buf, x_display)) {
+ printf("Claws Mail is already running on display %s.\n",
+ buf);
+ } else {
+ fd_close(uxsock);
+ uxsock = fd_connect_unix(path);
+ fd_write_all(uxsock, "popup\n", 6);
+ }
+ }
fd_close(uxsock);
return -1;
fd_close(uxsock);
return -1;
if (!strncmp(buf, "popup", 5)) {
main_window_popup(mainwin);
if (!strncmp(buf, "popup", 5)) {
main_window_popup(mainwin);
+ } else if (!strncmp(buf, "get_display", 11)) {
+ fd_write_all(sock, x_display, strlen(x_display));
} else if (!strncmp(buf, "receive_all", 11)) {
inc_all_account_mail(mainwin, FALSE,
prefs_common.newmail_notify_manu);
} else if (!strncmp(buf, "receive_all", 11)) {
inc_all_account_mail(mainwin, FALSE,
prefs_common.newmail_notify_manu);