Repository navigation
Closed
Labels
Description
I'm not sure which version of Unite I previously had, it was several versions behind but it worked great until recently when Gnome upgrades were applied and Unite v80 was installed/upgraded. This was shown in the Extensions list:

and this was in the system log:
gnome-shell[2585]:
Extension [email protected]:
RangeError: too many function arguments
Stack trace:
getFileContents@file:///home/scar/.local/share/gnome-shell/extensions/[email protected]/handlers.js:54:19
resetGtkStyles/<@file:///home/scar/.local/share/gnome-shell/extensions/[email protected]/handlers.js:72:32
resetGtkStyles@file:///home/scar/.local/share/gnome-shell/extensions/[email protected]/handlers.js:70:16
enable@file:///home/scar/.local/share/gnome-shell/extensions/[email protected]/extension.js:16:14
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:266:38
loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:478:32
async*_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:786:24
async*_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:792:48
_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:827:20
async*init@resource:///org/gnome/shell/ui/extensionSystem.js:76:14
_initializeUI@resource:///org/gnome/shell/ui/main.js:303:22
start@resource:///org/gnome/shell/ui/main.js:175:11
@resource:///org/gnome/shell/ui/init.js:12:47
@resource:///org/gnome/shell/ui/init.js:21:20
To Reproduce
Steps to reproduce the behavior:
- wget https://github.com/hardpixel/unite-shell/releases/download/v80/unite-v80.zip
- gnome-extensions install unite-v80.zip
Environment:
- OS: Debian 12
- GNOME Shell version 46.4
- Unite version 80
I checked [email protected]:54:19 and rewrote that to:
51 │ function getFileContents(path) {
52 │ if (fileExists(path)) {
53 │ const contents = GLib.file_get_contents(path);
**54 │ const decoder = new TextDecoder('utf-8');
++55 │ return decoder.decode(contents[1]);
56 │ } else {
57 │ return '';
58 │ }
59 │ }
Now extension works again for me 🎉
According to experts, TextDecoder is more robust and offers a better approach for converting large buffers or arrays to strings, and is a more memory-efficient way to handle large data. 🤷💫
Activity
jonian commentedon Oct 2, 2024
Thanks for the detailed report @scarlion1! Would you like to make a PR for this?
scarlion1 commentedon Oct 4, 2024
Yeah, sir! I could. I've only done that once before tho 😅 So it will take a bit longer to remember the process and setup my access keys, etc. again. I'm also pretty busy lately with several deadlines for various things looming, so might not get it done immediately. Hopefully this weekend could find time or next weekend at the latest. Do you know why the RangeError happens? what's getFileContents() used for? er, I mean i guess it gets the contents of a file 🙄 but what's Unite looking at? I guess mine is too big? 😛
jonian commentedon Oct 4, 2024
No worries for the PR, I can make the required changes.
The RangeError is because your file is, as you correctly guessed, too big. To remove decorations from CSD applications the extension uses CSS styles. These styles should be included in:
~/.config/gtk-3.0/gtk.cssfor GTK3 apps~/.config/gtk-4.0/gtk.cssfor GTK4 appsWhen enabled, the extension gets the contents of those files, prepends the extension code and re-writes the file.
When disabled, it gets the contents again, removes the extension code and re-writes the file.
This is done so the extension does not delete your GTK theme customization. You can review the code here. Also you can check the
gtk.cssfiles and enable/disable the extension to observe the changes it makes.scarlion1 commentedon Oct 5, 2024
Cool thanks for the pointers! Yeah i did some modifications a while ago to both 3 and 4's gtk.css... with Unite enabled, my gtk-30.css is 526,074 bytes! A huge portion has been converted to unicode showing up in vim like
<U+0083>Ã<U+0083>Â<U+0082>Ã<U+0082>Â<U+0082>Ã<U+0083>Â<U+0083>Ã<U+0082>Â<U+0082>Ã<U+0083>Â<U+0082>Ã<U+0082>Â<U+0083>break, no break, break, no break over and over wtf... let me turn Unite off n see... uhhh now it's 525,895 bytes still let me look at this in Geany.... huh it's all within a comment, let me just delete all this garbage... and there we go back to 1,609 bytes much better idk wtf happened there.Some other quick questions I got lmk you'd rather me put them in separate issues, but is there a way to change the size of the min,max,close buttons? They do not match the size of the indicator icons and it's driving me nuts!

er, well, I would like to size them up until the close button matches the indicators, which are currently set to 25px thru Just Perfection add-on...
and also this seems to cause a sh*t ton of warnings from
mutter-x11-frames, such as:Is that maybe from my gtk.css customizations or what?
Thanks
use TextDecoder in getFileContents helper