]> Eric's Git Repo - ericdock.git/commitdiff
Trying to fix crashes with icons
authorEric Wertz <ericdwertz@gmail.com>
Fri, 17 Nov 2017 14:06:39 +0000 (09:06 -0500)
committerEric Wertz <ericdwertz@gmail.com>
Fri, 17 Nov 2017 14:06:39 +0000 (09:06 -0500)
dock_icon.c
main.c

index c56a71b3f4a5e9419e8481e5ac5d3bc1bcf38241..4e6666e30e2aa20c5269d3e0cb391964f75889df 100644 (file)
@@ -121,12 +121,16 @@ gchar* get_icon_from_desktop( const char* name )
 {
     GKeyFile* key_file = g_key_file_new();
     gchar file[256];
+    gchar* out;
 
     sprintf( file, "/usr/share/applications/%s.desktop", name );
     if( !g_key_file_load_from_file( key_file, file, G_KEY_FILE_NONE, NULL ) )
         return NULL;
 
-    return g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, "Icon", NULL );
+    out = g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, "Icon", NULL );
+    g_key_file_free( key_file );
+
+    return out;
 }
 
 /* Gets the pixbuf from a desktop file's icon name. Based on the same function * from matchbox-desktop
@@ -186,6 +190,7 @@ GdkPixbuf* get_icon( WnckWindow* window, guint size )
         pixbuf = wnck_window_get_icon( window );
         unref = 0;
     }
+
     if (pixbuf == NULL)
     {
         pixbuf = gtk_icon_theme_load_icon(theme, "application-x-executable",
diff --git a/main.c b/main.c
index 8c4009ec2a538acbbacb19e5f7531ac5a7821ed5..bcd57303b5154f0b1cb160d7d94e96ade9643f9b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -109,6 +109,10 @@ GdkFilterReturn handle_x11_event( GdkXEvent *xevent, GdkEvent *event, gpointer d
             {
                 system( "/home/eric/EricOS/ericlock/ericlock" );
             }
+            if( xev->xkey.keycode == 39 )
+            {
+                system( "/home/eric/EricOS/ericsnip/ericsnip" );
+            }
         }
     }
     if( xev->type == KeyRelease )