bugGNU Octave - Bugs: bug #43960, reset (figure) on invisible figure...

 
 

bug #43960: reset (figure) on invisible figure causes it to flash

Submitter:  Rik <rik5>
Submitted:  Fri 09 Jan 2015 06:13:19 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  In Progress Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 07 Feb 2015 02:47:10 PM UTC, comment #6: 

Hi,

I have pushed a changeset [1] that resolves the issue of multiply set properties when an object is reset.

I think that in the future "override_defaults" function should be rewritten to use the same mechanism as xreset_default properties, but for the time being I leave it as is.

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/e7df12f37f71

Pantxo Diribarne <pantxo>
Group Member
Mon 02 Feb 2015 04:14:14 PM UTC, comment #5: 

Hi,

I have pushed a minimal changeset [1] that removes the "outerposition" property from the list of reset properties. This way fltk will blink as Qt toolkit.

Making reset not flash a figure will involve more refactoring so I am leaving that for the time being.
override_defaults is not run in a simple for loop: all parent defaults have to be set. The current way of doing this is a bit intricate and has to be changed if we want to set only the prop/val finally intend to. For example we could create a "get_ancestors defaults" function and merge the ancestors defaults with factory defaults before calling xreset_default_properties

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/50f14692e33b

Pantxo Diribarne <pantxo>
Group Member
Mon 02 Feb 2015 04:01:54 PM UTC, comment #4: 

For the flash portion, it would seem that we need to merge the list of property values from the defaults and the user overrides before applying them all at once.

My understanding is that instead we use a for loop to apply all of the factory defaults and then another for loop to apply all of the user's overrides.  This serial application of properties causes the flash.

I don't know if this is the optimal way, but it seems like you could use a hash, i.e. std::map in C++, to do this.  Use a for loop over the base properties to create key/value pairs.  And then use a second loop to load in any additional use overrides.  Finally write out all of the properties in the hash.  We could even be clever about it and pre-define a static variable hash which contains all of the factory defaults.  That way we could eliminate the first for loop and only process the user overrides.

Rik <rik5>
Group administrator
Mon 12 Jan 2015 08:30:09 AM UTC, comment #3: 

Hi,

I think I have found the origin of the bug with fltk: the "outerposition" is set to its factory value ([-1 -1 -1 -1]). Looks like qt toolkit can handle this strange value ... I'll propose a fix in the coming days for this one.

For the flash, the fix is not as "easy" as I said. I'll think of it.

Pantxo Diribarne <pantxo>
Group Member
Sun 11 Jan 2015 07:54:42 PM UTC, comment #2: 

The position issue may be platform dependent.  The value is different from before the reset, but not off-screen.


run-octave -f --no-gui-libs
set (0, "defaultfigurevisible", "off");
hf = figure ();
plot (1:10);
pos1 = get (hf, "position")
reset (hf);
pos2 = get (hf, "position")


The result is:


pos1 =

   300   200   560   420

pos2 =

   304   175   560   420


There has been a shift in the origin point of the window, but not the length and width.  And I don't see negative numbers for length and width which make no sense.




Rik <rik5>
Group administrator
Sun 11 Jan 2015 05:04:19 PM UTC, comment #1: 

Hi,

There seams to be 2 issues here.
*The first flash happens whether using fltk or qt toolkits. It is due to the implementation: "visible" is first set to the factory default ("on") before being reset to user default ("off").
*In fltk (not qt) the position property changes during the reset process. This is why the flash doesn't seam to happen during the second reset: the figure is actually often out of screen.


graphics_toolkit fltk
set (0, "defaultfigurevisible", "off");
hf = figure ();
plot (1:10);
reset (hf)
pos = get (hf, "position")
=>pos =

   -1   21   -1  -48


The first issue may be solved easily, but we have to figure out why the second happens.

Pantxo Diribarne <pantxo>
Group Member
Fri 09 Jan 2015 06:13:19 AM UTC, original submission:  

The current test suite flashes a plot figure briefly when running 'make check'.  It seems that this can be condensed to calling reset on a hidden figure.


graphics_toolkit fltk
set (0, "defaultfigurevisible", "off");
hf = figure ();
plot (1:10);
reset (hf)          # causes flash
reset (hf)          # no flash, and no further flashes



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-07 pantxo Open/ClosedOpen Closed
    2015-01-12 pantxo StatusConfirmed In Progress
    2015-01-11 pantxo StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code