summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2022-01-21 10:35:09 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2022-01-21 12:53:54 +0000
commit4f17fc41a506aeba6c595ef7ee2e53fbbd4aeeca (patch)
treef164ade20400b515e4f8e50aebafd0935c9c6fa6
parent15d2d27a53a749c064139ef0ad1c2d340f66c4b7 (diff)
downloaddeluge-4f17fc41a506aeba6c595ef7ee2e53fbbd4aeeca.tar.gz
deluge-4f17fc41a506aeba6c595ef7ee2e53fbbd4aeeca.tar.bz2
deluge-4f17fc41a506aeba6c595ef7ee2e53fbbd4aeeca.zip
[Packaging] Disable GTK CSD by default on Windows
CirnoT reported how they felt that GTK3 is not reliable on Windows. Seeing some weird issues where clicking Deluge icon on taskbar does bring window to front but doing so again does not minimize it as one would expect. By using GTK_CSD=0 this would reduce these problems. > If changed to 0, this disables the default use of client-side decorations on GTK windows, thus making the window manager responsible for drawing the decorations of windows that do not have a custom titlebar widget. This can be overridden by a global env var. Ref: https://github.com/deluge-torrent/deluge/pull/331#issuecomment-1012311605 Ref: https://docs.gtk.org/gtk3/running.html
-rw-r--r--packaging/win/delugewin.spec7
-rw-r--r--packaging/win/pyi_rth_gtk_csd.py3
2 files changed, 7 insertions, 3 deletions
diff --git a/packaging/win/delugewin.spec b/packaging/win/delugewin.spec
index fb7ec6895..d6c93d923 100644
--- a/packaging/win/delugewin.spec
+++ b/packaging/win/delugewin.spec
@@ -9,6 +9,7 @@ from PyInstaller.utils.hooks import collect_all, copy_metadata
datas = []
binaries = []
hiddenimports = []
+runtime_hooks_gtk = [os.path.join(SPECPATH, 'pyi_rth_gtk_csd.py')]
# Collect Meta Data
datas += copy_metadata('deluge', recursive=True)
@@ -72,7 +73,7 @@ b = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Sc
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
- runtime_hooks=[],
+ runtime_hooks=runtime_hooks_gtk,
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
@@ -166,7 +167,7 @@ e = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Sc
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
- runtime_hooks=[],
+ runtime_hooks=runtime_hooks_gtk,
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
@@ -197,7 +198,7 @@ f = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Sc
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
- runtime_hooks=[],
+ runtime_hooks=runtime_hooks_gtk,
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
diff --git a/packaging/win/pyi_rth_gtk_csd.py b/packaging/win/pyi_rth_gtk_csd.py
new file mode 100644
index 000000000..345122dd6
--- /dev/null
+++ b/packaging/win/pyi_rth_gtk_csd.py
@@ -0,0 +1,3 @@
+import os
+
+os.environ['GTK_CSD'] = os.getenv('GTK_CSD', '0')