Remove most of HexTray and one instance

You can still build HexTray manually if you want to try fixing it
This commit is contained in:
Berke Viktor
2013-04-02 11:55:54 -07:00
parent 7317535c28
commit 5e59578e28
9 changed files with 7 additions and 181 deletions

View File

@@ -1008,46 +1008,6 @@ hexchat_execv (char * const argv[])
#endif
}
#if 0 /* def WIN32 */
static void
xchat_restore_window (HWND hexchat_window)
{
/* ShowWindow (hexchat_window, SW_RESTORE); another way, but works worse */
SendMessage (hexchat_window, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow (hexchat_window);
}
BOOL CALLBACK
enum_windows_impl (HWND current_window, LPARAM lParam)
{
TCHAR window_name[8];
TCHAR module_path[1024];
ZeroMemory (&window_name, sizeof (window_name));
if (!current_window)
{
return TRUE;
}
GetWindowText (current_window, window_name, 8); /* name length + 1 */
if (strcmp (window_name, "HexChat") == 0)
{
/* use a separate if block, this way we don't have to call GetWindowModuleFileName() for each hit */
ZeroMemory (&module_path, sizeof (module_path));
GetWindowModuleFileName (current_window, module_path, sizeof (module_path));
if (strstr (module_path, "hexchat.exe")) /* We've found it, stop */
{
xchat_restore_window (current_window);
return FALSE;
}
}
return TRUE; /* Keep searching */
}
#endif
int
main (int argc, char *argv[])
{
@@ -1056,7 +1016,6 @@ main (int argc, char *argv[])
#ifdef WIN32
char hexchat_lang[13]; /* LC_ALL= plus 5 chars of hex_gui_lang and trailing \0 */
/* HANDLE mutex; */
#endif
srand (time (0)); /* CL: do this only once! */
@@ -1257,33 +1216,6 @@ main (int argc, char *argv[])
}
putenv (hexchat_lang);
#if 0
if (prefs.hex_gui_single && !portable_mode ())
{
DWORD error;
mutex = CreateMutex (NULL, TRUE, "Local\\hexchat");
error = GetLastError ();
if (error == ERROR_ALREADY_EXISTS || mutex == NULL)
{
/* Restoring the HexChat window from the tray via the taskbar icon.
* Only works correctly when HexTray is used.
*/
if (hextray_mode ())
{
/* FindWindow() doesn't support wildcards so we check all the open windows */
EnumWindows (enum_windows_impl, (LPARAM) NULL);
return 0;
}
else
{
return 1;
}
}
}
#endif
#endif
#ifdef SOCKS
@@ -1323,14 +1255,6 @@ main (int argc, char *argv[])
#ifdef WIN32
WSACleanup ();
#if 0
if (prefs.hex_gui_single && !portable_mode ())
{
ReleaseMutex (mutex);
CloseHandle (mutex);
}
#endif
#endif
return 0;

View File

@@ -471,7 +471,6 @@ plugin_auto_load (session *sess)
for_files (".\\plugins", "hcdoat.dll", plugin_auto_load_cb);
for_files (".\\plugins", "hcexec.dll", plugin_auto_load_cb);
for_files (".\\plugins", "hcfishlim.dll", plugin_auto_load_cb);
/* for_files (".\\plugins", "hchextray.dll", plugin_auto_load_cb); don't load HexTray until it's fixed */
for_files (".\\plugins", "hcmpcinfo.dll", plugin_auto_load_cb);
for_files (".\\plugins", "hcperl.dll", plugin_auto_load_cb);
for_files (".\\plugins", "hcpython.dll", plugin_auto_load_cb);

View File

@@ -1860,23 +1860,6 @@ portable_mode ()
#endif
}
int
hextray_mode ()
{
#ifdef WIN32
if ((_access( "plugins/hchextray.dll", 0 )) != -1)
{
return 1;
}
else
{
return 0;
}
#else
return 0;
#endif
}
int
unity_mode ()
{

View File

@@ -78,7 +78,6 @@ guint32 str_ihash (const unsigned char *key);
void safe_strcpy (char *dest, const char *src, int bytes_left);
void canonalize_key (char *key);
int portable_mode ();
int hextray_mode ();
int unity_mode ();
GSList *get_subdirs (const char *path);
char *encode_sasl_pass (char *user, char *pass);