Benjamin-Loison / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
0 stars 0 forks source link

`Display` `User interface scale` `200 %` resets on VirtualBox reboot (and login and waiting a bit) #5

Open Benjamin-Loison opened 12 months ago

Benjamin-Loison commented 12 months ago

At least being able to set it back thanks to a command would be nice. However, dconf does not seem to contain any interesting entry (the Super User question 1006983).

xrandr --output Virtual1 --scale 0.5x0.5

provides a pixelized display with modified mouse input sensitivity and make things that worse that I do not know how to start Display such that I can check whether User interface scale is 100 % or 200 %.

gsettings set org.cinnamon.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]"

Source: https://bbs.archlinux.org/viewtopic.php?pid=2051460#p2051460

does not switch to 200 % in Display and does not resize the taskbar.

https://bbs.archlinux.org/viewtopic.php?pid=2051489#p2051489 does the trick and seems legitimate. Minimizing it would be interesting.

Quite simplified Python script: ```python #!/usr/bin/python3 import dbus bus = dbus.SessionBus() DISPLAY_CONFIG_WELL_KNOWN_NAME = 'org.cinnamon.Muffin.DisplayConfig' DISPLAY_CONFIG_OBJECT_PATH = '/' + DISPLAY_CONFIG_WELL_KNOWN_NAME.replace('.', '/') displayConfigProxy = bus.get_object(DISPLAY_CONFIG_WELL_KNOWN_NAME, DISPLAY_CONFIG_OBJECT_PATH) displayConfigInterface = dbus.Interface(displayConfigProxy, dbus_interface = DISPLAY_CONFIG_WELL_KNOWN_NAME) serial, physicalMonitors, logicalMonitors, properties = displayConfigInterface.GetCurrentState() NEW_SCALE = 2.0 x, y, _, transform, primary, _, _ = logicalMonitors[0] for monitorInfo, monitorModes, monitorProperties in physicalMonitors: monitorConnector, _, _, _ = monitorInfo for modeId, _, _, _, _, _, mode_properties in monitorModes: if mode_properties.get('is-current', False): # ( mode_properties provides is-current, is-preferred, is-interlaced, and more) physicalMonitorsConfig = [dbus.Struct([monitorConnector, modeId, {}])] print('Setting scaling of: ' + monitorProperties.get('display-name') + ' to ' + str(NEW_SCALE) + '!') updatedLogicalMonitorStruct = dbus.Struct([dbus.Int32(x), dbus.Int32(y), dbus.Double(NEW_SCALE), dbus.UInt32(transform), dbus.Boolean(primary), physicalMonitorsConfig]) updatedLogicalMonitors = [updatedLogicalMonitorStruct] propertiesToApply = {'layout_mode': properties.get('layout-mode')} METHOD = 1 # 2 means show a prompt before applying settings; 1 means instantly apply settings without prompt displayConfigInterface.ApplyMonitorsConfig(dbus.UInt32(serial), dbus.UInt32(METHOD), updatedLogicalMonitors, propertiesToApply) ```

Tracked at Benjamin_Loison/virtualbox#2.

+44

Distribution

Not read

Package version

Not read

Graphics hardware in use

No response

Frequency

Always

Bug description

For Linux Mint (trust).

Steps to reproduce

Not read

Expected behavior

Not read

Additional information

No response

Benjamin-Loison commented 4 months ago

Maybe can leverage Benjamin_Loison/gdm/issues/10.

ls ~/.config/monitors.xml
ls: cannot access '/home/benjamin/.config/monitors.xml': No such file or directory
./gnome-monitor-config --help
Output: ``` Usage: ./gnome-monitor-config [OPTIONS...] COMMAND [COMMAND OPTIONS...] Options: -h, --help Print help text Commands: list List current monitors and current configuration set Set new configuration show Show monitor labels Options for 'set': -L, --logical-monitor Add logical monitor -x, --x=X Set x position of newly added logical monitor -y, --y=Y Set y position of newly added logical monitor -s, --scale=SCALE Set scale of newly added logical monitor -t, --transform=TRANSFORM Set transform (normal, left, right, flip) -p, --primary Mark the newly added logical monitor as primary -m, --mode Set the display resolution and refresh rate. ex: 1920x1080@60 -M, --monitor=CONNECTOR Add a monitor (given its connector) to newly added logical monitor -p, --primary Mark the newly added logical monitor as primary --logical-layout-mode Set logical layout mode --physical-layout-mode Set physical layout mode ```
./gnome-monitor-config list
Failed to list current configuration: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Mutter.DisplayConfig was not provided by any .service files

Do not have this issue on Debian 12 GNOME Pegasus.

./gnome-monitor-config --scale=2
Usage: ./gnome-monitor-config [OPTIONS...] COMMAND [COMMAND OPTIONS...]
./gnome-monitor-config set --scale=2
Failed to set configuration: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Mutter.DisplayConfig was not provided by any .service files