bugGNU Octave - Bugs: bug #53682, Can't study blank figure while...


bug #53682: Can't study blank figure while program is waiting for us (kbhit) to study the figure and hit a key.

Submitted by:  Dave Goel <deego>
Submitted on:  Tue 17 Apr 2018 08:33:57 PM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  4.2.2 Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Wed 18 Apr 2018 05:44:57 PM UTC, comment #6:

I can reproduce this with the fltk toolkit only with the openbox window manager. If I use the gnuplot toolkit there are no problems, the window contents are shown even if dragged off-screen or minimized and restored.

So I think this can entirely be considered the same as bug #37795, that fltk does not redraw when readline is inactive, disabled, or blocked in some way. In this case it is the kbhit function, but it can equally be a busy loop or Octave being suspended into the background.

Mike Miller <mtmiller>
Project Administrator
Tue 17 Apr 2018 10:28:34 PM UTC, comment #5:

The part of this bug that I called #1 is covered by bug #37795, so any improvements to the fltk toolkit to make it responsive when octave is busy or when readline is otherwise disabled can be discussed on that bug report. The workaround for that part of this bug is to use the qt or gnuplot toolkit, then figure redraws are not blocked by octave waiting for user input from kbhit (gnuplot is a separate process, qt uses a separate thread).

The part of this bug that I called #2 doesn't seem to be covered by any existing bug reports. There were previous reports about being unable to print a figure to a file when it was minimized or on a different virtual desktop. But again, I think this only affects the fltk toolkit, which is blocked from redrawing by the kbhit function.

So using the fltk toolkit from a script that is blocking readline from running on a non-compositing window manager is the worst possible combination of effects to produce a not-redrawn non-responsive figure window.

Mike Miller <mtmiller>
Project Administrator
Tue 17 Apr 2018 10:05:29 PM UTC, comment #4:

I can reproduce on gnome if I do the following:

1. Using graphics_toolkit fltk, create a new blank figure, then move it onto a different virtual desktop while still blank.
2. Go back to the octave prompt and run the script. If I switch to the desktop with the figure, it will still be blank until a character is entered at the prompt.

I should also mention I need to run 'more off' for the script to show the 'disp' prompt.

So this is really two problems:

1. The kbhit function does not use readline, so it does not allow the readline background event loop to run, which means fltk has no chance to redraw until the script is finished. With the qt toolkit, all drawing is done in a separate thread from the interpreter. If we do want to keep fltk on par with qt, we could add a new thread to octave-cli to handle fltk drawing without waiting for the interpreter to be idle. But I think some maintainers feel that fltk will eventually be obsolete and removed now that we have a more fully-featured qt toolkit.

2. When I run the script in gnome, the figure is fully drawn while waiting for a response at the kbhit prompt. Even moving the figure to a different desktop or minimizing it does not make the figure window blank. I think this is because gnome is a compositing window manager and does not require the client window to redraw itself after it is obscured or minimized. I will try a different window manager to see if I can reproduce that effect.

Mike Miller <mtmiller>
Project Administrator
Tue 17 Apr 2018 09:46:01 PM UTC, comment #3:

With many thanks to mtmx on #octave:

(1) mtmx points out that the problem only shows up on (my) xfce, not (his) gnome. So, is probably dependent on window managers.

(2) The problem goes away if I use the qt toolkit. To get qt, use octave instead of octave-cli.

Dave Goel <deego>
Tue 17 Apr 2018 08:50:55 PM UTC, comment #2:

Also, I can't replace kbhit by pause.
The program's next steps depend on the key that the user enters..

Dave Goel <deego>
Tue 17 Apr 2018 08:39:49 PM UTC, comment #1:

I should have mentioned:

The problem won't show up if you copy and paste this into an octave prompt.

Instead, to simulate a running program, put these in a script pbug.m and run the script.

Dave Goel <deego>
Tue 17 Apr 2018 08:33:57 PM UTC, original submission:

x=y=[0 1];

## graphics_toolkit('gnuplot'); ## problem exists both in fltk and gnuplot.



disp("Please study the figure to see my current output. Then, press any key to continue program execution.");

## Meta: to simulate real life, alt-tab or go to another workspace, and then come back to the figure. The figure will be blank and will not show up at all. You can't study the blank figure.

aa = kbhit();

## Octave is waiting for user to study figure and hit kbhit(). In the meanwhile, user can't see the figure at all.

## 4.2.2 from debian backports

Dave Goel <deego>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by deego (Submitted the item)
  • -email is unavailable- added by deego

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-18 mtmiller Open/ClosedOpen => Closed
    2018-04-18 mtmiller Dependencies- => Depends on bugs #37795
    2018-04-18 mtmiller StatusNone => Duplicate
    2018-04-17 deego Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.4