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