Skip to content

Required components default fallback#326

Open
2387skju wants to merge 2 commits intomate-desktop:masterfrom
2387skju:required_components_default_fallback
Open

Required components default fallback#326
2387skju wants to merge 2 commits intomate-desktop:masterfrom
2387skju:required_components_default_fallback

Conversation

@2387skju
Copy link
Copy Markdown

@2387skju 2387skju commented Jan 1, 2026

Reset the required components to default, if not found.
After uninstall a component, a fallback is need: will fix #324
(( Required components are: dock, filemanager, panel, window manager. ))


Changes in file mate-session/main.c :
Reset will be done, in this case:

  • the executable was not found
  • and the current value is not empty
    • => this still allows the user to disable a component manual (= by set empty value)
  • and the default value is not empty

Additional just for the Windowmanager:
Changes in file data/mate-wm :

  • checks if the value from gsettings is usable (command) ,
  • otherwise just ignore that value and continue the script normal (= will search for another window manager)

(both shortly tested with older Mate Version 1.26 on Debian 13. ; I'm new in C-Language)

@vkareh vkareh force-pushed the required_components_default_fallback branch from 9a19da8 to 8f312ab Compare March 17, 2026 16:41
@2387skju 2387skju force-pushed the required_components_default_fallback branch from 8f312ab to da50b2e Compare March 19, 2026 11:39
Copy link
Copy Markdown
Member

@vkareh vkareh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some memory management issues, but this is moving in the right direction, thanks.

…ty values are still possible, to disable a component).

(( note: required components are windowmanager , filemanager , panel , dock ))
@2387skju 2387skju force-pushed the required_components_default_fallback branch from da50b2e to d728bd9 Compare March 21, 2026 19:09
@2387skju
Copy link
Copy Markdown
Author

Thank you for helping me :-)

Changes:

  • variable name swapped each other:
    • g_settings_default_default <=> default_default_provider
    • This is more consistant to the origin code (the lines before).
  • replaced: strcmp(.., "") => IS_STRING_EMPTY:
    • Now use of MARCO (( #define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0') ))
    • That MACRO is already used a few lines before.
    • I think this is bedder to read and faster. (( other alternative: strlen(str) == 0 )).
  • replaced: g_variant_get => g_variant_get_string
    • I think this look a little bit bedder.
    • This is like &s version of g_variant_get_string.

I've also tested / think about split the code in a new function:

I'm not sure about it. Just an Idea. In this structure:

append_required_apps()
{
  for  // for each required_components
  {
    append_required_apps_add_component(..., FALSE);
  }
}

append_required_apps_add_component (...,  gboolean is_recursiv_call)
{

  [...] // do add component
  
  if  // if failed && !is_recursiv_call
  {
    // do reset
    ...
    append_required_apps_add_component (..., TRUE);
  }
}

Implemented in Code:

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.

Fallback to default required components ( window manager, filemanager, ...) if not found

2 participants