awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.31k stars 596 forks source link

Add some flowcharts to the doc (need review) #2431

Open Elv13 opened 5 years ago

Elv13 commented 5 years ago

Hello,

In an attempt to fix more of #1373 and because I am adding more client and spawn related commits since last week, I think our process are now too complex to be learnt from reading the doc as it stands now. This issue will be a dumping ground for unfinished flowcharts and will eventually result in a pull request when I am happy.

If anyone think more of the steps deserve to be shown, tell us about it and why. My goal here is not to convert the lua code into a flowchart, it is to guide the new users in the maze of extension points. Eventually I will add colors to the extension points and a legend with proper documentation links.

First one, adding a client

screenshot_20181012_153939

Elv13 commented 5 years ago

How is the client placed/screen selected

screenshot_20181012_234934

(assumes that resize_requests_honor feature is added)

psychon commented 5 years ago

First one, adding a client

Here is what the C code does when a new client appears (that is visible from Lua):

  1. Create a new client (signal new)
  2. Add to the global client list (the client now appears in client.get())
  3. Set the screen to whatever screen contains the client's position (property::screen)
  4. Set the geometry and only emit signals after all the geometry was set (property::x, ::y, ::width, ::height, ::window (?), ::geometry, in this order)
  5. Set the border width (property::border_width)
  6. Set size_hints_honor = true (property::size_hints_honor)
  7. Fetch lots of properties (in this order and emitting signals): Struts, size hints (without a signal?!), urgent (via ICCCM), [At this point some part of c.focusable is set,] group_window, icon (from ICCCM), transient_for, leader_window (no signal), client_machine, role, pid, icon (from EWMH), name (from ICCCM), name (from EWMH), icon_name (from ICCCM), icon_name (from EWMH), class, protocols (this is purely internal to the C code), motif wm hints, opacity
  8. transient_for for other clients pointing to this client is updated/set
  9. If the client specifies a tag (_NET_WM_DESKTOP), a state (sticky, skip_taskbar, fullscreen, maximized h/v, above, below, modal, hidden, urgent (via EWMH)), or a window type, this is now fetched and applied (So, clients can actually be tagged before awful.rules runs!)
  10. The new client is put on top of the stacking order (but this emits no signals); so, all stacking done before now is ignored/lost
  11. startup id becomes available (no signal, but this can complete a SN sequence which then emits some signal; I don't think I remember any Lua code besides awful.startup_notification ever using this)
  12. property::list is emitted, just because the client list changed a long time ago.
  13. At this point now is manage emitted and the C code is done.

How is the client placed/screen selected