mirror of
https://github.com/moparisthebest/FireTray
synced 2024-12-22 22:08:49 -05:00
detect inexisting file in setIconImage()
This commit is contained in:
parent
c2203c063f
commit
771d6df3b3
@ -37,7 +37,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "gdk", "glib" ];
|
||||
var EXPORTED_SYMBOLS = [ "gdk" ];
|
||||
|
||||
const GDK_LIBNAME = "gdk-x11-2.0";
|
||||
const GDK_ABIS = [ 0 ];
|
||||
|
@ -111,9 +111,12 @@ firetray.Handler.setIconImage = function(filename) {
|
||||
return false;
|
||||
LOG(filename);
|
||||
|
||||
let pixbuf = gdk.gdk_pixbuf_new_from_file(filename, null);
|
||||
if (strEquals(pixbuf, gdk.GdkPixbuf.ptr(null)))
|
||||
return false;
|
||||
|
||||
try {
|
||||
gtk.gtk_status_icon_set_from_file(firetray.StatusIcon.trayIcon,
|
||||
filename);
|
||||
gtk.gtk_status_icon_set_from_pixbuf(firetray.StatusIcon.trayIcon, pixbuf);
|
||||
} catch (x) {
|
||||
ERROR(x);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user