aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-02-13 08:09:40 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-02-13 08:09:40 +0000
commitdef6dee82e3ddfbaaba95255f08e196575444f58 (patch)
tree77017fe65127eb83dc5211ab39c0afe6c3c4c34f
parent5ce784ecf14a06f6e84f39a3cfd20f4c2292cbc2 (diff)
modified notification window.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3216 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog7
-rw-r--r--src/inc.c2
-rw-r--r--src/notificationwindow.c17
-rw-r--r--src/notificationwindow.h2
4 files changed, 22 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 862fd598..3903144f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-13
+
+ * src/inc.c
+ src/notificationwindow.[ch]: notification_window_open():
+ changed from notification_window_create().
+ Ignore first notify event when fading start.
+
2013-02-08
* libsylph/prefs_common.[ch]
diff --git a/src/inc.c b/src/inc.c
index f90835d0..1fd0cb31 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -250,7 +250,7 @@ static void inc_finished(MainWindow *mainwin, IncResult *result)
}
}
- notification_window_create(buf, str->str, 5);
+ notification_window_open(buf, str->str, 5);
}
g_string_free(str, TRUE);
diff --git a/src/notificationwindow.c b/src/notificationwindow.c
index 7c8b0258..51c7d4ae 100644
--- a/src/notificationwindow.c
+++ b/src/notificationwindow.c
@@ -34,8 +34,8 @@
#include "utils.h"
#define NOTIFICATIONWINDOW_NOTIFY_PERIOD 10000
-#define NOTIFICATIONWINDOW_WIDTH 280
-#define NOTIFICATIONWINDOW_HEIGHT 96
+#define NOTIFICATIONWINDOW_WIDTH 300
+#define NOTIFICATIONWINDOW_HEIGHT 64
#define FADE_REFRESH_RATE 50
#define FADE_SPEED 5
@@ -54,6 +54,7 @@ struct _NotificationWindow
gint height;
gint fade_length;
gint fade_count;
+ gint notify_event_count;
guint timeout;
};
@@ -95,8 +96,8 @@ static void get_work_area(GdkRectangle *rect)
#endif
}
-gint notification_window_create(const gchar *message, const gchar *submessage,
- guint timeout)
+gint notification_window_open(const gchar *message, const gchar *submessage,
+ guint timeout)
{
GtkWidget *window;
GtkWidget *vbox;
@@ -172,6 +173,7 @@ gint notification_window_create(const gchar *message, const gchar *submessage,
notify_window.y = y;
notify_window.fade_length = 0;
notify_window.fade_count = 0;
+ notify_window.notify_event_count = 0;
notify_window.timeout = timeout;
return 0;
@@ -258,11 +260,18 @@ static gboolean nwin_entered(GtkWidget *widget, GdkEventCrossing *event,
static gboolean nwin_motion_notify(GtkWidget *widget, GdkEventMotion *event,
gpointer data)
{
+ if (notify_window.fade_count > 0 &&
+ notify_window.notify_event_count == 0) {
+ notify_window.notify_event_count++;
+ return FALSE;
+ }
+
if (notify_window.notify_tag > 0) {
g_source_remove(notify_window.notify_tag);
notify_window.notify_tag = 0;
}
notify_window.fade_count = 0;
+ notify_window.notify_event_count = 0;
gtk_window_move(GTK_WINDOW(notify_window.window),
notify_window.x, notify_window.y);
notify_window.notify_tag = g_timeout_add(notify_window.timeout * 1000,
diff --git a/src/notificationwindow.h b/src/notificationwindow.h
index d724af27..c2c2c53d 100644
--- a/src/notificationwindow.h
+++ b/src/notificationwindow.h
@@ -25,7 +25,7 @@
typedef struct _NotificationWindow NotificationWindow;
-gint notification_window_create (const gchar *message,
+gint notification_window_open (const gchar *message,
const gchar *submessage,
guint timeout);
void notification_window_set_message (const gchar *message,