mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
*CtrlLib: TrayIcon X11 fix (thanks andrei_natanael)
git-svn-id: svn://ultimatepp.org/upp/trunk@2385 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2aecff7a7a
commit
6786581a8a
1 changed files with 14 additions and 6 deletions
|
|
@ -96,21 +96,29 @@ void TrayIcon::Message(int type, const char *title, const char *text, int timeou
|
|||
}
|
||||
UntrapX11Errors(x11trap);
|
||||
#else
|
||||
if (!notify_init(title))
|
||||
return;
|
||||
NotifyNotification* notification;
|
||||
GError* error = NULL;
|
||||
if (!notify_is_initted()) {
|
||||
if (!notify_init(title)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
GError *error = NULL;
|
||||
|
||||
notification = notify_notification_new (title, text
|
||||
NotifyNotification *notification = notify_notification_new (title, text
|
||||
, type == 1 ? "gtk-dialog-info"
|
||||
: type == 2 ? "gtk-dialog-warning"
|
||||
: "gtk-dialog-error", NULL);
|
||||
notify_notification_set_timeout(notification, timeout * 1000);
|
||||
notify_notification_show (notification, &error);
|
||||
notify_uninit ();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(flagNOGTK)
|
||||
EXITBLOCK {
|
||||
if (notify_is_initted())
|
||||
notify_uninit ();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool TrayIcon::HookProc(XEvent *event)
|
||||
{
|
||||
XAnyEvent *e = (XAnyEvent *)event;
|
||||
|
|
|
|||
Loading…
Reference in a new issue