UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. PerlMax
    3. Posts
    P Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 25
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Custom builder for a library

      aaarg, sorry, one point again: For the Open Action you need a upload_helper qml, that you open with qmlscene in a new process when the user clicks "Open file". The work by @pparent was a huge help here (or rather, I shamelessly copied it). It’s important to set the full app ID in the startup script using environment variables (i.e., including the version, etc.). Here’s what it looks like for me:

      export APP_ID="emedia.maxperl_emedia_1.0.1"
      export UBUNTU_APP_LAUNCH_ID="emedia.maxperl_emedia_1.0.1"
      

      Since Perl handles all the copying and so on for me, the upload helper can be very simple (it just has to initiate the transfer and then close once the source sends “Charged” 🙂 ). Here’s the code:

      import QtQuick 2.9
      import Ubuntu.Components 1.3
      import Ubuntu.Content 1.3
      import Ubuntu.Components.Themes.SuruDark 1.1
      
      MainView {
          id: root
            
          Timer {
              id: timerquit
              interval: 1000      // 2 secondes
              running: false
              repeat: false
              onTriggered: Qt.quit()
          }
      Page {
          id: picker
          theme.name: "Ubuntu.Components.Themes.SuruDark"
      	property var activeTransfer
      
      	property var url
      	property var handler: ContentHandler.Source
      	property var contentType: ContentType.All
      
          signal cancel()
          signal imported(string fileUrl)
      
          header: PageHeader {
              title: i18n.tr("Choose")
              }
          
          ContentPeerPicker {
              anchors { fill: parent; topMargin: picker.header.height }
              visible: parent.visible
              showTitle: false
              contentType: picker.contentType
              handler: picker.handler //ContentHandler.Source
      
              onPeerSelected: {
                  peer.selectionType = ContentTransfer.Single
                  picker.activeTransfer = peer.request()
                  picker.activeTransfer.stateChanged.connect(function() {
                      // Upload is done in Perl
                      // we only need to close the Import Page Window and wait
                      // for file changes in HubIncoming directory
                      if (picker.activeTransfer.state === ContentTransfer.Charged) {
                         // All we need to do here is close the window, because the import 
                         // is handled entirely in Perl (see import_path() in ContentHub.pm)
                         timerquit.running=true;
                         // picker.activeTransfer = null;
                      }
                  })
              }
      
      
              onCancelPressed: {
                  console.log("Cancelled")
                  //TODO handle cancel
              }
          }
      
          ContentTransferHint {
              id: transferHint
              anchors.fill: parent
              activeTransfer: picker.activeTransfer
          }
          Component {
              id: resultComponent
              ContentItem {}
      	}
          }    
      }
      
      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      Hello again,

      This week, I was able to upload the first pEFL app to the OpenStore. You can find everything at https://github.com/MaxPerl/emedia.maxperl/ and in the OpenStore at https://open-store.io/app/emedia.maxperl

      In the end, it was a bit of a challenge dealing with hard-coded paths and full ContentHub integration for importing files (Open and Open With actions). Fortunately, the ContentHub also works with plain DBus. But since that isn’t documented anywhere, I want to write a few lines about it (maybe it’ll be helpful to others, too):

      The necessary changes to the $appid.apparmor file (+policygroup -> content_exchange), the manifest.json.in file (+hook for content_hub), and the creation of a $appid_content_hub.json file (+destination for the respective formats) are well documented, so I’ll skip those details here.

      My approach is to use a FileMonitor for the "$appcache/HubIncomings" directory (actually, I use two FileMonitors because, I first have to check whether the HubIncomings directory already exists. AppArmor prevents me from creating it and from making any changes to it). If a change occurs, I copy ( (!) really copy (!) because moving files is also prohibited by AppArmor) the import to a directory that belongs to my app (e.g., $appcache/imported_files)

      At first, I ran into a problem where, when I launched the app via FileManager, I could only open one file. The app crashed when I tried to open a second file.

      This was because the Content_Hub interface strictly requires that transfers be properly terminated (in many apps—and, to be honest, even in the instructions I found—this important intermediate step is missing). The procedure appears to be as follows:

      1. The source sends "Charged" once the file has been copied to the HubIncoming directory (irrelevant for me because I use a FileMonitor).

      2. Our app must send “Collected” and then copy the files to the import path.

      3. After copying, we must send “Finalize.” This causes Content Hub to clean up the Hubincoming directory, which is of course helpful because it ensures that there is only one import in the Hubincoming directory after each finalize (so you don't have to search for the latest import).

      I’ll quickly show you how my Perl function does this, and then you might be able to figure out the relevant DBus settings from there. It’s important to send the full App_ID in the path (i.e., including the version, etc.) and to escape it in a DBus-compliant manner. This means that special characters such as periods, hyphens, or spaces must be escaped. A proven standard is underscore hex escaping: Each invalid character is replaced by an underscore (_) followed by its two-digit hexadecimal value (in lowercase).

      sub import_path {
      	my ($self, $path) = @_;
      	
      	my ($transfer_id) = $path =~ /(\d+)$/;
      	my $app_id = $self->app_id();
      		
      	# Mask special characters
      	my $encoded_app_id = $app_id;
      	$encoded_app_id =~ s/([^a-zA-Z0-9])/sprintf("_%02x", ord($1))/eg;
      	my $service   = "com.lomiri.content.dbus.Service";
      	my $dbus_path = "/transfers/$encoded_app_id/import";
      	my $interface = "com.lomiri.content.dbus.Transfer";
      			
      	my $dbus = Protocol::DBus::Client::login_session();
      	$dbus->initialize();
      		
      	# Send collect an das DBus Interface
      	$dbus->send_call(
          	path => "$dbus_path/$transfer_id",
          	interface => $interface,
          	member => 'Collect',
          	destination => $service,
      	);
      		
      	# Obviously there is no answer to collect send!
      	#my $msg = $dbus->get_message();
      		
      	[... Copying files ...]
      		
      	my $got_response;
      	$dbus->send_call(
          	path => "$dbus_path/$transfer_id",
          	interface => $interface,
          	member => 'Finalize',
          	destination => $service
      	)->then( sub {
             	$got_response = 1;
          });
      	$dbus->get_message() while !$got_response;
      		
      	return "$new_path/$transfer_id/$file";	
      }
      

      Sorry for the long post. It took me quite a while to implement this. And as I said, maybe this explanation of DBus will be helpful to others as well. The next step, at some point, will be figuring out how to set up an export using DBus alone. If anyone here already knows the steps, please feel free to post some tips here. But for now, I’m going to take a little break 😉

      Warm regards,
      Max

      posted in App Development
      P
      PerlMax
    • RE: Ubuntu Touch 24.04-2.0 call for testing

      Does the 24.04.-2.0 update already include the Mir server update (to 2.x)? If so, I'd be interested to know whether the entire screen is touch-responsive in landscape mode when using uWolf or other XWayland apps. This likely relates to this bug: https://gitlab.com/ubports/development/core/lomiri/-/merge_requests/207

      Unfortunately, I can’t test it myself right now because I don’t have a device on hand to install the update on...

      posted in OS
      P
      PerlMax
    • RE: What do I need to do when enountering "This app needs to be reviewed manually, please check your app using the click-review command"?

      I have the same problem and need to give read_path and write_path permissions 😞 How can I start the manual review process?

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      @pparent : Thank you so much!!! This was the solution 🙂 Important for me in efl was not only to change the title, but also the name of the window, that means

      instead of only
      $win = pEFL::Elm::Win->util_standard_add("main", "pefl.maxperl");

      also
      $win = pEFL::Elm::Win->util_standard_add("pefl.maxperl", "pefl.maxperl");

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      @pparent mmh, I don't think so (because on my desktop there is only one window and the problem is with uWolf the same). I really do only some standard code with efl 😞 But I will do further diagnostics with xdotool..

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      my UT version is 24.04-1.3

      here again the screenshot:

      screenshot20260609_124509719.png

      Can you see it now?

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      @pparent 24.04-1 I think (the stable branch)

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      There is also a visual issue that two windows are now opening: one titled "pefl" (the actual app) and one titled "X11 Support." This problem also occurs in uWolf by @chromiumos-guy , for example. However, it has somehow been resolved in Min Browsers and @pparent apps (which also run on Xwayland). I'd appreciate any advice...

      Here a screenshot

      text alternatif

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      The state of Content-Hub is strange. When I open the app and then send myself files via the File Manager, for example, it seems to work. However, if the app isn't already open the first time and is essentially opened through the Content Hub, it only works once 😞

      posted in App Development
      P
      PerlMax
    • RE: Signal UT: Signal-Desktop for Ubuntu Touch

      @pparent said:

      Yes I plan to work on fixing that soon! 😉

      this would be great 🙂

      At the moment I study your content-hub implementation. Also great work there 😉

      posted in App Development
      P
      PerlMax
    • RE: Signal UT: Signal-Desktop for Ubuntu Touch

      with my pEFL App, two windows open: one named "pefl" (my app) and one named "X11 Support."

      In Min Browser (which also runs via Xwayland, right?), there's only one window. So somehow you managed to get rid of the "X11 Support" window.

      In Min Browser, the input from the Maliit Keyboard is sometimes overwritten (for example, I want to open www.google.de, but at some point it turns into www.googlegoogle.de). I think it is this problem: https://github.com/minbrowser/min/issues/2705

      posted in App Development
      P
      PerlMax
    • RE: Signal UT: Signal-Desktop for Ubuntu Touch

      Sorry for hijacking this thread. But your apps run on Xwayland too, right? I wanted to ask how you manage to get rid of that annoying XWindow? If you could show me how to do that for my pEFL app (see https://forums.ubports.com/topic/9958/custom-builder-for-a-library/10?_=1780999049215), I’d really appreciate it!!!

      By the way, great work. If it weren’t for the keyboard issue, Min b

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      I've finished a first small test application (a simple video player). You can find it under https://github.com/MaxPerl/pefl.maxperl

      All in all, it works pretty well. However, there are a few limitations:

      • I haven't yet managed to get the Wayland engine from efl to work (I'm hoping for Mir 2.x). This may lead to suboptimal performance (especially at the moment no hw acceleration), but more importantly, to an error with rotation. In landscape mode there is a well known Issue with Xwayland: Inputs on the right side of the screen do not work in landscape mode (see also the problem in uWolf, fix could come when this is merged: https://gitlab.com/ubports/development/core/lomiri/-/merge_requests/207). I also can't resolve it through settings X-Lomiri-Rotates-Window-Contents=false and/or X-Lomiri-Supported-Orientations=portrait at the moment (see ubports/development/core/lomiri#184)

      • Maliit virtual keyboard does not work at the moment. Apparently, there’s also a way for Xwayland apps to integrate this via the DBus interface. But right now, that’s too complicated for me. In the meantime, I’ve programmed my own little virtual keyboard (though it’s not really necessary for a video player. You can test it in the file-open dialog at the search field. Works pretty well for me).

      • I’m currently working on a connection to the Content Hub (at least receiving data from other apps would be nice). But it doesn't seem that straightforward if an app doesn't use Qt or QML at all. I've already tried launching the app via Qt/QML instead of a Bash script, but apparently that doesn't work with Xwayland apps? If anyone here has experience with this, I'd appreciate any suggestions. Maybe I’ll start a separate thread regarding Content Hub as well. Surely that should work without Qt/QML????

      Best wishes, Max

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      Thank you very much for all the suggestions. As a first step, I’m now trying to get the elementary_config configuration program up and running.

      I have now compiled efl for this purpose in a Libertine container under the prefix /opt/click.ubuntu.com/pefl.maxperl/current and am trying to start the program as suggested using the shell script run_config.sh. This allowed me to resolve the error message regarding efreetd and the missing configuration 🙂

      Unfortunately, it still isn't working. Here's the error message I've been getting so far:

      ERR<90576>:elementary ../src/lib/elementary/elm_module.c:114 _elm_module_find_as() Failed to load elementary module: 'prefs_iface': No such file or directory
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      
      EOF
      
      ERR<90576>:eina_safety ../src/lib/ecore_evas/ecore_evas.c:3941 ecore_evas_software_x11_new() safety check failed: m == NULL
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:eina_safety ../src/lib/ecore_evas/ecore_evas.c:4056 ecore_evas_gl_x11_options_new() safety check failed: m == NULL
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:elementary ../src/lib/elementary/efl_ui_win.c:5572 _elm_win_finalize_internal() Cannot create window.
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:eo ../src/lib/eo/eo.c:1137 _efl_add_internal_end() Object of class 'Efl.Ui.Win_Legacy' - Not all of the object constructors have been executed.
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:796 _ecore_magic_fail() *** ECORE ERROR: Ecore Magic Check Failed!!! in: ecore_evas_callback_selection_changed_set()
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:798 _ecore_magic_fail()     Input handle pointer is NULL!
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [....]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:796 _ecore_magic_fail() *** ECORE ERROR: Ecore Magic Check Failed!!! in: ecore_evas_callback_drop_drop_set()
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:798 _ecore_magic_fail()     Input handle pointer is NULL!
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:796 _ecore_magic_fail() *** ECORE ERROR: Ecore Magic Check Failed!!! in: ecore_evas_callback_drop_motion_set()
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:798 _ecore_magic_fail()     Input handle pointer is NULL!
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:796 _ecore_magic_fail() *** ECORE ERROR: Ecore Magic Check Failed!!! in: ecore_evas_callback_drop_state_changed_set()
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:ecore ../src/lib/ecore/ecore.c:798 _ecore_magic_fail()     Input handle pointer is NULL!
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      
      ERR<90576>:evas_main ../src/lib/evas/canvas/evas_object_smart.c:746 _efl_canvas_group_efl_object_destructor() efl_canvas_group_del() was not called on this object: 0x40000000638f (Efl.Ui.Win_Legacy)
      ## Copy & Paste the below (until EOF) into a terminal, then hit Enter
      
      eina_btlog << EOF
      [...]
      EOF
      

      Maybe it's because EFL doesn't support Wayland? Or maybe EFL can't find the right display? Everything works perfectly in Libertine... Right now, I'm just at a loss...

      You can find the current status at https://github.com/MaxPerl/pefl.maxperl

      Thanks in advance, Max

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      @projectmoon Unfortunately this is not enough. The c library searches for config files etc. under the installation prefix (e.g. /usr/share/elementary). Perhaps it would be possible to compile efl at the UT XDG data-dir, but I didn't have luck with this so far 😞 That's why the solution would be to run in a chroot environment (where I could copy the files from the libertine container.. Best wishes, Max

      posted in App Development
      P
      PerlMax
    • RE: Custom builder for a library

      Hello everybody,

      I am trying again to develop a simple pEFL test app. In libertine everything works great. Unfortunately the app won't start outside the libertine environment. Apparently, efl needs to be able to read files in the $HOME directory and some other directories (see https://sourceforge.net/p/enlightenment/mailman/message/58751741/).

      My idea now is to run the app in a chroot environment. Would that be possible for a normal click app? Are there any examples of other apps that do this? Or is that not such a good idea?

      Thanks in advance!
      Max

      posted in App Development
      P
      PerlMax
    • RE: Wi-Fi connection unstable with several websites on UT 24.04

      Changing the DNS server solved the problem 🙂

      posted in Support
      P
      PerlMax
    • RE: Wi-Fi connection unstable with several websites on UT 24.04

      On the tablet manual setting the DNS and setting the option ipv6|4.ignore-auto to "yes" as decribed under https://forums.ubports.com/topic/3857/set-dns-in-ut/4 seems to make the wifi connection much more stable (I used Cloudflare DNS provider). But I have to test it more and longer and let you know whether this solves my problems.

      I also noticed the options edns0 and trust-ad in the /etc/resolv.conf file. Maybe these are causing problems too, but I don't know how to disable them.

      posted in Support
      P
      PerlMax
    • Wi-Fi connection unstable with several websites on UT 24.04

      Dear UT community,

      I have two devices running Ubuntu Touch 24.04 (stable) (FP4 and Lenovo M10 Gen2). Unfortunately, when accessing certain websites (especially my private Matrix server (a subdomain of my private homepage), but also regularly the search with DuckDuckGo), the Wi-Fi connection is unstable in Morph-Browser or the Cinny UT app. In Morph the error "Error: net::ERR_NAME_NOT_RESOLVED" is displayed. In the logs of Cinny the error messages "QObject::killTimer: Timers cannot be started from another thread" and "js: /sync error %s ConnectionError fetch failed: Failed to fetch" stands out. Strangely enough, these sites are accessible in the Min browser or the Waydroid browser. But when I run a ping command in the terminal, I get "Name or service unknown" (though I can ping the IP address).

      Has anyone else had similar issues? What could be causing this?

      I'd really appreciate any help!

      Best regards,
      Max

      posted in Support
      P
      PerlMax