antiX-19.2 (testing) “Applications” from the desktop menu are missing

Forum Forums Official Releases antiX-19 “Marielle Franco, Hannie Schaft, Manolis Glezos, Grup Yorum, Wobblies” antiX-19.2 (testing) “Applications” from the desktop menu are missing

  • This topic has 26 replies, 5 voices, and was last updated Nov 2-7:09 pm by sta.
Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #42613
    Anonymous
      Helpful
      Up
      0
      ::

      I wonder if there is a functional regression that arose from the changes from python2 to python3.

      .

      buster:
      python-xdg (0.25-5)
      /usr/lib/python2.7/dist-packages/xdg/Menu.py
      https://sources.debian.org/src/pyxdg/0.25-5/xdg/Menu.py/#L753

                      if not menu.Directory:
                          menu.Directory = menuentry
                      elif menuentry.getType() == "System":
                          if menu.Directory.getType() == "User":
                              menu.Directory.Original = menuentry

      sid, and testing (for Bullseye):
      python3-xdg (0.26-3)
      /usr/lib/python3/dist-packages/xdg/Menu.py
      https://sources.debian.org/src/pyxdg/0.26-3/xdg/Menu.py/#L1006

                          if not menu.Directory:
                              menu.Directory = menuentry
                          elif menuentry.Type == MenuEntry.TYPE_SYSTEM:
                              if menu.Directory.Type == MenuEntry.TYPE_USER:
                                  menu.Directory.Original = menuentry

      hence the errormsg, on any system containing Menu.py provided by python3-xdg:
      ” AttributeError: ‘MenuEntry’ object has no attribute ‘Type’ “

      #42614
      Anonymous
        Helpful
        Up
        0
        ::

        Regarding the separate issue of “duplicate menu entries”, there’s an open bug report ticket
        python3-xdg: duplicate menu entries, e.g. via fvwm-menu-desktop

        #42645
        Forum Admin
        Dave
          Helpful
          Up
          0
          ::

          Thanks skidoo for taking the time to research these issues.
          The ticket for the duplicate lines is the exact problem, I think the issue relies strictly with this line
          for entry in menu.getEntries():
          in both our script and their script. My suspicions are such that the function is unintentionally calling itself when referencing a variable or running a test case. I was hoping to read through the python3-xdg code to find (roughly) the reason the menu.getEntries function returns 2 sets before chiming into the bug reports (to help with resolution and try to avoid a me two situation.)

          Indeed there is a regression in the python3-xdg code beyond the duplication. It is strange that anticapitalista and I have not seen the issue while being also up to date. I do not have the backports repos enabled. Maybe this is a cause of issue, or perhaps another package is triggering the if case. This would help with testing on this end. However if the OP would like to try modifying the standard python3-xdg package to alter line number 1006 of /usr/lib/python3/dist-packages/xdg/Menu.py from:
          elif menuentry.Type == MenuEntry.TYPE_SYSTEM:
          To:
          elif menuentry.getType() == MenuEntry.TYPE_SYSTEM:
          and try rerunning the antiX menu script it may be quicker. It is obviously a typo based on other lines such as line 1121
          https://sources.debian.org/src/pyxdg/0.26-3/xdg/Menu.py/#L1121

          If it works we can file a bug report with the resolution

          Edit:
          Corrected the code caption to fix typo pointed out below.

          • This reply was modified 2 years, 7 months ago by Dave.

          Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

          #42646
          Anonymous
            Helpful
            Up
            0
            ::

            The post above seems to contain a typo.
            “getType” is a function.
            The statement is calling getType() and testing its return value against the right-hand value.

            TO:

            elif menuentry.getType() == MenuEntry.TYPE_SYSTEM:

            #42647
            Anonymous
              Helpful
              Up
              0
              ::

              I’ve noticed duplicates showing up (back in antiX 17) for quite a while, not specific to python-xdg contexts. In spacefm, for instance.
              This suggests a broader xdg (and/or xdg + debian_menu) issue.

              .

              #42675
              Forum Admin
              Dave
                Helpful
                Up
                0
                ::

                Edited my post above to correct the typo, thanks for catching that.

                I’ve noticed duplicates showing up (back in antiX 17) for quite a while, not specific to python-xdg contexts. In spacefm, for instance.
                This suggests a broader xdg (and/or xdg + debian_menu) issue.

                Yes, looking at it a bit more. I think there is confusion on how “merge” is supposed to work.
                Maybe that is corrected now in the python3-xdg package and that is why we are seeing a full menu duplication? The duplicated portion is actually on top in the menu. Commenting out one or the other layout options (lines 70[3-5] or 70[6-8] of Menu.py) seems to address the duplication, though this is not a correct solution.

                elif tag == 'Layout':
                     if num_children > 1:
                         parent.Layout = self.parse_layout(child)
                 elif tag == 'DefaultLayout':
                     if num_children > 1:
                         parent.DefaultLayout = self.parse_layout(child)

                It is also possible to stop the duplicated menu entries by commenting out lines 739-743 of Menu.py

                elif tag == "Merge":
                     layout.order.append([
                     "Merge",
                         child.attrib.get("type", "all")
                     ])

                Also removing the <Layout>
                <Menuname>antiX</Menuname>
                <Separator/>
                <Merge type="files"/>
                <Merge type="menus"/>
                </Layout>

                What is curious to note here is that the “antiX” submenu is not actually duplicated like the rest. All the other menus are duplicated. I think this is because the menu file itself is used as the “default layout” and the layout section is used as “layout”. So being that the “antiX” submenu is specified in the “layout” section it is correctly identified as being the same and therefor not duplicated. So maybe the best solution (correct solution?) is to specify all of the

                blocks in the layout as rather than relying on to be a catchall…

                • This reply was modified 2 years, 7 months ago by Dave.

                Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                #42784
                Forum Admin
                Dave
                  Helpful
                  Up
                  0
                  ::

                  Went to submit bug reports, however they are already reported and merge requests sent. One 4 months ago another well over a year ago……
                  https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/5
                  https://gitlab.freedesktop.org/mjlbach/pyxdg/-/commit/78405aaa34463db2c6f33ca28ae2293dd3bb1e91
                  And
                  https://gitlab.freedesktop.org/xdg/pyxdg/-/issues/11
                  https://gitlab.freedesktop.org/tmccombs/pyxdg/-/commit/087410c64fd4d6db1ec2d70aa196e69b25c887eb

                  The menu template has been altered to have all sub-menus specified in the layout.

                  Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                  #42790
                  Anonymous
                    Helpful
                    Up
                    0
                    ::

                    https://gitlab.com/skidoo/python3-xdg

                    
                    pyxdg (0.26-3~ski) unstable; urgency=medium
                    
                    * Menu.py: fix " 'DesktopEntry' object has no attribute 'OnlyShowIn' "   
                    * fix " Duplicate results for menu entries if Layout is provided. "  
                    * fix " If a layout is included for a menu, all entries that would be     
                        included in <Merge type="menus"/> or <Merge type="files"/> is included twice. "
                    * " Fix compatibility with Python version >= 3.8.4 "   
                    * " Fix several ResourceWarnings (leaks): unclosed file "

                    To build the package on antiX 19, must first install the “debhelper-compat” pkg from debian testing repo

                    #44220
                    Member
                    sta
                      Helpful
                      Up
                      0
                      ::

                      I modified the file /usr/lib/python3/dist-packages/xdg/Menu.py as suggested above, i.e. by replacing
                      menuentry.Type
                      by
                      menuentry.getType()
                      and now I get a different kind of error:

                      (desktop-menu:16136): Gtk-CRITICAL **: 18:07:32.615: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
                      Traceback (most recent call last):
                        File "/usr/local/bin/desktop-menu", line 326, in <module>
                          build_menu()
                        File "/usr/local/bin/desktop-menu", line 298, in build_menu
                          process_menu(menu)
                        File "/usr/local/bin/desktop-menu", line 132, in process_menu
                          icon = find_icon(entry) or default_folder_icon
                        File "/usr/local/bin/desktop-menu", line 103, in find_icon
                          if icon_theme.lookup_icon(appicon, icon_size, 0):
                      AttributeError: 'NoneType' object has no attribute 'lookup_icon'
                      • This reply was modified 2 years, 6 months ago by sta.
                      #44225
                      Anonymous
                        Helpful
                        Up
                        0
                        ::

                        sta, the edit involves 2 lines. Did you edit both lines, as seen here? ——v
                        https://gitlab.freedesktop.org/mjlbach/pyxdg/-/commit/784&#8230;

                        #44229
                        Forum Admin
                        Dave
                          Helpful
                          Up
                          0
                          ::

                          On top of skidoo’s comment.
                          It looks like the script is unable to get the icons as it cannot see what theme you are using. How are you running the script and what theme are you using?
                          Maybe try with the –no-icons.

                          Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                          #44234
                          Member
                          sta
                            Helpful
                            Up
                            0
                            ::

                            sta, the edit involves 2 lines. Did you edit both lines, as seen here? ——v
                            https://gitlab.freedesktop.org/mjlbach/pyxdg/-/commit/784&#8230;

                            Yes, I modified both lines.

                            On top of skidoo’s comment.
                            It looks like the script is unable to get the icons as it cannot see what theme you are using. How are you running the script and what theme are you using?
                            Maybe try with the –no-icons.

                            Yes, the problem is now somehow icon-related. The script was called via apt from the root terminal.

                            However, after setting the DISPLAY variable and copying valid .Xauthority file to the root directory I can run “/usr/local/bin/desktop-menu” as root without errors.
                            The generated “Applications” menu is doubled (the same problem as reported before in this thread).

                            • This reply was modified 2 years, 6 months ago by sta.
                          Viewing 12 posts - 16 through 27 (of 27 total)
                          • You must be logged in to reply to this topic.