Recent

Author Topic: Common File Dialogs Have Been Broken for a Very Long Time (Ex: Ubuntu AARCH64)  (Read 18675 times)

msintle

  • Sr. Member
  • ****
  • Posts: 259
Here is my new version. Tested in Fedora and will compile Qt5 directly.
(see the LCL_PLATFORM option at the top)

Currently zip=1 so it will use the zip download from github instead of cloning the entire repository.
You'll loose the ability to browse through all the changes in the repository but for testing this doesn't matter.
(Those options would be where a menu comes in handy ;) )

I also see I need to copy the desktop shortcut to ~/.local/share/applications because Fedora doesn't have a desktop but it needs the shortcut there to appear in the All Programs.

Code: Bash  [Select][+][-]
  1. #!/bin/bash
  2. # ======================================================
  3. # by rvk (v.2.1, 2024-12-06)
  4. # ======================================================
  5.  
  6. echo ""
  7. echo "=============================================================="
  8. echo "Running on: $(sed 's/\x0/ /' /sys/firmware/devicetree/base/model 2>/dev/null || cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null || echo Unknown)"
  9.  
  10. # ======================================================
  11. # setup versions, download and compile
  12. # ======================================================
  13.  
  14. #fpc_version="release_3_2_0"
  15. #laz_version="lazarus_2_0_12"
  16.  
  17. #fast
  18. zip=1
  19.  
  20. # repository
  21. fpc_git=1
  22. laz_git=1
  23.  
  24. # compile
  25. fpc_compile=1
  26. laz_compile=1
  27.  
  28. LCL_PLATFORM=qt5
  29. #LCL_PLATFORM=gtk2
  30.  
  31. # ======================================================
  32. # check if we are running in bash instead of sh
  33. ps $$ 2>&1 | grep bash > /dev/null 2>&1 && echo "Running in bash. continuing..." || { echo "Not running in bash. Aborting..."; exit 1; }
  34.  
  35. # ======================================================
  36. # optional use zram as swapfile
  37. # ======================================================
  38. # not done yet
  39.  
  40. # ======================================================
  41. # minimal swap space needed is 1024MB
  42. # ======================================================
  43. while true; do
  44.  
  45.   FREESWAP=$(free | grep -i swap | awk '{print $2}')
  46.   if [ $FREESWAP -lt 900000 ]; then
  47.  
  48.     echo "=============================================================="
  49.     echo "Current swapsize is $FREESWAP"
  50.     echo "Swapsize is really small. Recomended size is 1024MB (1GB).";
  51.     echo "=============================================================="
  52.  
  53.     read -n1 -p "Do you want to increase it to 1024MB (1GB) or continue without swap? [y/n/c] " yn
  54.     echo ""
  55.     case $yn in
  56.       [Cc]* ) break;;
  57.       [Yy]* ) ;;
  58.       [Nn]* ) echo >&2 "Please increase the swap space manually. Aborting..."; exit 1;;
  59.       [Qq]* ) exit 1;;
  60.       * ) echo "Please answer yes or no."; echo ""; continue;;
  61.     esac
  62.  
  63.     # we can increase this if /etc/dphys-swapfile exists
  64.     [ -f /etc/dphys-swapfile ] && {
  65.       echo "=============================================================="
  66.       echo "Setting in /etc/dphys-swapfile $(cat /etc/dphys-swapfile | grep CONF_SWAPSIZE)"
  67.       echo "Increasing value and restarting swap"
  68.       sudo sed -i 's/CONF_SWAPSIZE=[0-9]*$/CONF_SWAPSIZE=1024/g' /etc/dphys-swapfile
  69.       sudo /etc/init.d/dphys-swapfile stop
  70.       sudo /etc/init.d/dphys-swapfile restart
  71.       echo "=============================================================="
  72.     } || {
  73.       echo "=============================================================="
  74.       echo "Setting up /swapfile"
  75.       DATE=$(date +%s)
  76.       sudo fallocate -l 4G "/swapfile.$DATE" \
  77.       && sudo chmod 600 "/swapfile.$DATE" \
  78.       && sudo mkswap "/swapfile.$DATE" \
  79.       && sudo swapon "/swapfile.$DATE" \
  80.       && sudo swapon --show \
  81.       && echo "Created and turned on /swapfile.$DATE" \
  82.       && echo "Note: This is not permanent."
  83.       echo "=============================================================="
  84.     }
  85.  
  86.   else
  87.     echo "Current swapsize is $FREESWAP. Ok"
  88.     break;
  89.   fi
  90.  
  91. done
  92.  
  93. # ======================================================
  94. begin=$(date +%s)
  95.  
  96. # ======================================================
  97. # update packages list to latest version
  98. # ======================================================
  99. echo "=============================================================="
  100. echo ""
  101. echo "Updating package list to latest version (sudo needed)"
  102. echo ""
  103.  
  104. PKG_MANAGER=""
  105. command -v dnf >&1 >/dev/null && PKG_MANAGER="dnf"
  106. command -v apt-get >&1 >/dev/null && PKG_MANAGER="apt"
  107.  
  108. # ======================================================
  109. # some other essentials
  110. # ======================================================
  111. echo "=============================================================="
  112. echo ""
  113. echo "Installing required packages (sudo used)"
  114. echo ""
  115. if [ "$PKG_MANAGER" = "apt" ]; then
  116.   sudo apt-get -y install make binutils build-essential gdb git subversion zip unzip pv
  117.   sudo apt-get -y install libx11-dev libgtk2.0-dev  # for Lazarus, includes all dependencies
  118.  
  119.   if [ "$LCL_PLATFORM" = "qt5" ]; then sudo apt-get -y install libqt5pas-dev; fi
  120.  
  121. elif [ "$PKG_MANAGER" = "dnf" ]; then
  122.   # dnf search gtk2*
  123.   sudo dnf -y install make binutils gdb git zip unzip pv
  124.   sudo dnf -y install libX11-devel gtk2-devel gtk+-devel  # for Lazarus, includes all dependencies
  125.   sudo dnf -y install gcc gcc-c++ kernel-devel
  126.  
  127.   if [ "$LCL_PLATFORM" = "qt5" ]; then sudo dnf -y install qt5pas-devel; fi
  128.  
  129. else
  130.   echo >&2 "Neither yum/dnf nor apt-get found. Aborting."; exit 1;
  131. fi
  132.  
  133. # sudo apt-get -y install libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev lpango-1.0 libpangox-1.0-dev xorg-dev libatk1.0-dev libgtk2.0-dev
  134. # libgtk2.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libatk1.0-dev libghc-x11-dev
  135. # or
  136. # xorg-dev libssl-dev libx11-dev libgdk-pixbuf2.0-dev
  137. # libcairo2-dev lpango-1.0 libpangox-1.0-dev libatk1.0-dev libgtk2.0-dev
  138.  
  139. git --version >/dev/null 2>&1 || { echo >&2 "I require git but it's not installed. Aborting."; exit 1; }
  140.  
  141. # ======================================================
  142. #
  143. # ======================================================
  144. BASE=$HOME/dev
  145. mkdir -p $BASE
  146. cd $BASE
  147.  
  148. # ======================================================
  149. # We need a bootstrap compiler fpc 3.2.2
  150. # There is NONE AVAILABLE so we need to download complete
  151. # fpc-3.2.2.arm-linux-raspberry1wq.tar
  152. # in virtualbox Rasbian stretch we need i386
  153. # ======================================================
  154.  
  155. echo "=============================================================="
  156. echo ""
  157. CPU=$(uname -m)                  # armv7l, aarch64, x86_64 # note L not 1
  158. #CPU=$(dpkg --print-architecture) # armhf, arm64,
  159. if [ "$CPU" = "armv7l" ]; then # note L not 1
  160.   echo "Compiling for ARMv7 Processor (Pi2 and higher only)"
  161.   OPTIONS_FPC="-g -gl -gw3 -O2 -Xs -CX -XX -v0 -dFPC_ARMHF"
  162.   OPTIONS_LAZ="-g -gl -gw3 -v0"
  163.   OS_TARGET="linux"
  164.   CPU_TARGET="arm"
  165.   COMP3_DOWNLOAD="https://downloads.freepascal.org/fpc/dist/3.2.2/arm-linux/fpc-3.2.2.arm-linux.tar" # complete version
  166.   COMP=ppcarm
  167. elif [ "$CPU" = "aarch64" ]; then
  168.   echo "Compiling for ARM64 Processor (Pi2 and higher only)"
  169.   OPTIONS_FPC="-g -gl -gw3 -O2 -Xs -CX -XX -v0 -dFPC_ARMHF"
  170.   OPTIONS_LAZ="-g -gl -gw3 -v0"
  171.   OS_TARGET="linux"
  172.   CPU_TARGET="aarch64"
  173.   COMP3_DOWNLOAD="https://downloads.freepascal.org/fpc/dist/3.2.2/aarch64-linux/fpc-3.2.2.aarch64-linux.tar" # complete version
  174.   COMP=ppca64
  175. elif [ "$CPU" = "x86_64" ]; then
  176.   echo "Compiling for x64 Processor"
  177.   OPTIONS_FPC="-g -gl -gw3 -O2 -Xs -CX -XX -v0"
  178.   OPTIONS_LAZ="-g -gl -gw3 -v0"
  179.   OS_TARGET="linux"
  180.   CPU_TARGET="x86_64"
  181.   COMP3_DOWNLOAD="https://downloads.freepascal.org/fpc/dist/3.2.2/x86_64-linux/fpc-3.2.2.x86_64-linux.tar" # complete version
  182.   COMP=ppcx64
  183. elif [ "$CPU" = "i686" ]; then
  184.   echo "Compiling for i686 Processor"
  185.   OPTIONS_FPC="-g -gl -gw3 -O2 -Xs -CX -XX -v0 -dFPC_I386"
  186.   OPTIONS_LAZ="-g -gl -gw3 -v0"
  187.   OS_TARGET="linux"
  188.   CPU_TARGET="i386"
  189.   COMP3_DOWNLOAD="https://downloads.freepascal.org/fpc/dist/3.2.2/i386-linux/fpc-3.2.2.i386-linux.tar" # complete version
  190.   COMP=ppc386
  191. else
  192.   echo >&2 "$CPU is not supported as processor (needed armv7l/x86_64/i686). Aborting."; exit 1;
  193. fi
  194.  
  195. # ------------------------------------------------------
  196.  
  197. echo "=============================================================="
  198. if [ ! -x ./bootstrap/$COMP ]; then
  199.   echo "Downloading compiler 3.2.2"
  200.   echo ""
  201.   wget --continue --quiet -O- $COMP3_DOWNLOAD |\
  202.   tar -O -xf- --wildcards --no-anchored "binary*-linux.tar" --strip=1 |\
  203.   tar -O -xf- --wildcards --no-anchored "base.*-linux.tar.gz" |\
  204.   tar -xzf- --wildcards --no-anchored "lib/fpc/*/ppc*" --transform "s|lib/fpc/.*/ppc|./bootstrap/ppc|"
  205. fi
  206. [ -x ./bootstrap/$COMP ] || { echo >&2 "Bootstrap $BASE/bootstrap/$COMP compiler not found. Aborting."; exit 1; }
  207.  
  208. echo "Using bootstrap $BASE/bootstrap/$COMP compiler"
  209. echo ""
  210.  
  211. # ======================================================
  212. # downloading fpc and lazarus
  213. # ======================================================
  214. if [ "$zip" = "1" ]; then
  215.  
  216.   wget --continue --quiet -O fpc.zip "https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip"
  217.   wget --continue --quiet -O laz.zip "https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip"
  218.   unzip -q fpc.zip
  219.   unzip -q laz.zip
  220.   mv lazarus-main lazarus
  221.   mv source-main fpc
  222.  
  223. else
  224.  
  225.   if [ "$fpc_git" = "1" ]; then
  226.  
  227.     echo "=============================================================="
  228.     echo ""
  229.     echo "Downloading FPC sources $(git -C fpc log -1 2>&1 | grep Date)"
  230.     echo ""
  231.     [ -d ./fpc ] && { git -C fpc reset --hard && git -C fpc pull -q; } || { git clone https://gitlab.com/freepascal.org/fpc/source.git fpc; }
  232.     [ -f ./fpc/Makefile ] || { echo >&2 "Download of fpc failed. Aborting."; exit 1; }
  233.     echo "Now: $(git -C fpc log -1 | grep Date 2>&1)"
  234.     echo ""
  235.  
  236.   fi
  237.  
  238.   if [ "$laz_git" = "1" ]; then
  239.  
  240.     echo "Downloading Lazarus sources $(git -C lazarus log -1 2>&1 | grep Date)"
  241.     [ -d ./lazarus ] && { git -C lazarus reset --hard && git -C lazarus pull -q; } || { git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus; }
  242.     [ -f ./lazarus/Makefile ] || { echo >&2 "Download of fpc failed. Aborting."; exit 1; }
  243.     echo "Now: $(git -C lazarus log -1 | grep Date 2>&1)"
  244.     echo ""
  245.  
  246.   fi
  247.  
  248.   if [ "$fpc_version" != "" ]; then
  249.     echo "Switch to fpc $fpc_version"
  250.     git -C fpc checkout tags/$fpc_version
  251.   fi
  252.  
  253.   if [ "$laz_version" != "" ]; then
  254.     echo "Switch to lazarus $laz_version"
  255.     git -C lazarus checkout tags/$laz_version
  256.   fi
  257.  
  258. fi
  259.  
  260. # ======================================================
  261. # compiling fpc
  262. # ======================================================
  263. if [ "$fpc_compile" = "1" ]; then
  264.  
  265. echo "=============================================================="
  266. echo ""
  267. echo "Now compiling FPC, this will take some time"
  268. echo ""
  269. cd $BASE/fpc
  270.  
  271. echo "Cleaning up"
  272. # find . -name "*.ppu" -type f -delete
  273. # find . -name "*.o" -type f -delete
  274. # make clean distclean cleanall > /dev/null 2>&1
  275. git clean -xdf > /dev/null 2>&1    # will clean untracked files and directories
  276.  
  277. echo "make -s all install OPT=\"$OPTIONS_FPC\" OS_TARGET=$OS_TARGET CPU_TARGET=$CPU_TARGET INSTALL_PREFIX=$BASE/fpc PP=$BASE/bootstrap/$COMP"
  278.  
  279. make -s all install OPT="$OPTIONS_FPC" OS_TARGET=$OS_TARGET CPU_TARGET=$CPU_TARGET INSTALL_PREFIX=$BASE/fpc PP=$BASE/bootstrap/$COMP \
  280.   | pv -l -bp -s2500 >$BASE/fpc.log \
  281.   || { echo >&2 "Compilation of FPC failed. Aborting."; exit 1; }
  282. cd $BASE
  283. [ -x ./fpc/bin/fpc ] || { echo >&2 "Something went wrong compiling FPC. Aborting."; exit 1; }
  284.  
  285. echo ""
  286. echo "Doing some extra configuration"
  287.  
  288. # remove old config
  289. [ -f $HOME/.fpc.cfg ] && rm $HOME/.fpc.cfg
  290. ln -sf $(find $BASE/fpc/lib -name $COMP    ) $BASE/fpc/bin/$COMP
  291. ln -sf $(find $BASE/fpc/lib -name samplecfg) $BASE/fpc/bin/samplecfg
  292. # ln -sf $BASE/fpc/lib/fpc/3.3.1/$COMP $BASE/fpc/bin/$COMP
  293. # ln -sf $BASE/fpc/lib/fpc/3.3.1/samplecfg $BASE/fpc/bin/samplecfg
  294. $BASE/fpc/bin/fpcmkcfg -d basepath=$BASE/fpc -o $HOME/.fpc.cfg
  295.  
  296. # sudo find / -name crtbegin.o
  297. # This library needs to be added to the fpc.cfg file.
  298.  
  299. cat << EOF >> $HOME/.fpc.cfg
  300. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget
  301. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/*
  302. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/rtl
  303. -Fl$(dirname $(gcc --print-file-name=crtbegin.o))
  304. -FD$BASE/fpc/bin
  305. EOF
  306.  
  307. echo ""
  308. echo "Doing some extra configuration"
  309. echo ""
  310.  
  311. # set path withhout old fpc
  312. PATH=$(echo $PATH | sed "s|$BASE/fpc/bin\:||g")
  313.  
  314. # strip previous $BASE from .profile
  315. sed -i '/# FPC PATH/,/fi/d' $HOME/.bash_profile
  316.  
  317. cat << EOF >> $HOME/.bash_profile
  318.  
  319. # FPC PATH
  320. if [ -d $BASE/fpc/bin ] ; then
  321.     PATH="$BASE/fpc/bin:\$PATH"
  322. fi
  323. EOF
  324.  
  325. # replace all double empty lines with one
  326. sed -i '/^$/N;/^\n$/D' $HOME/.bash_profile
  327.  
  328. echo ""
  329.  
  330. fi # fpc_compile
  331.  
  332. # ======================================================
  333. # compiling lazarus
  334. # ======================================================
  335. if [ "$laz_compile" = "1" ]; then
  336.  
  337. echo "=============================================================="
  338. echo ""
  339. echo "Now compiling Lazarus, this will take some time"
  340. echo ""
  341. cd $BASE/lazarus
  342.  
  343. echo "Cleaning up"
  344. # find . -name "*.ppu" -type f -delete
  345. # find . -name "*.o" -type f -delete
  346. # make clean distclean cleanall > /dev/null 2>&1
  347. git clean -xdf > /dev/null 2>&1    # will clean untracked files and directories
  348.  
  349. echo "make -s bigide OS_TARGET=$OS_TARGET CPU_TARGET=$CPU_TARGET OPT=\"$OPTIONS_LAZ\" PP=$BASE/fpc/bin/fpc"
  350.  
  351. # make bigide OS_TARGET="linux" CPU_TARGET="x86_64" OPT="-g -gl -gw3 -v0" LCL_PLATFORM=qt5
  352. # make bigide LCL_PLATFORM=qt5
  353.  
  354. make -s bigide LCL_PLATFORM=$LCL_PLATFORM OS_TARGET=$OS_TARGET CPU_TARGET=$CPU_TARGET OPT="$OPTIONS_LAZ" PP=$BASE/fpc/bin/fpc \
  355.   | pv -l -bp >$BASE/laz.log \
  356.   || { echo >&2 "Compilation of Lazarus failed. Aborting."; exit 1; }
  357. cd $BASE
  358. [ -f ./lazarus/lazarus ] || { echo >&2 "Something went wrong compiling Lazarus. Aborting."; exit 1; }
  359.  
  360. echo ""
  361. echo "Creating desktop icon"
  362. echo ""
  363.  
  364. # ~/.local/share/applications/Lazarus.desktop
  365. # $HOME/Desktop/Lazarus.desktop
  366. # $(INSTALL_PREFIX)/share/applications/lazarus.desktop
  367.  
  368. cat << EOF > $HOME/Desktop/Lazarus.desktop
  369. [Desktop Entry]
  370. Name=Lazarus
  371. Comment=Lazarus
  372. Icon=$BASE/lazarus/images/ide_icon48x48.png
  373. Exec=$BASE/lazarus/startlazarus
  374. Path=$BASE/lazarus
  375. Type=Application
  376. Encoding=UTF-8
  377. Terminal=false
  378. Categories=None;
  379. EOF
  380.  
  381. fi
  382.  
  383. end=$(date +%s)
  384. echo "=============================================================="
  385. echo ""
  386. echo "$((($end-$begin) / 60)) minutes and $((($end-$begin) % 60)) seconds elapsed."
  387. echo ""
  388. echo "We are done. Please logout and back in before starting Lazarus"
  389. echo "Otherwise you need to supply the fpc location on 1st start"
  390. echo ""
  391. echo "=============================================================="
  392. echo ""

Awesome!

Any chance you might be able to upload this inside a ZIP file like last time, to prevent any script corruptions that may happen as we previously encountered?

rvk

  • Hero Member
  • *****
  • Posts: 6641
Any chance you might be able to upload this inside a ZIP file like last time, to prevent any script corruptions that may happen as we previously encountered?
Attached

msintle

  • Sr. Member
  • ****
  • Posts: 259
Thank you! While waiting for that I've been busy:

- Installing Lazarus from the "store" on Fedora 40
- Then installing it via FPCUPDLX, getting the GTK2 build despite requesting the Qt5 build
- Doing the rebuild as you suggested (this failed with the store version of the product, but worked with the FPCUPDLX version) so I had an actual Qt5 build
- Recompiling all my code

And bingo, the common file dialogs no longer crash my app upon cancel.

But now I have a new message printed to the command line any time I launch my app:

QSocketNotifier: Can only be used with threads started with QThread

Any thoughts on how I can fix this one? The newer build of Lazarus clearly solved my problem here, but introduced a new scary warning above.

I'll also archive and test on a clean Fedora 40 VM with your script shortly.

Edit: There were other oddities with the Lazarus Qt5 version here, most notably that window locations did not persist, the main Lazarus window could not be resized, and that upon every launch, each Lazarus window invariably appeared at a new location. Not sure if this is a trunk effect, or outright emergent sentience on part of the software that is literally coming alive with seemingly random issues on each platform we try it on.
« Last Edit: December 06, 2024, 09:30:36 pm by msintle »

msintle

  • Sr. Member
  • ****
  • Posts: 259
Just finished installing your version!

Again, the first line of Terminal output when I launched Lazarus from the Terminal (seeing as, exactly as you predicted, the Desktop shortcut was unrecognized) is exactly the same as in my post above (the part in bold).

BTW where would I expect to find the FPC sources? Right now it's scanning the whole device, including the host OS, due to folder sharing :D

rvk

  • Hero Member
  • *****
  • Posts: 6641
BTW where would I expect to find the FPC sources? Right now it's scanning the whole device, including the host OS, due to folder sharing :D
fpc executable is ~/dev/fpc/bin/fpc
The source is in ~/dev/fpc
After installing with the script it's best you logout first and then log back in.
The ~/dev/fpc/bin is then added to the path.
After starting lazarus then, the fpc executable is found.
You only need to enter the directory for the source ~/dev/fpc

I don't know why you get that warning message but it seems to be a common warning on Fedora (searching the internet for that message).

rvk

  • Hero Member
  • *****
  • Posts: 6641
BTW. I also have that warning on Fedora in Hyper-V on Intel.
But it doesn't effect running programs at all.

So you might want to check what your problems exactly are at the moment and maybe make some test programs to show those.

The not persisting Window positions do indeed seem to be a problem in Qt5 / Wayland.


Quote
rik@localhost-live:~/dev/lazarus$ ./startlazarus
QSocketNotifier: Can only be used with threads started with QThread
Info: (startlazarus) [TLazarusManager.Run] starting /home/rik/dev/lazarus/lazarus ...
Info: (startlazarus) [TLazarusManager.Run] exe=/home/rik/dev/lazarus/lazarus Params=[--started-by-startlazarus
--no-splash-screen
--force-new-instance
]
QSocketNotifier: Can only be used with threads started with QThread
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/rik/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Looking for code tools config file:  "/home/rik/.lazarus/codetoolsoptions.xml"
NOTE: codetools config file not found - using defaults
NOTE: help options config file not found - using defaults
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux--qt5 New=x86_64-linux--qt5 Changed: OS/CPU=True LCL=False
### TCodeToolManager.HandleException: [20170421194936] "no pascal code found (first token is )" in "unit1.pas"
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()


msintle

  • Sr. Member
  • ****
  • Posts: 259
Sorry I've been late in getting back to you!

For now, I'll have to wait for QA to qualify whether all known Linux issues have been resolved. According to my tests, that's certainly the case - thanks to your help in no small part!!!

Redirecting error output to a null handle tool care of the superfluous Qt5 errors on Fedora, and common file dialogs no longer crash on close.

Sadly I have a feeling QA are going to notice the window positions, of course!

rvk

  • Hero Member
  • *****
  • Posts: 6641
Sadly I have a feeling QA are going to notice the window positions, of course!
You could enable docking in the options. Then at least the windows will be visible.

msintle

  • Sr. Member
  • ****
  • Posts: 259
Sadly I have a feeling QA are going to notice the window positions, of course!
You could enable docking in the options. Then at least the windows will be visible.

I was referring to random window positions in our own app when built with Qt5 in the latest Lazarus.

What is the state of docking now, BTW? Which components are recommended to implement it? We never were able to get it working properly during our previous efforts, but it's been more than a year since we last tried.

rvk

  • Hero Member
  • *****
  • Posts: 6641
I was referring to random window positions in our own app when built with Qt5 in the latest Lazarus.
Ha yes, I see.
Strange that this isn't addressed yet.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40695

What is the state of docking now, BTW? Which components are recommended to implement it? We never were able to get it working properly during our previous efforts, but it's been more than a year since we last tried.
If AnchorDockingDsgn and DockedFormEditor are installed, you have the options under Tools > Options > Environment to enable them.
(Docking / AnchorDocking and Docked Form Editor)

I think they are installed automatically with BigIDE but not enabled by default (or you might get a setup during first start).
If not, you can install them and then you do get the setup dialog during start.


msintle

  • Sr. Member
  • ****
  • Posts: 259
Do we actually have an up-to-date best practice document and/or just component recommendation to implement cross platform docking in our own apps?

dsiders

  • Hero Member
  • *****
  • Posts: 1325
I was referring to random window positions in our own app when built with Qt5 in the latest Lazarus.

Ha yes, I see.
Strange that this isn't addressed yet.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40695

What's strange about it? It's a QT5+Wayland issue. Wayland is brain-dead and there's nothing LCL can do about that.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

rvk

  • Hero Member
  • *****
  • Posts: 6641
Ok, there is a warning about wayland.
https://wiki.freepascal.org/Qt5_Interface#Systems_using_Wayland
Although the warning mentioned another problem (not the window positions).

So wayland and Qt5/Qt6 is a no-go.

https://www.reddit.com/r/linux/comments/16vciex/lets_make_wayland_have_support_for_window/

(And wayland is becoming more and more mainstream so Qt5/Qt6 is no longer  advisable on Linux.)

dsiders

  • Hero Member
  • *****
  • Posts: 1325
Ok, there is a warning about wayland.
https://wiki.freepascal.org/Qt5_Interface#Systems_using_Wayland
Although the warning mentioned another problem (not the window positions).

So wayland and Qt5/Qt6 is a no-go.

https://www.reddit.com/r/linux/comments/16vciex/lets_make_wayland_have_support_for_window/

(And wayland is becoming more and more mainstream so Qt5/Qt6 is no longer  advisable on Linux.)

That's a lot of jumping to conclusions. Wayland is brain-dead, so use X11. If you're using a Linux distro that only offers Wayland, you're on the wrong Linux distro. QT5 and Qt6 are just fine.

The problem is the pissing contest between KDE/Gnome/Wayland. I don't care how many decades Wayland has been around now, it's still not ready for prime time if it can't display a window in a specific position or with an icon that's not in a .desktop file. Fundamental stuff.

It's simple. Just use X11. Migrate if you can't.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

msintle

  • Sr. Member
  • ****
  • Posts: 259
It's simple. Just use X11. Migrate if you can't.

It's never that simple.

While us developers could always migrate, our clients may, for whatever legitimate (or illegitimate) reasons, be unable or unwilling to migrate.

 

TinyPortal © 2005-2018