bugGNU Octave - Bugs: bug #54720, Opening a msgbox, warndlg etc....

 
 

bug #54720: Opening a msgbox, warndlg etc. after dialog freezes octave

Submitter:  Gilad Orr <gilo>
Submitted:  Mon 24 Sep 2018 06:29:29 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Gilad 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

Tue 09 Oct 2018 05:17:45 PM UTC, comment #17: 

I tested with the original example and it now works.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Mon 08 Oct 2018 07:22:56 AM UTC, comment #16: 

I pushed the patch for bug #42490. Marking this bug "Ready for Test".

Pantxo Diribarne <pantxo>
Group Member
Tue 02 Oct 2018 07:54:09 PM UTC, comment #15: 

@Rik: this is not properly a duplicate and this bug could probably be solved some other way, but the patch I posted for bug #42490 makes Octave be more Matlab compatible and this bug disappears.

Pantxo Diribarne <pantxo>
Group Member
Thu 27 Sep 2018 03:33:15 PM UTC, comment #14: 

@Pantxo: So is this, in effect, a duplicate of bug #42490?  Should we close this one and keep the original open?

Rik <rik5>
Group administrator
Wed 26 Sep 2018 08:21:05 AM UTC, comment #13: 

@gilo: I read the Matlab documentation again and here is what I understand (I'll assume that msgbox is only a modal dialog box in disguise, see bug #42490)

>> When multiple modal windows exist, the most recently created window keeps focus and stays above all other windows until it becomes invisible, or is returned to a normal window style, or is deleted. At that time, focus reverts to the window that last had focus.


This explains why when you create two modal dialogs consecutively the second is above the first.

Now, in the second case where we create a non-modal figure after a modal dialog the figure should be created and displayed below the dialog. This looks like a Matlab bug.

I think this bug depends mostly on resolving bug #42490 since if I do


dialog (); dialog ("name", "msgbox"); ## the second is a modal msgbox


I obtain the same behavior as in ML. And



dialog (); figure (); ## the second is non modal


The figure is displayed bellow as I would expect.

Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 10:03:22 PM UTC, comment #12: 

Both above, the last one created has the focus.

Gilad Orr <gilo>
Tue 25 Sep 2018 09:41:49 PM UTC, comment #11: 

@gilo: I have a few other interrogations.

  • If you run your original example in Matlab from a script is the msgbox created until the dialog is closed? If so is it above or below the dialog?
  • Same questions if you replace the msgbox by a simple non modal figure.


Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 09:16:10 PM UTC, comment #10: 

Rik - I was confused about that at first too. But if you read a bit further to the "Output Arguments" section, the table of properties shows that the default for a dialog is 'modal'.

Mike Miller <mtmiller>
Group Member
Tue 25 Sep 2018 09:11:28 PM UTC, comment #9: 

@Rik, I tested it it is modal

Tested on 2014 up to 2017 calling (opening) a dialog/window/messagebox/warning from a dialog or code works without any issues.

Gilad Orr <gilo>
Tue 25 Sep 2018 08:10:09 PM UTC, comment #8: 

It would be useful to have the behavior tested.  In particular, even though the Matlab help for dialog refers to "Create empty modal dialog box", the documentation says that the default WindowStyle property is non-modal.  For starters, could someone try


h1 = dialog('name', 'Dialog 1');
get (h1, 'WindowStyle')


on a recent version of Matlab?

Rik <rik5>
Group administrator
Tue 25 Sep 2018 06:24:05 PM UTC, comment #7: 

From the Matlab help for 'dialog' [1]:


'modal' — The figure displays on top of all existing figure windows, making them inaccessible as long as the top figure exists and remains modal. However, any new figures created after a modal figure will display.

When multiple modal windows exist, the most recently created window keeps focus and stays above all other windows until it becomes invisible, or is returned to a normal window style, or is deleted. At that time, focus reverts to the window that last had focus.



Modal Window Style Behavior

When WindowStyle is set to 'modal', the figure window traps all keyboard and mouse actions over all MATLAB windows as long as the windows are visible. Windows belonging to applications other than MATLAB are unaffected.

Typing Ctrl+C when a modal figure has focus causes that figure to revert to a 'normal' WindowStyle property setting. This allows the user to type at the command line.

Figures with the WindowStyle property set to 'modal' and the Visible property set to 'off' do not behave modally until MATLAB makes them visible. Therefore, you can hide a modal window for later reuse, instead of destroying it.

Modal figures do not display menu children, built-in menus, or toolbars. But, it is not an error to create menus in a modal figure or to change the WindowStyle property setting to 'modal' on a figure with menu children. The Menu objects exist and the figure retains them. If you reset the figure's WindowStyle property to 'normal', the menus display.


So it should be possible to create other figures, and I guess that includes msgbox and related 'dlg' functions. It doesn't say explicitly, so it might be helpful for someone with Matlab access to test how dialog and msgbox work together.

[1]: https://www.mathworks.com/help/matlab/ref/dialog.html

Mike Miller <mtmiller>
Group Member
Tue 25 Sep 2018 04:17:01 PM UTC, comment #6: 

Modal windows are supposed to preempt all other aspects of the GUI until they have been dealt with so it shouldn't be a problem.

Rik <rik5>
Group administrator
Tue 25 Sep 2018 04:15:04 PM UTC, comment #5: 

If you block new windows, it will limit program interaction with the user using the GUI.

Gilad Orr <gilo>
Tue 25 Sep 2018 03:56:44 PM UTC, comment #4: 

Confirmed as well.  This could also be a problem with the dialog code itself.  The example from the help text for dialog


## create an empty dialog window titled "Dialog Example"
h = dialog ("name", "Dialog Example");

## create a button (default style)
b = uicontrol (h, "string", "OK",
                  "position", [10 10 150 40],
                  "callback", "delete (gcf)");

## wait for dialog to resume or close
uiwait (h);


doesn't work for me.  The callback is never activated and I have to close the window in order for it to work.  In 4.2.2 the code stops after the uicontrol object is created, which works, but then the uiwait code fails because there is no handle h.

Rik <rik5>
Group administrator
Tue 25 Sep 2018 03:53:39 PM UTC, comment #3: 

FWIW, trying to run the code in the command line, one line after the other, with the GUI enabled works as expected. Since the "dialog" is modal (as expected by default) you can't type the second line before you have closed the first dialog.

Looks like we should prevent any new window from being created (or being activated) if there is a modal window currently displayed.

Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 03:20:20 PM UTC, comment #2: 

This example hangs for me in Octave 4.4.1 and the development version. If the gnuplot toolkit is active instead, it does not hang.

It seems to me that the 'Dialog 1' window is stealing focus back every time the 'Some message' window tries to get focus. But the dialog window is blocked from being closed even though it retains focus.

Mike Miller <mtmiller>
Group Member
Mon 24 Sep 2018 10:32:39 PM UTC, comment #1: 

Octave 4.2.2 is deprecated and no longer supported.  Please try with the latest stable version, 4.4.1, to see whether this has been fixed.

Rik <rik5>
Group administrator
Mon 24 Sep 2018 06:29:29 PM UTC, original submission:  

The following code freezes octave

h1 = dialog("name", "Dialog 1");
h2 = msgbox("Some message");

Somehow the buttons on the message box, warning dialog, question dialog etc. loose focus to an extent that I must kill octave and reload it.

Gilad Orr <gilo>

 

(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 (Posted a comment)
  • -email is unavailable- added by gilo (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-09 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-10-08 pantxo StatusConfirmed Ready For Test
        Release4.4.1 dev
    2018-09-25 mtmiller CategoryGUI Plotting with OpenGL
        Item GroupNone Other
        StatusNeed Info Confirmed
        Release4.2.2 4.4.1
    2018-09-24 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code