Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Windowing system #5

Open
Gaspard-- opened this issue May 17, 2018 · 4 comments
Open

Windowing system #5

Gaspard-- opened this issue May 17, 2018 · 4 comments
Assignees
Labels
Planning Issues where we discuss how to move forwards

Comments

@Gaspard--
Copy link
Member

Gaspard-- commented May 17, 2018

I'll edit the OP as we refine our ideas.

Proposal on how windows are structured:

Use a tree:

Build a tree, each window can have children, windows have a position, and are ordered according to a fictional z (which isn't stored).
Child windows have a relative positioning to their parent (This allows to have sub windows such as toolboxes etc.).
Every node can potentially display something (not only leaves). This will help with debugging and having a more unified data structure will avoid branching and alignment problems.
Ex: [A [a1 [a11, a12], a2], B [b1, b2]]
Workspaces are just top-level nodes.

Code structure:

Have a dynamic array of memory, windows are identified by indices into this memory.
We could probably limit the number of windows to 1024 (10 bits) and use the 6 remaining alignment bits for a mask. Let's use the full 16 bits, just in case.
Rendering would be a top down traversal: windows with the biggest z must be painted first. Therefor we should order the tree by z to ease traversal.
Identifying in which window the mouse is may prove hard.

Possible optimisations:

  • Each node has a bounding box (allows quick pruning of branches while descending tree)
  • Have a 2d array which repertories what windows where drawn in an n * n square (may be costly).
  • While drawing, keep track of who drew last on the mouse.

Other things:

  • Windows could have a filtering system: a node which shows only what's in a certain area for children. Should this be the default behaviour? This allows quite a few assumptions about bounding boxes etc.
  • Pinning, the thing that people wanted
  • Windows which display another part of the screen

Goals for this Sunday:

  • Display windows side by side as they are asked.
@Gaspard--
Copy link
Member Author

@raven-os/feathers I'd like your reactions, suggestions and ideas.
Does this seem ok for mouse and key handling @TheSheepKing @riamon-v ?

@Gaspard-- Gaspard-- added the Planning Issues where we discuss how to move forwards label May 17, 2018
@Arignir
Copy link

Arignir commented May 17, 2018

This seems fine to me. Afaik, i3 works like that or something similar.

Limitation to 1024 subwindows is an issue tho, especially if you consider window's content to be subwindows (like toolboxes). You may reach this limit.

@Gaspard--
Copy link
Member Author

Yeah true, editing.

@Gaspard--
Copy link
Member Author

In progress, see branch https://github.com/raven-os/feathers/tree/window_graph

@Gaspard-- Gaspard-- self-assigned this Jun 16, 2018
@Gaspard-- Gaspard-- mentioned this issue Jun 23, 2018
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Planning Issues where we discuss how to move forwards
Projects
None yet
Development

No branches or pull requests

2 participants