end4-pC icon indicating copy to clipboard operation
end4-pC copied to clipboard

Drag & Drop Widgets absolute positioning breaks on multi-monitor setups with mixed resolutions

Open Kr3db opened this issue 3 months ago • 1 comments

Describe the bug: When using a multi-monitor setup with different resolutions (e.g., 2560x1440 and 1920x1080), the drag-and-drop widget positioning breaks. Moving a widget on the 1440p monitor saves absolute coordinates to the config. When the 1080p monitor reads these coordinates, the widget is rendered completely off-center or off-screen, as both monitors share the same x and y variables in config.json.

To Reproduce:

  1. Use a multi-monitor setup with mixed resolutions (e.g. DP-1 at 1080p, DP-3 at 1440p).
  2. Ensure widget placement strategy is set to "free" (Drag & Drop).
  3. Drag a widget on the larger monitor to a specific spot (e.g., the center).
  4. Look at the smaller monitor. The widget is pushed far to the bottom right.

The Root Cause: In modules/ii/background/widgets/AbstractBackgroundWidget.qml, the configEntry.x and configEntry.y values are saved as absolute pixels. Because there is only one shared value per widget in the config, a coordinate that looks perfectly centered on a 1440p screen (e.g., x=1200) will push the widget almost entirely off a 1080p screen.

Proposed Solution: The widget positions need to be saved independently per monitor (or monitor resolution). For example, saving coordinates dynamically based on the current screen's width (e.g., x_2560 vs x_1920) or converting the drag coordinates to a resolution-independent percentage (0.0 to 1.0) before saving them to the config.

Kr3db avatar Aug 23 '26 23:08 Kr3db

Disable the widgets on one of your monitors; that way, you save RAM and don't have to deal with that. I'll look into how to fix it later.

pctrade avatar Aug 23 '26 23:08 pctrade