mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-04-02 10:40:18 +00:00
Compare commits
8 Commits
tab_close_
...
windows-ta
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c8c33db47 | |||
| 51e9ac15df | |||
|
|
4df579e0d3 | ||
| 2cf69d2e67 | |||
|
|
64bffd0dc8 | ||
|
|
b451240dfd | ||
| 41cc1f617f | |||
| ed671eac25 |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 12 KiB |
@@ -1308,17 +1308,38 @@ maybe_escape_uri (const char *uri)
|
||||
return g_strdup (uri);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static gchar **
|
||||
fe_open_url_env_sanitized (void)
|
||||
{
|
||||
gchar **env = g_get_environ ();
|
||||
const char *vars[] = {"LD_LIBRARY_PATH", "LD_PRELOAD", "APPDIR", "APPIMAGE", "ARGV0", NULL};
|
||||
int i;
|
||||
|
||||
for (i = 0; vars[i]; i++)
|
||||
{
|
||||
gchar **tmp_env = env;
|
||||
env = g_environ_unsetenv (tmp_env, vars[i]);
|
||||
if (env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
}
|
||||
|
||||
return env;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fe_open_url_inner (const char *url)
|
||||
{
|
||||
GError *error = NULL;
|
||||
char *escaped_url = maybe_escape_uri (url);
|
||||
gboolean opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
gboolean opened = FALSE;
|
||||
|
||||
#ifdef WIN32
|
||||
opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
if (!opened)
|
||||
{
|
||||
g_clear_error (&error);
|
||||
#ifdef WIN32
|
||||
gunichar2 *url_utf16 = g_utf8_to_utf16 (escaped_url, -1, NULL, NULL, NULL);
|
||||
|
||||
if (url_utf16 != NULL)
|
||||
@@ -1326,22 +1347,11 @@ fe_open_url_inner (const char *url)
|
||||
opened = ((INT_PTR) ShellExecuteW (0, L"open", url_utf16, NULL, NULL, SW_SHOWNORMAL)) > 32;
|
||||
g_free (url_utf16);
|
||||
}
|
||||
#else
|
||||
gchar *xdg_open_argv[] = {(gchar *) "xdg-open", escaped_url, NULL};
|
||||
gchar **spawn_env = NULL;
|
||||
|
||||
spawn_env = g_get_environ ();
|
||||
{
|
||||
gchar **tmp_env = spawn_env;
|
||||
spawn_env = g_environ_unsetenv (tmp_env, "LD_LIBRARY_PATH");
|
||||
if (spawn_env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
|
||||
tmp_env = spawn_env;
|
||||
spawn_env = g_environ_unsetenv (tmp_env, "LD_PRELOAD");
|
||||
if (spawn_env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
}
|
||||
#else
|
||||
{
|
||||
gchar *xdg_open_argv[] = {(gchar *) "xdg-open", escaped_url, NULL};
|
||||
gchar **spawn_env = fe_open_url_env_sanitized ();
|
||||
|
||||
if (g_spawn_async (NULL, xdg_open_argv, spawn_env,
|
||||
G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
|
||||
@@ -1354,6 +1364,16 @@ fe_open_url_inner (const char *url)
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
g_strfreev (spawn_env);
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
if (!opened)
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
if (!opened && gtk_show_uri_on_window (NULL, escaped_url, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
opened = TRUE;
|
||||
@@ -1362,10 +1382,7 @@ fe_open_url_inner (const char *url)
|
||||
{
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
g_strfreev (spawn_env);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
|
||||
@@ -4431,7 +4431,7 @@ mg_create_topwindow (session *sess)
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
parent_win = gtk_widget_get_window (win);
|
||||
gdk_window_add_filter (parent_win, mg_win32_filter, NULL);
|
||||
gdk_window_add_filter (parent_win, mg_win32_filter, win);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4464,6 +4464,8 @@ static GdkFilterReturn
|
||||
mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
{
|
||||
MSG *msg = (MSG*)xevent;
|
||||
GtkWidget *win = GTK_IS_WIDGET (data) ? GTK_WIDGET (data) : NULL;
|
||||
static gboolean handling_syscommand = FALSE;
|
||||
|
||||
if (!msg)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
@@ -4480,6 +4482,30 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
if (msg->message == WM_SYSCOMMAND && win && !handling_syscommand)
|
||||
{
|
||||
const UINT command = ((UINT) msg->wParam) & 0xFFF0u;
|
||||
|
||||
if (command == SC_MINIMIZE || command == SC_RESTORE)
|
||||
{
|
||||
handling_syscommand = TRUE;
|
||||
|
||||
if (command == SC_MINIMIZE)
|
||||
{
|
||||
ShowWindow (msg->hwnd, SW_MINIMIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (msg->hwnd, SW_RESTORE);
|
||||
ShowWindow (msg->hwnd, SW_SHOW);
|
||||
SetForegroundWindow (msg->hwnd);
|
||||
}
|
||||
|
||||
handling_syscommand = FALSE;
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
}
|
||||
|
||||
if (msg->message == WM_COPYDATA)
|
||||
{
|
||||
COPYDATASTRUCT *copy_data = (COPYDATASTRUCT *)msg->lParam;
|
||||
@@ -4609,7 +4635,7 @@ mg_create_tabwindow (session *sess)
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
parent_win = gtk_widget_get_window (win);
|
||||
gdk_window_add_filter (parent_win, mg_win32_filter, NULL);
|
||||
gdk_window_add_filter (parent_win, mg_win32_filter, win);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disable
|
||||
Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\perl"; Description: "Perl (requires Perl 5.42)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\python"; Description: "Python (requires Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "themes"; Description: "GTK3 Themes"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "themes\windows10"; Description: "Windows 10"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "themes\windows10dark"; Description: "Windows 10 Dark"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "deps"; Description: "Dependencies"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "deps\vcredist2015"; Description: "Visual C++ Redistributable 2015"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
|
||||
@@ -88,6 +91,11 @@ Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl
|
||||
Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\spelling-dicts.exe"; Parameters: "/verysilent"; StatusMsg: "Installing Spelling Dictionaries"; Components: spell; Flags: skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -Command ""Expand-Archive -LiteralPath '{tmp}\Windows-10-3.2.1.zip' -DestinationPath '{userappdata}\ZoiteChat\gtk3-themes' -Force"""; StatusMsg: "Installing GTK3 Theme: Windows 10"; Components: themes\windows10; Flags: runhidden waituntilterminated skipifdoesntexist
|
||||
Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -Command ""Expand-Archive -LiteralPath '{tmp}\Windows-10-Dark-3.2.1-dark.zip' -DestinationPath '{userappdata}\ZoiteChat\gtk3-themes' -Force"""; StatusMsg: "Installing GTK3 Theme: Windows 10 Dark"; Components: themes\windows10dark; Flags: runhidden waituntilterminated skipifdoesntexist
|
||||
|
||||
[Dirs]
|
||||
Name: "{userappdata}\ZoiteChat\gtk3-themes"; Components: themes
|
||||
|
||||
[Files]
|
||||
Source: "portable-mode"; DestDir: "{app}"; Tasks: portable
|
||||
@@ -196,6 +204,10 @@ Name: "{commonappdata}\Microsoft\Internet Explorer\Quick Launch\ZoiteChat"; File
|
||||
[Messages]
|
||||
BeveledLabel= {#APPNAM}
|
||||
|
||||
[UninstallDelete]
|
||||
Type: filesandordirs; Name: "{userappdata}\ZoiteChat\gtk3-themes\Windows-10-3.2.1"; Components: themes\windows10
|
||||
Type: filesandordirs; Name: "{userappdata}\ZoiteChat\gtk3-themes\Windows-10-Dark-3.2.1-dark"; Components: themes\windows10dark
|
||||
|
||||
[Code]
|
||||
#ifndef USE_INNO_DOWNLOAD_PLUGIN
|
||||
var
|
||||
@@ -336,6 +348,12 @@ begin
|
||||
begin
|
||||
idpClearFiles;
|
||||
|
||||
if IsComponentSelected('themes\windows10') then
|
||||
idpAddFile('https://dl.zoitechat.zoite.net/themes/GTK3Themes/Windows-10-3.2.1.zip', ExpandConstant('{tmp}\Windows-10-3.2.1.zip'));
|
||||
|
||||
if IsComponentSelected('themes\windows10dark') then
|
||||
idpAddFile('https://dl.zoitechat.zoite.net/themes/GTK3Themes/Windows-10-Dark-3.2.1-dark.zip', ExpandConstant('{tmp}\Windows-10-Dark-3.2.1-dark.zip'));
|
||||
|
||||
if not IsTaskSelected('portable') then
|
||||
begin
|
||||
|
||||
@@ -389,6 +407,21 @@ begin
|
||||
end;
|
||||
|
||||
if CurPageID = wpReady then
|
||||
begin
|
||||
if IsComponentSelected('themes\windows10') and not FileExists(ExpandConstant('{tmp}\Windows-10-3.2.1.zip')) then
|
||||
begin
|
||||
MsgBox('Windows 10 GTK3 theme could not be downloaded. Please retry setup and rerun setup.', mbError, MB_OK);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if IsComponentSelected('themes\windows10dark') and not FileExists(ExpandConstant('{tmp}\Windows-10-Dark-3.2.1-dark.zip')) then
|
||||
begin
|
||||
MsgBox('Windows 10 Dark GTK3 theme could not be downloaded. Please retry setup and rerun setup.', mbError, MB_OK);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if IsComponentSelected('deps\vcredist2015') and not CheckVCInstall() and not FileExists(ExpandConstant('{tmp}\vcredist.exe')) then
|
||||
begin
|
||||
MsgBox('Visual C++ Redistributable could not be downloaded. Please retry setup or install it manually and rerun setup.', mbError, MB_OK);
|
||||
@@ -396,6 +429,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// these are required for x86->x64 or reverse upgrades
|
||||
|
||||
Reference in New Issue
Block a user