losttech / Stack

Public Bug/Feature tracker for Stack window manager
3 stars 0 forks source link

Feature request: window groups #3

Open lolmaus opened 6 years ago

lolmaus commented 6 years ago

Disclaimers

Review of existing solutions

Before I proceed, let's review all tiling options available.

Problem definition

Consider this use case:

  1. I'm working with a maximized browser.

  2. I need to work with two notepad windows: assemble some text in notepad 2 by copying fragments of text from notepad 1.

  3. Naturally, I tile the two notepads, so that each uses 50% of available space.

  4. I need to look up something on the web, so I switch to the browser.

  5. I want to go back to working with the two notepads.

    BAM! 💥 There is no simple way to bring back both notepads at once!

  6. I switch to one of the notepads, either with Alt+Tab of via taskbar. The notepad appears on top of the browser, half of the browser being still visible -- and useless.

  7. I now have to find the other notepad by hand and bring it up manually. This is a PITA, especially when there are multiple notepads opened and I need only one.

This may seem as a minor issue. It is minor indeed, but it's still a huge nuisance. Note that this issue happens dozens of time per day, each day, to almost every computer user.

It's also not limited to notepads, of course. This use case is very wide, involving numerous situations and apps in countless combinations.

Assumptions

The idea

A possible implementation

  1. Each window is either grouped (belongs to a group) or non-grouped (standalone).
  2. Each group can have its own layout. Layouts are composed of tiles (window slots). Tiles can't overlap and there can be no empty space between tiles.
  3. When you focus on a grouped window, all windows in the same group are automatically brought to front.
  4. You should be able to adjust a layout (resize tiles of the layout) by resizing a grouped window.
    1. When you resize a window that belongs to group by dragging its border that is adjacent to another window in the same group, then the other window must resize as well. This prevents overlaps and holes in layouts.
  5. Each window should have a Group button in its taskbar. By the look of the button, you should be able to tell whether a given window is standalone or grouped.
  6. When you click the Group button on a window, a dialog appears: mockup

    In the dialog:

    1. Existing groups are presented visually, you can see their layouts and which app occupy which tiles.
    2. On the side, there is a list of standalone windows.
    3. The current window (the one that owns the Group button that you clicked to present the dialog) is highlighted.
    4. You can move a window into a tile via drag-and-drop.
    5. You can drop a window into an empty tile.
    6. You can drop a window into an occupied tile. This will swap the two tiles.
    7. You can drop a window into an occupied tile. This will replace one tile with the other, the other tile being made standalone. While dragging, a hint about the modifier should be visible.
    8. You can drag a window out of a tile and into the list of standalone tiles. This will make the window standalone.
    9. When you hover over a group, group control buttons appear: Change Layout and Remove.
    10. Change Layout button:
      1. Clicking on the Change Layout button will bring up a list of available layouts.
      2. Layouts are simple, non-overlapping. Complex overlapping layouts aren't needed here because multiple non-overlapping layouts are displayed.
      3. Clicking a layout in the list changes the group's layout.
      4. It also lets you change the number of tiles in the group. If the number of tiles is decreased, excessive windows in the group become standalone.
    11. Remove button: It removes the groups, all its windows become standalone.
    12. There should be a Create Group button in the dialog. It presents a list of layouts (same as in Change Layout), letting you create a new group.
      1. After you create a group, you can drag some windows into it.
    13. When the dialog is closed (either with an X button or by clicking outside), all empty groups are destroyed.
  7. Under the hood, layouts are composed of regions. Regions can be horizontal or vertical. Each region can contain tiles and/or other regions.
    1. For example, a simple 2x2 layout does not have simply have four tiles. It has two regions (either two horizontal or two vertical), and each region has two tiles.
    2. This approach simplifies the layout adjustment implementation.
  8. There should be a GUI layout editor.

Potential integration with Stack WM

Slack could treat groups as individual windows: when you put a grouped window into a Stack tile, the whole group goes into the tile, maintaining the group layout.

Final thoughts

I believe, this feature idea has huge commercial potential. It solves a problem that affects the absolute majority of users, even though most users don't realize it yet.

lostmsu commented 6 years ago

@lolmaus seems like a good idea in principle. I would definitely split it into subfeatures.

  1. Grouping into a single rectangular layout would not work well with multiple monitors, so a more general approach to moving as a group should be used. For example, dragging a (sub-)group button, or an entire tabs container.

  2. It be interesting on its own to start with tying multiple windows logically into a group, that is brought to front when any of them is (though I'd make it configurable).

  3. Grouping windows via a dialog is not very convenient. Perhaps it could be drag & drop with a modifier key, or, as you suggested, dragging a special window button.

  4. There should be convenient way to restart the whole group.

Not directly related: most windows today draw their own title, so adding a button to it no longer seems feasible. I can envision some kind of overlay though.

Another major question is - how many real-world scenarios can be covered with existing features.

For example, your browser + Excel/Calc scenario would behave almost like what you described, if Stack would have a zone container, which, unlike UniformGrid would let you dynamically redistribute space inside it with sizing grips. Then you could take, say, OOB Horizontal, add a zone or two into its middle part with this theoretical container, and viola, you'd be able to put a browser into main, your Calc and Excel into one of these zones (and distribute space between them however you like), and switch between browser (any way) and Calc+Excel (a window tab using ZoneElement).

Don't describe how a window manager should do what you want. A better discussion can sprawl from a description of what and why you want to happen to your windows. For example, it is unclear from your scenario, why do you want to be able to make groups out of random windows, and why do you want them to coexist on one virtual desktop with each other and other groups. Ideally, everyone should list their own specific scenario, and its current annoyances. That way one does not have to make assumptions about what others might want.