The change is simple enough if done carefully. The file is
/usr/share/cinnamon/cinnamon-settings/xlet-settings.py
so it has to be edited as root:sudo xed /usr/share/cinnamon/cinnamon-settings/xlet-settings.py
or use whatever other text editor you prefer. But first of all create a backup copy of the original unmodified file, for safety.
Another thing very important as with any Python script: mind the indentation! A single missing or extra space (or other caracter) can and will screw up the whole thing.
First change is a one-liner, simple; see below where it says Added by...:
Code: Select all
def build_window(self):
self.window = XApp.GtkWindow()
self.window.set_default_size(DEFWW, DEFWH)
main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add(main_box)
toolbar = Gtk.Toolbar()
toolbar.get_style_context().add_class("primary-toolbar")
main_box.add(toolbar)
# Added by Drugwash, 2022.06.04
self.tb = toolbar
# End addition
self.tb
object is required in the second block of added code; couldn't use the toolbar
widget since it isn't declared as global.Second change consists of six lines (the Added by... block) a little higher in the
__init__
method of the MainWindow class:Code: Select all
class MainWindow(object):
def __init__(self, xlet_type, uuid, *instance_id):
[...]
self.window.show_all()
# Added by Drugwash, 2022.06.04
m, n = self.instance_stack.get_preferred_size()
tm, tn = self.tb.get_preferred_size()
wm, wn = self.window.get_preferred_size()
pw = m.width if m.height == n.height else n.width
maxw = max(tn.width, pw)
self.window.resize(maxw, m.height + tn.height + 10) # small hack since global.ui_scale pertains to js not Python
# End addition
if instance_id and len(self.instance_info) > 1:
for info in self.instance_info:
if info["id"] == instance_id:
self.set_instance(info)
break
[...]
Nice thing about these Python scripts is that they run right away, no need to restart Cinnamon or the x-let or whatever.
So now just open the Settings dialogs (right-click > Configure...) for your enabled x-lets and see if the windows are at their minimal size.
If no Settings window opens it means you typed/pasted something wrong so double-check and triple-check the added code.
If it still won't work then don't panic - just restore from the backup and forget about it.
If it works correctly for enough people maybe someone will post this as a pull request at GitHub. I can't work with that thing so don't expect me to do it.