bugGNU Octave - Bugs: bug #59321, window border with fltk vs. qt...

 
 

bug #59321: window border with fltk vs. qt (XFCE)

Submitter:  Muhali <muhali>
Submitted:  Thu 22 Oct 2020 04:45:38 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  3 - Low Item Group:  Other
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 29 Oct 2020 05:17:37 PM UTC, comment #22: 

I'm going to close this report as "Won't Fix".  The main graphics toolkit which Octave is developing, qt, shows Matlab compatible behavior.  The alternative toolkit, FLTK, has some funny interactions with the Window Manager, but can be worked around by using multi-line code.

Rik <rik5>
Group administrator
Mon 26 Oct 2020 05:44:40 PM UTC, comment #21: 

For the test code in Question 1 of Comment #19, here are the results of some experiments. This is with Octave 7.0.0 hg id 0e86e50bebeb on Linux with XFCE.

Multi-line  code with   QT: figure title and menu-bar go off-screen.
Multi-line  code with FLTK: figure title and menu-bar go off-screen.
Single-line code with   QT: figure title and menu-bar go off-screen.
Single-line code with FLTK: figure title and menu-bar STAY ON-SCREEN, whole figure window is visible.

Figures attached.

Definitely a weird interaction between Octave and the window manager, partially dependent on how the input is entered as well.




Anonymous
Mon 26 Oct 2020 03:52:05 PM UTC, comment #20: 

Running this in Matlab R2020b, only the lower left part of the figure is shown on-screen:

figure('units', 'normalized', 'position', [0.7 0.7 0.5 0.5])


Setting units and position separately should result in the same figure size and position. If it doesn't, that would be a (different?) bug.
For me (on Windows 10 with 6.0.92), the test code for question #1 works as expected (i.e., menu bar and figure title are off-screen).

Markus Mützel <mmuetzel>
Group administrator
Sun 25 Oct 2020 06:48:44 PM UTC, comment #19: 

This bug report seems to involve funny interactions between Octave and the Window Manager.  I'm not sure it is worth "fixing", particularly as there are simple workarounds.

Question #1 (Workaround):

Does this code place the window so that it is completely on screen?


close all
graphics_toolkit qt
hf = figure (1, "units", "normalized");
set (hf, "position", [0.5 0.5 0.5 0.5]);


Question #2 (Matlab Compatibility)

Does Matlab and Windows allow off-screen placement?


hf = figure (1, "units", "normalized", "position", [0.7, 0.7, 0.5, 0.5])


Rik <rik5>
Group administrator
Sun 25 Oct 2020 05:35:54 PM UTC, comment #18: 

It gets even more "interesting"/complicated if I do a similar test on a computer with multiple mismatched monitors...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 25 Oct 2020 05:13:13 PM UTC, comment #17: 

In my case it looks like its my window manager tricks, it seems it refuses to put windows off screen.
If I do

figure(1, 'units', 'normalized', 'position', [0.4 0.5 0.5 0.5])
figure(2, 'units', 'normalized', 'position', [0.5 0.5 0.5 0.5])
figure(3, 'units', 'normalized', 'position', [0.6 0.5 0.5 0.5])
figure(4, 'units', 'normalized', 'position', [0.7 0.5 0.5 0.5])


the figures 2,3, and 4 are on top of each other.
Both with fltk and qt graphics.

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Sun 25 Oct 2020 04:49:41 PM UTC, comment #16: 

@Dmitri: Thanks. So it looks like both graphics toolkits are failing with the exact same error for you.

Markus Mützel <mmuetzel>
Group administrator
Sun 25 Oct 2020 04:28:50 PM UTC, comment #15: 

I have fltk windows overlapped with qt windows. Menubar is on top, not off the screen.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 25 Oct 2020 10:06:05 AM UTC, comment #14: 

@Rik: You are right. I got it the wrong way round. Correct is: The graphics toolkit "qt" is compatible to Matlab (for some?), "fltk" is not (for most?).

@Dmitri: Could you specify what you mean by "Works for me as intended"? Which toolkit places the figure where?

Markus Mützel <mmuetzel>
Group administrator
Sat 24 Oct 2020 09:47:41 PM UTC, comment #13: 

@Markus: What you describe, menu bar and figure title off-screen, is what Qt already does.  So are we Matlab-compatible already?

Rik <rik5>
Group administrator
Sat 24 Oct 2020 01:27:45 PM UTC, comment #12: 

Fwiw, Matlab behaves like the fltk toolkit. I.e. the "position" property refers to the figure content (without decorations). The menu bar and figure title are off-screen if I execute the following in Matlab R2020b:

figure('units', 'normalized', 'position', [0.5 0.5 0.5 0.5])


So, if we want to be Matlab compatible, the change should be made with the qt graphics toolkit.

Markus Mützel <mmuetzel>
Group administrator
Fri 23 Oct 2020 09:15:57 PM UTC, comment #11: 

At least I understand what is happening now.

1) Octave sends a request to the window manager for a new window of a specified size in a specified location
2) The Window Manager puts the window in that location.
3) The menubar, which is an add-on uicontrol object is then added to the figure.
4) The figure is resized, but not re-positioned, to accommodate the menubar which leaves part of the figure off screen.

Have to think if there is an easy way to tackle this.


Rik <rik5>
Group administrator
Fri 23 Oct 2020 07:15:27 AM UTC, comment #10: 

that worked, figures become aligned with 'menubar' 'none'. set (h, "menubar", "figure") puts the menubar at the top edge of the canvas, but the figure border is outside (originally both menubar and border were outside).

Muhali <muhali>
Thu 22 Oct 2020 09:44:59 PM UTC, comment #9: 

There is a small chance that this is related to the menubar which is created differently between the fltk and Qt toolkits.  Can you try this code which switches off the menubar.


close all
graphics_toolkit qt
h = figure(2, "units", "normalized", "position", [0.5 0.5 0.5 0.5], "menubar", "none") ;


Is this figure properly aligned?

And what happens to the window if you now enable the menubar with


set (h, "menubar", "figure")


Rik <rik5>
Group administrator
Thu 22 Oct 2020 09:09:48 PM UTC, comment #8: 

@ Comment #7:

Used the -f flag. No difference. This is what it looks like with your two-window test.




Anonymous
Thu 22 Oct 2020 09:01:08 PM UTC, comment #7: 

This works for me as well.  I think it is something specific about your window manager and settings.  Did you try running Octave with the '-f' option to make sure there is nothing in your personal or system-wide configuration files for Octave which is affecting this?

For testing I used


graphics_toolkit fltk
figure(1, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
pause(2) ;
graphics_toolkit qt
figure(2, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
pause(2) ;


This creates a second figure for Qt rather than re-using figure 1 which is already using the FLTK toolkit.

Rik <rik5>
Group administrator
Thu 22 Oct 2020 08:54:40 PM UTC, comment #6: 

Confirmed. Attached screenshots. Yes, this did behave properly until recently and I noticed it before this bug report. One workaround I did independently was to replace figure() with subplot ("Position", [0 0 1 1]) and then at least the window buttons like maximize/minimize stayed on screen. This is not an exact fix.

It does not affect other Qt-using programs on XFCE (like QGIS). Only Octave seems to be affected.


Anonymous
Thu 22 Oct 2020 07:43:12 PM UTC, comment #5: 

Works for me as intended (on gnome).

It is probably "smart placement" or something like that. In any case I do not think it is a problem with octave.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 22 Oct 2020 07:33:46 PM UTC, comment #4: 

no change, even after disabling all window snapping. But I think it used to work (until not long ago) under cinnamon.

Muhali <muhali>
Thu 22 Oct 2020 07:27:15 PM UTC, comment #3: 

Try (notice "close all") :


octave:1> graphics_toolkit fltk
octave:2> figure(1, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
octave:3> close all
octave:4> graphics_toolkit qt
octave:5> figure(1, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
octave:6>


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 22 Oct 2020 07:17:32 PM UTC, comment #2: 

You have fltk graphics on both. The fact that it pushed off-screen is probably a trick by your windows manager.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 22 Oct 2020 06:48:41 PM UTC, comment #1: 

Could you upload a screen capture so we could see more clearly what the issue is?

Rik <rik5>
Group administrator
Thu 22 Oct 2020 04:45:38 PM UTC, original submission:  


graphics_toolkit fltk
figure(1, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
pause(2) ;
graphics_toolkit qt
figure(1, "units", "normalized", "position", [0.5 0.5 0.5 0.5]) ;
pause(2) ;


On my XFCE desktop, the script shows that qt places the window border outside the canvas, which should not happen I guess. I am not quite sure whether it also occurs with other desktops.

I am sure this has been reported already, but I couldn't find it.

Muhali <muhali>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50110:  qt-multiplelines.png added by None (197KiB - image/png)
file #50111:  fltk-multiplelines.png added by None (196KiB - image/png)
file #50112:  qt-single-line.png added by None (195KiB - image/png)
file #50113:  fltk-single-line.png added by None (200KiB - image/png)
file #50060:  rik-test.png added by None (164KiB - image/png)
file #50058:  qt.png added by None (59KiB - image/png)
file #50059:  fltk.png added by None (48KiB - image/png)
file #50055:  fltk.png added by muhali (83KiB - image/png)
file #50056:  qt.png added by muhali (88KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by muhali (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 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-29 rik5 StatusWorks For Me Wont Fix
        Open/ClosedOpen Closed
    2020-10-26 None Attached File- Added qt-multiplelines.png, #50110
        Attached File- Added fltk-multiplelines.png, #50111
        Attached File- Added qt-single-line.png, #50112
        Attached File- Added fltk-single-line.png, #50113
    2020-10-25 rik5 Priority5 - Normal 3 - Low
    2020-10-22 None Attached File- Added rik-test.png, #50060
    2020-10-22 rik5 StatusNeed Info Works For Me
    2020-10-22 None Attached File- Added qt.png, #50058
        Attached File- Added fltk.png, #50059
    2020-10-22 muhali Attached File- Added fltk.png, #50055
        Attached File- Added qt.png, #50056
    2020-10-22 rik5 Item GroupNone Other
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code