Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#14855 closed defect (fixed)

Toolbar tools not disabled when showing modal dialogs in wxGTK under Unity

Reported by: michalbliznak Owned by:
Priority: critical Milestone: 2.9.5
Component: wxGTK Version: stable-latest
Keywords: modal dialogs toolbar tools Cc:
Blocked By: Blocking:
Patch: no

Description

Similarly to ticket #14823, also toolbar's tool buttons are still accessible if a dialog is shown in modal mode via ShowModal() fcn in wxGTK (under both Unity and Gnome-Shell DEs, Ubuntu 12.04). It looks like the problem with modal dialogs is common in whole wxGTK 2.9.5 GUI subset.

Change History (13)

comment:1 Changed 2 years ago by vadz

This is worse than the other issue because that only affected the global menu bar which kind of made sense as it wasn't part of the application itself. If the main window is not disabled neither this would mean that the modality is completely broken and, worse, we can't even work around this by disabling the global menu bar.

Does this happen in the toolbar sample?

comment:2 Changed 2 years ago by michalbliznak

Yes, it happens in toolbar sample as well. See attached screencasts.

In the firts one, I modified the toolbar sample code to show standard wxFileDialog by using ShowModal() function if "Open" tool is clicked:

http://zamestnanci.fai.utb.cz/~bliznak/screencast/modality_issue/modality_issue1.webm

Second screencast shows my application (CodeDesigner RAD). Here you can see that some modal dialogs work as expected (Diagram bank, Project settings) but another one (Manage plugins) is still broken, (i.e. main menu is still accessible) but thanks to your previous patch the menu items are disabled. If I try to open wxFileDialog (from both main menu and toolbar) then the modality is also broken. Moreover, if opened from the toolbar then I can still open more than one instance, which consequently breaks the application so neither menu items nor toolbar tools can be used (I have to kill the app from outside).

http://zamestnanci.fai.utb.cz/~bliznak/screencast/modality_issue/modality_issue2.webm

Note that both applications are built by using wxWidets 2.9.5 (latest trunk code) with global menu patch applied.

comment:3 Changed 23 months ago by vadz

  • Status changed from new to infoneeded_new

I can't reproduce the problem in the sample. It already shows wxFileDialog, just press Ctrl-B (corresponding to the "Choose bitmap..." menu command) to show it. But the toolbar buttons are correctly disabled for me in the default Unity DE of Ubuntu 12.04.

So could it be to the local modifications you're using? I've tested with unmodified r73167 from svn.

comment:4 Changed 23 months ago by michalbliznak

  • Status changed from infoneeded_new to new

I can confirm that with r73186 the issue has disappeared. Now it works as expected.

comment:5 Changed 23 months ago by michalbliznak

This is weird... I updated to the latest trunk code now (r73186, the revision in my previous post should be r73178), rebuilt both wxWidgets and toolbar sample and the problem is here again. I use additional Gnome 3 Team PPA with some packages updated so I'll try to purge the modified packages and revert to "vanila" Gnome 3 shipped with Ubuntu 12.04.

comment:6 Changed 23 months ago by michalbliznak

So, downgrade of Gnome 3 didn't help me but I've found out that the issue was really fixed in r73178 but it is here again in r73186. I tried to switch between those releases several times and the behaviour is always as described.

comment:7 Changed 23 months ago by vadz

  • Status changed from new to infoneeded_new

Could this be somehow related to overlay scrollbars too? I really don't see how but the only relevant difference between these revisions is that the earlier one set LIBOVERLAY_SCROLLBAR to 0 in startup while the latter doesn't.

IOW does the issue disappear for you if you run

LIBOVERLAY_SCROLLBAR=0 ./samples/toolbar/toolbar

?

This would be crazy but otherwise I simply don't see any explanation at all.

comment:8 Changed 23 months ago by michalbliznak

  • Status changed from infoneeded_new to new

Yes, the issue is caused by overlay toolbar somehow; see this screencast:

[zamestnanci.fai.utb.cz/~bliznak/screencast/modality_issue/modality_issue3.webm]

Moreover, modality issues in main application menus disappear too when the overlay toolbar is disabled.

comment:9 follow-up: Changed 23 months ago by vadz

Aaaaaargh. I need a T-shirt with "I hate Ubuntu" on it.

Looks like finally we will need to disable the overlay scrollbars in spite of Paul's work on #14871. Because I have no idea what to do about this :-(

Could anybody please test this under 12.10? Is it still broken there too or do we need to disable scrollbars for 12.04 only?

comment:10 in reply to: ↑ 9 Changed 23 months ago by dghart

Replying to vadz:

Could anybody please test this under 12.10? Is it still broken there too or do we need to disable scrollbars for 12.04 only?

Sadly it happens in 12.10 too, even in the otherwise-sane LXDE when I temporarily reinstall the 'overlay-scrollbar' package.

comment:11 Changed 23 months ago by PC

  • Resolution set to fixed
  • Status changed from new to closed

(In [73196]) Fix for toolbars and menus not being disabled on Ubuntu

Ubuntu overlay scrollbar changes the GtkWindowGroup for its toplevel, which is
disastrous for modal windows. Put in a hack to detect and undo this.
Fixes #14855

comment:12 Changed 23 months ago by pcor

I suspect r73196 might also fix the "global menubar" problem.

comment:13 Changed 23 months ago by dghart

I confirm that r73196 fixes this bug, testing on 12.10 unity with overlay-scrollbar installed.

I suspect r73196 might also fix the "global menubar" problem

Unfortunately not. The global menu still appears and visually seems active. After reverting r73007 the menuitems again work e.g. I could fire a second modal dialog.

Note: See TracTickets for help on using tickets.