picom icon indicating copy to clipboard operation
picom copied to clipboard

core: separate work with the x extensions

Open absolutelynothelix opened this issue 2 years ago • 0 comments

  1. a todo is addressed: https://github.com/yshui/picom/blob/16486739fa9daa5964e1bba5baa551da622999d7/src/x.c#L67
  2. unused information about the x extensions (base event and error numbers, major opcode) is not stored anymore;
  3. information about the x extensions (presence, base event and error numbers) is now stored in a single, separate place - a structure called x_extensions that lives in the x_connection structure, so the session structure is less polluted. it's ordered and clean so it's clear how to add and/or remove the x extensions;
  4. the x extensions are now initialized in a single, separate place - a function called x_init_extensions that is called right after the x_init_connection function, so the session_init function is less polluted. it's ordered and clean so it's clear how to add and/or remove the x extensions. also it separates initialization from work (only initialization happens there, all the work left in the session_init function), has comments (when a particular x extension initialization happens, why we require particular versions of particular x extensions and why we sometimes negotiate versions of x extensions just to discard this information) and has a better error handling (when a required x extension is missing or something goes wrong it at least tries to free what's already allocated instead of immediately dying using exit(1) and leaking a bunch of stuff);
  5. --diagnostics reports presence of all the optional x extensions in the same way now;
  6. the win_update_bounding_shape function doesn't require shape_exists that indicates the x shape extension presence, it determines it itself using c;
  7. the x_error_code_to_string function doesn't use ps_g anymore, it uses c instead;
  8. the x extensions used by picomling are now properly initialized and a picomling won't born if one of them is missing.

absolutelynothelix avatar Apr 23 '23 20:04 absolutelynothelix