bugGNU Octave - Bugs: bug #42458, fltk print doesn't produce file if...

 
 

bug #42458: fltk print doesn't produce file if window is minimized in XFCE or LXDE

Submitter:  Andreas Weber <andy1978>
Submitted:  Thu 29 May 2014 11:39:56 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  andy1978
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 26 Jul 2014 08:25:54 AM UTC, comment #11: 

This is fixed with cset c9f960441513 (http://hg.savannah.gnu.org/hgweb/octave/rev/c9f960441513) in the default branch.

Bens' print problem is also solved with glFlush ()
http://hg.savannah.gnu.org/hgweb/octave/rev/c9f960441513#l1.39

Closing report

Andreas Weber <andy1978>
Group Member
Wed 23 Jul 2014 06:14:15 PM UTC, comment #10: 

On MacOS X, I can confirm that I'm able to print when the figure window is minimized and I've built Octave using fltk_overhaul.diff.

However, if the plot only contains line objects, the lines do not show up.


figure (1)
clf ()
plot (rand(3))
print -dpdfwrite junk.pdf


The result is attached.

(file #31766)

Ben Abbott <bpabbott>
Group Member
Wed 23 Jul 2014 05:44:37 PM UTC, comment #9: 

The reason for this is different to bug #33180.

In this case it's because print_mode is set and the actually printing routine is called inside OpenGL_fltk::draw() which isn't called if the window is minimized.

The fltk_overhaul.diff here http://octave.1599824.n4.nabble.com/Overhaul-FLTK-toolkit-resize-redraw-functions-tp4665662.html will fix this.

I reopen this bug until the patch is applied to default.

Andreas Weber <andy1978>
Group Member
Thu 29 May 2014 03:49:52 PM UTC, comment #8: 

Yes, all the same basic problem that GL2PS cannot print an OpenGL buffer that is not rendered as described by Ben in comment #5. Thanks for confirming, this is already closed as a duplicate, I'll do the same for bug #40215.

Mike Miller <mtmiller>
Group Member
Thu 29 May 2014 03:45:36 PM UTC, comment #7: 

I can confirm that with XFCE4, the Map State turns to "IsUnMapped" if either minimized or moved to a different virtual desktop.

So I think this one, #40215 and #33180 all have the same origin, right?

Andreas Weber <andy1978>
Group Member
Thu 29 May 2014 03:11:18 PM UTC, comment #6: 

Thanks Andy, I can confirm this also with GNOME 2.

I think the key is to look at the "map_state" attribute of an X window. You can view this from the command line with


xwininfo -id WINDOWID | grep "Map State"


where WINDOWID is the hex window identifier of the figure. You can in turn get the ID with something like


xwininfo -tree -root | grep "Figure 1"


after the figure is opened and visible.

I see that attribute go to IsUnmapped using GNOME 2 when the figure is either minimized or moved to another virtual desktop. When I get a chance to test current GNOME 3 again, I suspect it will stay IsViewable, and printing to a file does work there.

If you can confirm with XFCE and LXDE that the attribute goes to IsUnmapped when a figure is either minimized or moved to another viewport, then it looks like it's all the same symptom. In which case, I'll add that information to bug #33180 and that can be the one bug to track being able to print an unrendered plot.

Mike Miller <mtmiller>
Group Member
Thu 29 May 2014 02:36:55 PM UTC, comment #5: 

GL2PS works by capturing the contents of the OpenGL feedback buffer (http://www.geuz.org/gl2ps/#tth_sEc5).

My understanding is that this means the OpenGL figure must be rendered, and I assume that whether or not this happens depends upon the operating system, and/or window manager.  If the virtual desktop is not rendered when it is not visible, then I don't think the print() command will function.  If the OpenGL figure isn't rendered when it is minimized, then I don't think the print() command will function.


Ben Abbott <bpabbott>
Group Member
Thu 29 May 2014 02:18:09 PM UTC, comment #4: 

Yes, I'm unable to print a plot with fltk toolkit in XFCE if the window is either minimized or on a different virtual desktop.

The LXDE test was made by a friend.

Andreas Weber <andy1978>
Group Member
Thu 29 May 2014 02:02:32 PM UTC, comment #3: 

Bug #40215 was about a plot on a different virtual desktop, not about a minimized window. When a window is on a different virtual desktop or viewport, whatever the preferred terminology, it is typically still mapped and visible (even though not visible to the user). However, different window managers may interact with X in different ways to produce the same results of minimization and virtual desktops.

Are you saying you are also unable to print a plot on a different virtual desktop in XFCE and LXDE, as well as when a window is minimized?

Mike Miller <mtmiller>
Group Member
Thu 29 May 2014 01:47:51 PM UTC, comment #2: 

And why does this not happen with gnome or, as I read from 40215, with KDE?

Andreas Weber <andy1978>
Group Member
Thu 29 May 2014 01:22:01 PM UTC, comment #1: 

To print with the OpenGL based graphics toolkits, the figure must be visible.  This is essentially the same problem as for 33180.

https://savannah.gnu.org/bugs/index.php?33180

Ben Abbott <bpabbott>
Group Member
Thu 29 May 2014 11:39:56 AM UTC, original submission:  

Run this


clear all
fn="test.png";
delete(fn);
plot(1);
print(fn);
exist(fn)


You will see a fltk window with title "Figure 1" and test.png is created. Then minimize the window and run again. This time test.png isn't created. If you now restore or maximize the figure window you might notice a slight delay and test.png gets created.

I've tested this in debian wheezy, xfce 4.8.0.3, Octave 3.8.1 and a current dev build (79f69742971a). A friend was also able to reproduce this with LXDE but not with gnome.

I think this could also be related to bug http://savannah.gnu.org/bugs/?40215

Any ideas what I could test further to track down this?

libgl2ps0 is 1.3.6-1


Andreas Weber <andy1978>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31766:  junk.pdf added by bpabbott (3KiB - application/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by andy1978 (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-07-26 andy1978 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-07-23 bpabbott Attached File- Added junk.pdf, #31766
    2014-07-23 andy1978 DependenciesRemoved dependency to bugs #33180 -
    2014-07-23 andy1978 StatusDuplicate Patch Submitted
        Assigned toNone andy1978
        Open/ClosedClosed Open
    2014-05-29 mtmiller Open/ClosedOpen Closed
        Dependencies- Depends on bugs #33180
    2014-05-29 bpabbott StatusNone Duplicate

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code