Revision 3216

View differences:

src/inc.c
250 250
				}
251 251
			}
252 252

  
253
			notification_window_create(buf, str->str, 5);
253
			notification_window_open(buf, str->str, 5);
254 254
		}
255 255

  
256 256
		g_string_free(str, TRUE);
src/notificationwindow.c
34 34
#include "utils.h"
35 35

  
36 36
#define NOTIFICATIONWINDOW_NOTIFY_PERIOD	10000
37
#define NOTIFICATIONWINDOW_WIDTH		280
38
#define NOTIFICATIONWINDOW_HEIGHT		96
37
#define NOTIFICATIONWINDOW_WIDTH		300
38
#define NOTIFICATIONWINDOW_HEIGHT		64
39 39
#define FADE_REFRESH_RATE			50
40 40
#define FADE_SPEED				5
41 41

  
......
54 54
	gint height;
55 55
	gint fade_length;
56 56
	gint fade_count;
57
	gint notify_event_count;
57 58
	guint timeout;
58 59
};
59 60

  
......
95 96
#endif
96 97
}
97 98

  
98
gint notification_window_create(const gchar *message, const gchar *submessage,
99
				guint timeout)
99
gint notification_window_open(const gchar *message, const gchar *submessage,
100
			      guint timeout)
100 101
{
101 102
	GtkWidget *window;
102 103
	GtkWidget *vbox;
......
172 173
	notify_window.y = y;
173 174
	notify_window.fade_length = 0;
174 175
	notify_window.fade_count = 0;
176
	notify_window.notify_event_count = 0;
175 177
	notify_window.timeout = timeout;
176 178

  
177 179
	return 0;
......
258 260
static gboolean nwin_motion_notify(GtkWidget *widget, GdkEventMotion *event,
259 261
				   gpointer data)
260 262
{
263
	if (notify_window.fade_count > 0 &&
264
	    notify_window.notify_event_count == 0) {
265
		notify_window.notify_event_count++;
266
		return FALSE;
267
	}
268

  
261 269
	if (notify_window.notify_tag > 0) {
262 270
		g_source_remove(notify_window.notify_tag);
263 271
		notify_window.notify_tag = 0;
264 272
	}
265 273
	notify_window.fade_count = 0;
274
	notify_window.notify_event_count = 0;
266 275
	gtk_window_move(GTK_WINDOW(notify_window.window),
267 276
			notify_window.x, notify_window.y);
268 277
	notify_window.notify_tag = g_timeout_add(notify_window.timeout * 1000,
src/notificationwindow.h
25 25

  
26 26
typedef struct _NotificationWindow	NotificationWindow;
27 27

  
28
gint notification_window_create		(const gchar		*message,
28
gint notification_window_open		(const gchar		*message,
29 29
					 const gchar		*submessage,
30 30
					 guint			 timeout);
31 31
void notification_window_set_message	(const gchar		*message,
ChangeLog
1
2013-02-13
2

  
3
	* src/inc.c
4
	  src/notificationwindow.[ch]: notification_window_open():
5
	  changed from notification_window_create().
6
	  Ignore first notify event when fading start.
7

  
1 8
2013-02-08
2 9

  
3 10
	* libsylph/prefs_common.[ch]

Also available in: Unified diff