IceWM saving settings with Preferences Menu

Forum Forums Official Releases antiX-19 “Marielle Franco, Hannie Schaft, Manolis Glezos” IceWM saving settings with Preferences Menu

  • This topic has 32 replies, 8 voices, and was last updated Jan 5-6:32 pm by marcuscf.
Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #48348
    Member
    Avatarmarcuscf

    I guess this is an upstream IceWM bug, but I will post here anyway just in case someone could help fixing it or sending the bug report to the right place.

    Has anybody else noticed that when you try to save an IceWM setting it writes an invalid setting to .icewm/preferences?
    Suppose you think your main menu has too many unused items and you want to hide the Run… (or Focus or whatever) menu item. You want to do it using only the mouse because you are a noob 🙂 You click Menu -> Preferences -> Show and then you uncheck the ShowRun menu item. It works immediately, you like the change, then you go back to Menu -> Preferences -> Save modifications.

    Then you see that it doesn’t work across reboots and you open .icewm/preferences only to see that it saved
    ShowRun0 # 0/1
    instead of the correct line, with an equals sign.
    ShowRun=0

    The end result is that changing settings permanently using that menu doesn’t work. If the setting is related to the toolbar it’s even worse because it doesn’t work immediately (probably a known limitation) and it doesn’t work after a session restart (because it writes the config line without an equals sign).

    #48353
    Member
    skidooskidoo

    I’m posting to confirm seeing the bug, and to add a further observation:

    The bug affects changes to any pref within the “Preferences}Show” submenu.
    Regardless whether the intent is to toggle ON or toggle OFF a given item,
    upon clicking “Save Modifications” an equalsign is absent in the modified line within the ~/.icewm/preferences file

    ___________________________________________
    When requesting help, pasting the output from inxi -Fzr command will provide important relevant details:
    antiX version//edition ~~ stable vs testing repos ~~ live vs installed vs virtualbox ~~ hardware specs

    #48354
    Member
    skidooskidoo

    If the setting is related to the toolbar it’s even worse because it doesn’t work immediately

    ? ? ?
    I tested “untick TaskBarMouseWheel”
    Instantaneously, the changed behavior takes effect.
    As a followup I clicked “Save Modifications”, then checked the preferences file. I found the line for this taskbar-related pref had been written correctly.

    ___________________________________________
    When requesting help, pasting the output from inxi -Fzr command will provide important relevant details:
    antiX version//edition ~~ stable vs testing repos ~~ live vs installed vs virtualbox ~~ hardware specs

    #48365
    Member
    skidooskidoo

    the seemingly relavent code was introduced way back in 2018, and has not been modified since
    https://github.com/ice-wm/icewm/commit/16b8d71492d128a09a33765adddc3d736ea0d09a

    wmprog.cc::updateOption()
       [..]
       char* s = text;
       regmatch_t m = {};
       while (0 == regexec(&pat, s, 1, &m, 0)) {
          s += m.rm_eo;
          s[-1] = '0' + o->boolval();
          s = replaceComment(s, "# 0/1");
       }
       [..]
    }

    s[-1] = ‘0’ + o->boolval();
    but at that point, s is just a character array.
    Positioning to “-1” seems to wrongly presume the need to backtrack past the nullbyte of a null-terminated string
    (so winds up overwriting the equalsign character)

    Untested, I reckon the fix would be

       while (0 == regexec(&pat, s, 1, &m, 0)) {
          s += m.rm_eo;
       }
       s += '\0';
       s[-1] = '0' + o->boolval();
       s = replaceComment(s, "# 0/1");

    ___________________________________________
    When requesting help, pasting the output from inxi -Fzr command will provide important relevant details:
    antiX version//edition ~~ stable vs testing repos ~~ live vs installed vs virtualbox ~~ hardware specs

    #48539
    Moderator
    AvatarBobC

    I was able to reproduce it as well. I created an issue for it with the upstream Developers and passed on skidoo’s suggestion… Thanks for noticing it.

    https://github.com/bbidulock/icewm/issues/535

    In the meantime, I guess we should maintain it the old fashioned way 🙂

    #48595
    Member
    Avatarmarcuscf

    If the setting is related to the toolbar it’s even worse because it doesn’t work immediately

    ? ? ?
    I tested “untick TaskBarMouseWheel”
    Instantaneously, the changed behavior takes effect.
    As a followup I clicked “Save Modifications”, then checked the preferences file. I found the line for this taskbar-related pref had been written correctly.

    Confirmed, TaskBarUseMouseWheel does work immediately.

    I had tested with TaskBarShowCPUStatus (and MEMStatus, etc.) and I couldn’t see any change.

    I guess it’s not as clear-cut as “menus get updated immediately, taskbar doesn’t” as I thought at first.

    I was able to reproduce it as well. I created an issue for it with the upstream Developers and passed on skidoo’s suggestion… Thanks for noticing it.

    https://github.com/bbidulock/icewm/issues/535

    In the meantime, I guess we should maintain it the old fashioned way 🙂

    Thanks BobC for reporting the bug on GitHub and thanks skidoo for having a look at the source code.

    • This reply was modified 1 month, 3 weeks ago by marcuscf. Reason: emoji fix
    #48601
    Member
    Avatarmarcuscf

    Untested, I reckon the fix would be

       while (0 == regexec(&pat, s, 1, &m, 0)) {
          s += m.rm_eo;
       }
       s += '\0';
       s[-1] = '0' + o->boolval();
       s = replaceComment(s, "# 0/1");

    I don’t think s += ‘\0’ would do anything. Isn’t that just pointer arithmetic? The variable s is a pointer so += is just increment pointer (by zero).
    I’m not so sure what the solution might be, that depends on what the regular expression does exactly (and the value of m.rm_eo). If it were me, I would start simply changing s[-1] to s[0] and seeing what happens, LOL. Anyway, that’s for the IceWM developers to do, I’m too confused by that regular expression.

    #48791
    Member
    skidooskidoo

    @BobC
    Your report received quick attention.
    A fix has been committed: https://github.com/bbidulock/icewm/commit/2be556424a8985278a363a009fea1ea4a985a463

    ___________________________________________
    When requesting help, pasting the output from inxi -Fzr command will provide important relevant details:
    antiX version//edition ~~ stable vs testing repos ~~ live vs installed vs virtualbox ~~ hardware specs

    #48793
    Moderator
    AvatarBobC

    They have been pretty attentive with any problems, and so have you, THANKS.

    I’m not sure how/when anti gets updates from them? I didn’t even know 2.0.0 existed when I saw in on here, LOL.

    #48839
    Member
    marcelocripemarcelocripe

    Hello Marcus, Skidoo and BobC.

    Please, could you explain to me the location and name of the file that needs to be edited to correct the problem that Marcus found. How is the original code in antiX and how should it be changed. So all users will be able to use this solution.

    Thanks in advance.

    marcelocripe
    (Original text in Brazilian Portuguese)

    ———-

    Olá Marcus, Skidoo e BobC.

    Por favor, seria possível me explicar o local e o nome do arquivo que precisa ser editado para corrigir o problema que o Marcus encontrou. Como está o código original no antiX e como deve ser alterado. Assim todos os usuários poderão utilizar esta solução.

    Desde já eu agradeço.

    marcelocripe
    (Texto original em idioma Português do Brasil)

    #48841
    Member
    XecureXecure

    Unfortunately, this is not something a normal user can fix. The code needs to be compiled and built (meaning a complete reinstall). We need to wait for the next icewm update (that will come some time after the icewm developer creates the next release with other changes, which may be at some point between next week and next year).

    #48842
    Member
    skidooskidoo

    We need to wait

    or, if suitably motivated, learn to download (or git clone) the source code from the icewm project repository and compile the program on ☺ your own system

    ___________________________________________
    When requesting help, pasting the output from inxi -Fzr command will provide important relevant details:
    antiX version//edition ~~ stable vs testing repos ~~ live vs installed vs virtualbox ~~ hardware specs

    #48851
    Moderator
    AvatarBobC

    Yes, generally, antiX gets IceWM fixes very quickly. The code itself has been fixed. I think antiX normally gets its fixes via Debian Sid, but not sure there. I did recompile, tweak, and recompile before (thankfully with guidance from skidoo and a couple others here), but it was only useful to learn how and prove that the fix worked.

    #48852
    Moderator
    Brian MasinickBrian Masinick

    We need to wait

    or, if suitably motivated, learn to download (or git clone) the source code from the icewm project repository and compile the program on ☺ your own system

    You are SO right on this matter (as in many things we frequently discuss). Most people are used to receiving binary packages and very complete systems, but I can tell you that MANY software components (in fact, ALL GNU software components) ARE available and MUST be available somewhere in source code form.

    I used to routinely compile my own instances of GNU Emacs back when I had a UNIX workstation. The organization I worked in usually had copies of GNU Emacs. Back then there were updates more often, so the ones I had binary access to were “out of date” and the newer ones had significant, useful incremental features.

    Stuff like that isn’t too difficult to build, though depending on the hardware and your configuration, sometimes build dependencies can be “challenging” until you “stumble upon” or do significant research to get the proper configurations set up. Another big improvement since the early eighties and nineties is that there is usually a configuration step that is very helpful in overcoming those issues, so building code has also improved in the past 20-30 years.

    Brian Masinick

    #48862
    Forum Admin
    rokytnjirokytnji

    compile the program on ☺ your own system

    I believe he is asking that

    Hello Marcus, Skidoo and BobC.

    Please, could you explain to me the location and name of the file that needs to be edited to correct the problem that Marcus found. How is the original code in antiX and how should it be changed. So all users will be able to use this solution.

    Thanks in advance.

    marcelocripe

    @marcel. Icewm preferences can be accessed via Control Center in the menu. It is in the hidden icewm folder in your home directory.

    harry@biker:~
    $ locate preferences
    <snip>
    /home/harry/.icewm/preferences
    <snip>
    

    Code reading is another matter not left to rookies. That is why I say make a backup first by sleclecting copy and renaming preferences file to old or backup.

    Notice how much space and time it took to explain file location. Then make a backup. I think it 8s better for the clueless to wait. There are no LUGS in my area.
    I bet Marcel has some in his area though\

    São Paulo Linux Meetup

    São Paulo, BR
    509 Linuxers

    A group to bring people together in order to transform your Linux experience into something more collaborative.

    Check out this Meetup Group →

    https://www.meetup.com/en-AU/lug-pe/events/

    https://www.linuxjournal.com/article/3548?quicktabs_1=0

    Sometimes I drive a crooked road to get my mind straight.
    Not all who Wander are Lost.
    I'm not outa place. I'm from outer space.

    Linux Registered User # 475019
    How to Search for AntiX solutions to your problems

Viewing 15 posts - 1 through 15 (of 33 total)
  • You must be logged in to reply to this topic.