-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround software rendering issues in GTK4
Apply custom CSS to workaround software rendering issues: - black frames around popup menus - spinner monopolizing the whole "idle loop", preventing actual work to be done (for example in nautilus) This is heavily based on work by @sityvb and @noskb. The spinner disabler is done in two parts: - animation-play-state disables actual spinning (this part frees up the idle loop) - opacity hides the now frozen spinner to avoid confusion (at least a bit); it could be 'display: none', but that (at least in nautilus) is programatically overridden The patch is applied on user login and flag file is created to not reapply it needlessly. Fixes QubesOS/qubes-issues#8081 Fixes QubesOS/qubes-issues#7921 Fixes QubesOS/qubes-issues#8115 (cherry picked from commit 3a44e04)
- Loading branch information
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
appvm-scripts/etc/xdgautostart/qubes-gtk4-workarounds.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Desktop Entry] | ||
Version=1.0 | ||
Encoding=UTF-8 | ||
Name=Apply Qubes GTK4 workarounds | ||
Exec=/usr/lib/qubes/gtk4-workarounds.sh | ||
Terminal=false | ||
Type=Application | ||
OnlyShowIn=X-QUBES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
# when changing, bump the CSS_VERSION below to force updating user config | ||
CSS='/* QUBES BEGIN */ | ||
/* Do not modify text until end marker, it will get overriden on update */ | ||
/* See https://github.com/QubesOS/qubes-issues/issues/8081#issuecomment-1473412028 */ | ||
.solid-csd popover > contents, .solid-csd .hover-assistant, .solid-csd .completion { | ||
box-shadow: none; | ||
border-radius: 0px; | ||
margin: 0px; | ||
} | ||
popover > contents { | ||
border-style: none; | ||
} | ||
popover > arrow { | ||
border-style: none; | ||
} | ||
popover { | ||
background-color: @view_bg_color; | ||
} | ||
/* performance improvement with software rendering */ | ||
window { | ||
box-shadow: none; | ||
padding: 0px; | ||
} | ||
/* | ||
* Spinner monopolize the whole idle loop, see | ||
* https://github.com/QubesOS/qubes-issues/issues/7921 | ||
*/ | ||
spinner { | ||
animation-play-state: paused; | ||
opacity: 0; | ||
} | ||
/* QUBES END */' | ||
|
||
CSS_PATH="$HOME/.config/gtk-4.0/gtk.css" | ||
CSS_VERSION=1 | ||
CSS_FLAG_FILE="$HOME/.config/gtk-4.0/qubes-patched" | ||
|
||
if [ -r "$CSS_FLAG_FILE" ] && [ "$(<"$CSS_FLAG_FILE")" -eq "$CSS_VERSION" ]; then | ||
# already patched | ||
exit 0 | ||
fi | ||
|
||
|
||
if [ ! -e "$CSS_PATH" ] || ! grep -q "QUBES BEGIN" "$CSS_PATH"; then | ||
mkdir -p "${CSS_PATH%/*}" | ||
echo "$CSS" >> "$CSS_PATH" | ||
else | ||
echo "$CSS" | sed -i -e "/QUBES BEGIN/,/QUBES END/{r /dev/stdin" -e "; d }" "$CSS_PATH" | ||
fi | ||
echo "$CSS_VERSION" > "$CSS_FLAG_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters