(Solved) user interface not redrawn while FQS script is running

  • 10 Replies
  • 361 Views

0 Members and 1 Guest are viewing this topic.

Online claude

  • *
  • 3f
  • ******
  • Posts: 1345
    • mathr.co.uk
« on: February 07, 2019, 11:55:18 PM »
My script here takes 18 hours on my crappy old laptop:
https://fractalforums.org/code-snippets-fragments/74/semi-stop-motion-animation-via-fqs-script/2605/msg12859#msg12859
During that time, it closes and reopens a new progress window for each frame, stealing focus from other windows on the same virtual workspace, but the contents are not drawn.  Nor are the contents of the main window redrawn.  Progress is only visible by having an image browser opened in the location where images are saved (I move the images from their subfolders to a central location periodically).

Not sure if it is isolated to my laptop's Qt version, Nouveau driver, XFCE4 wm, or something else (using Debian, hybrid of Stretch and Buster, need to fix it but only after my next gig..).

Linkback: https://fractalforums.org/fragmentarium/17/user-interface-not-redrawn-while-fqs-script-is-running/2606/
« Last Edit: February 23, 2019, 06:11:25 PM by claude, Reason: solved (display is updated now) »

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #1 on: February 08, 2019, 06:09:23 AM »
Nouveau or Mesa are not supported by FragM they are buggy, which makes debugging FragM's bugs even worse, please use the manufacturers drivers for best results, I really don't have the expertise or desire to debug GFX drivers when the manufacturers supply working drivers taylored specifically to their products features and capabilities.

edit: yes it does steal focus, not sure what to do with that ???
« Last Edit: February 08, 2019, 06:34:12 AM by 3DickUlus »
Fragmentarium is not a toy, it is a very versatile tool that can be used to make toys ;)

https://en.wikibooks.org/wiki/Fractals/fragmentarium

Online claude

  • *
  • 3f
  • ******
  • Posts: 1345
    • mathr.co.uk
« Reply #2 on: February 17, 2019, 04:55:19 AM »
update issues doesn't happen with the versions I have on my desktop (which is plain Buster, free/libre/opensource amdgpu driver, Mesa) (up and running again, with repaired motherboard).  will check if it still behaves good after upgrading FragM to the latest version before marking this thread solved...

EDIT it still steals focus, but I can workaround that by using a separate virtual workspace

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #3 on: February 17, 2019, 06:28:56 AM »
It's good to hear you're up and running again  :thumbs:

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #4 on: February 20, 2019, 01:53:04 AM »
recently mucking about with tabbed dockwidget geometry (not set properly at startup if the variable editor dock is not at top of stack when program quits, fixed now) I noticed that focus would not transfer to floating dock unless it was floated with a double click in the titlebar or closed and re-opened (as a floater) from the "Windows" menu...

did some googling (QDockWidget focus problems) and found that behavior has changed since Qt53? there is a fix for KDE linux, not sure about others, open the desktop configuration program and select Window Management -> Window Behavior -> Advanced and un-check Hide utility windows for inactive applications this fixes the focus stealing between main window and docks, this might also help with other app focus problems ie: when app is running a script but doesn't have focus and is opening/closing progress windows.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #5 on: February 23, 2019, 01:13:34 PM »
back on topic...

the script engine executes fqs script commands before the qApp starts processing gui events, why?

in Main.cpp the call to app->exec() starts the gui event loop and does not return so the script engine has to execute before that call but after new mainWin->show() that initializes the gui

I've added...
Code: [Select]
    app->processEvents();
    app->flush();
...before the script engine takes over to make sure that the gui is completely rendered once, all widgets are present and waiting for the eventloop to start.
( the above fixes blank renders on windows under script control )

making processGuiEvents() available to the script interface doesn't really make sense because it has to wait for a complete image to render before it can execute the next command.

if you want to make processGuiEvents() available to the script interface just move it from the public: section to the public slots: section in MainWindow.h

Online claude

  • *
  • 3f
  • ******
  • Posts: 1345
    • mathr.co.uk
« Reply #6 on: February 23, 2019, 04:13:49 PM »
the script engine executes fqs script commands before the qApp starts processing gui events, why?

Oh! My working test (GUI updates ok) was after launching the script manually from the edit command script dialog.

My non-working test may have been launched from command line. I can't remember. May have some time next week to confirm.

Online claude

  • *
  • 3f
  • ******
  • Posts: 1345
    • mathr.co.uk
« Reply #7 on: February 23, 2019, 06:07:59 PM »
With fresh git version, GUI now updates on my laptop when script launched from it or commandline (though sometimes it seems to stall in init, maybe due to "enable autobuild" being disabled, possible user error if my script doesn't ensure the frag is built?), but in either case the abort button does nothing (have to Ctrl-C in terminal to stop, which loses session).
Code: [Select]
function render()
{
      ...
      app.tileBasedRender();
      if (! app.scriptRunning()) return; // never returns from the function, even if abort button clicked
      ...
}
render();

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #8 on: February 24, 2019, 12:33:56 AM »
 :thumbs:

maybe...
Code: [Select]
function render()
{
      ...
      app.tileBasedRender();
      ...
}

if (app.scriptRunning()) render();

Online claude

  • *
  • 3f
  • ******
  • Posts: 1345
    • mathr.co.uk
« Reply #9 on: February 25, 2019, 11:37:34 AM »
maybe...
Won't work, as render is actually a loop that calls `app.tileBasedRender()` many times...

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1487
    • Digilantism
« Reply #10 on: February 25, 2019, 11:54:20 PM »
The intended use is for breaking out of an animation render triggered by a script.


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
411 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
question
[Solved] Color interpolation

Started by galac on Programming

5 Replies
356 Views
Last post March 02, 2019, 09:03:11 AM
by mclarekin
xx
can somebody convert this to a color smoothing/whatever script

Started by DJ Saint-Hubert on Programming

1 Replies
281 Views
Last post February 09, 2018, 06:37:24 AM
by WAUthethird
xx
programmatically get list of available presets from scripting interface?

Started by claude on Fragmentarium

2 Replies
162 Views
Last post October 08, 2019, 01:35:09 AM
by 3DickUlus
xx
Message popups, when running in batch mode

Started by CFJH on Kalles Fraktaler

3 Replies
305 Views
Last post May 28, 2018, 07:30:56 PM
by claude