]> www.fi.muni.cz Git - evince.git/blobdiff - cut-n-paste/recent-files/egg-recent-util.c
Do not leak the target window
[evince.git] / cut-n-paste / recent-files / egg-recent-util.c
index 6780cd1ee02dcfd1deeacd16baa4720fd2f7c714..bc15a06e76f92a15f2f82ae9937f528b41259d31 100644 (file)
 #include <math.h>
 #include "egg-recent-util.h"
 
 #include <math.h>
 #include "egg-recent-util.h"
 
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
 #define EGG_RECENT_UTIL_HOSTNAME_SIZE 512
 
 /* ripped out of gedit2 */
 #define EGG_RECENT_UTIL_HOSTNAME_SIZE 512
 
 /* ripped out of gedit2 */
@@ -128,7 +132,14 @@ egg_recent_util_get_unique_id (void)
        guint32 rand;
        int pid;
        
        guint32 rand;
        int pid;
        
+#ifndef G_OS_WIN32
        gethostname (hostname, EGG_RECENT_UTIL_HOSTNAME_SIZE);
        gethostname (hostname, EGG_RECENT_UTIL_HOSTNAME_SIZE);
+#else
+       {
+               DWORD size = EGG_RECENT_UTIL_HOSTNAME_SIZE;
+               GetComputerName (hostname, &size);
+       }
+#endif
        
        time (&the_time);
        rand = g_random_int ();
        
        time (&the_time);
        rand = g_random_int ();