Skip to content

layoutPicker: Optionally offer the user's layouts - #478

Open
OK1BR wants to merge 1 commit into
ubuntu:mainfrom
OK1BR:layout-picker-custom-layouts
Open

OK1BR wants to merge 1 commit into
ubuntu:mainfrom
OK1BR:layout-picker-custom-layouts

Conversation

@OK1BR

@OK1BR OK1BR commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

The Layout Picker (#452) offers halves, quarters and maximize. On wide screens (e.g. 32:9), thirds, sixths or other splits are more useful. Those can already be defined as layouts, but with the mouse only one of them per monitor is reachable, via the Favorite Layout move mode (as suggested in #94, #211 and #396).

This adds a "Show Layouts" setting to the Layout Picker group. It is off by default, so nothing changes for existing users. When enabled, every valid layout without dynamic (looping) items is drawn as an additional icon in the picker, in the style of the existing tile icons. Hovering one of its tiles highlights it and opens the tile preview; dropping the window tiles it to that rect.

Details:

  • The rects are scaled to the work area by the same code as the favorite layout (moved to Util.getLayoutRects()), so gaps behave the same.
  • The layouts file may be edited by hand, so invalid layouts (malformed items, rects outside of the screen or overlapping each other) are skipped instead of breaking the window move. The checks mirror Layout.validate(), but tolerate floating point rounding errors, e.g. of columns created with i / 5.
  • The picker doesn't get more icons than fit on the screen.
  • The icons are drawn with Cairo in the theme's foreground color, so they follow the shell theme.

This is based on #477 because without it no layouts are loaded with current gjs/GLib. Only the last commit belongs to this PR.

Tested on Arch Linux, GNOME Shell 50.5 (Wayland): picking tiles on a 5120×1440 (32:9) monitor, and tiling into them in a nested devkit session (1280×800) with 20 layouts including a malformed one. ESLint and codespell are clean.

🤖 Generated with Claude Code

The Layout Picker only offers halves, quarters and maximize. On wide
screens (e.g. 32:9) users want thirds, sixths or any other split, which
they can already define as layouts, but they can only use one of them
per monitor with the favorite layout move mode.

Add a 'Show Layouts' setting (off by default). When enabled, every
valid layout without dynamic (looping) items is drawn as an additional
icon in the picker, in the style of the existing tile icons. Hovering
one of its tiles previews it and dropping the window tiles it to that
rect, which is scaled to the work area the same way as for the favorite
layout (the code for that is moved to Util.getLayoutRects()).

The layouts file may be edited by hand, so invalid layouts are skipped
instead of breaking the window move, and the picker doesn't get more
icons than fit on the screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OK1BR
OK1BR force-pushed the layout-picker-custom-layouts branch from 2775429 to 7283d7f Compare October 9, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant