Ubuntu

Dialog windows are not turning modal anyway

Reported by Vinícius de Ávila Jorge on 2011-12-12
116
This bug affects 23 people
Affects Status Importance Assigned to Milestone
Claws Mail
Invalid
Medium
overlay-scrollbar
Undecided
Unassigned
overlay-scrollbar (Ubuntu)
Undecided
Unassigned

Bug Description

When I create any GtkDialog in my application, i set these two methods: set_transient_for(parent_window) and set_modal(true), so I can block any interaction with the app until close the dialog. This approach works very good except when any child dialog widget uses scrollbars, for example, GtkFileChooserWidget or GtkScrolledWindow. This time, when I run dialog, some widgets from parent window, as GtkButton or GtkComboBox, are not blocking interaction. To reproduce, run this python script:

#!/usr/bin/python
from gi.repository import Gtk

def button_on_clicked(button, parent):
    fch = Gtk.FileChooserDialog()
    fch.set_transient_for(parent)
    fch.set_modal(True)
    fch.show_all()
    fch.run()

win = Gtk.Window()
btn = Gtk.Button("Click me!")
win.add(btn)
btn.connect('clicked', button_on_clicked, win)
win.set_position(Gtk.WindowPosition.CENTER)
win.show_all()
win.connect('destroy', Gtk.main_quit)
Gtk.main()

When I uninstall the overlay-scrollbar and liboverlay-scrollbar* packages, and restart unity/gnome-shell, the overlay are disabled and the problem is gone. Run the script above with and without overlay scrollbars and compare results. The issue can be reproduced in C++ and Python wrappers to GTK3 (gtkmm-3 and gi.repository.Gtk, respectively). I believe this is an overlay scrollbars issue with GTK3, reproduzible with pure C GTK3 or any GTK3 wrapper. I don't know if this issue affects GTK2.

The workaround for me is disable overlay scrollbars to solve my issue.

vinicius@OneiricLinux:~$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

vinicius@OneiricLinux:~$ apt-cache policy overlay-scrollbar
overlay-scrollbar:
  Instalado: (nenhum)
  Candidato: 0.2.11-0ubuntu1
  Tabela de versão:
     0.2.11-0ubuntu1 0
        500 http://br.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages

What I expected to happen: setting any child dialog modal property to true, all parent window widgets would be blocked.
What happened: some widgets, GtkButton, GtkComboBox, are not blocking.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: overlay-scrollbar (not installed)
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Mon Dec 12 15:18:17 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 LANGUAGE=pt_BR:pt:en
 PATH=(custom, no user)
 LANG=pt_BR.UTF-8
 SHELL=/bin/bash
SourcePackage: overlay-scrollbar
UpgradeStatus: No upgrade log present (probably fresh install)

I can add: This also affects GTK2 applications! In my opninion it's a very severe bug!

I'm developing an application (It's compatible to GTK2 and GTK3 and this problem persists regardless of the GTK version used) and I want to prevent users doing some nasty stuff while the dialog is opened. This is impossible! It affects also all GtkFileChoosers since there are many ScrollBars inside... you can test it with Gedit's save-as dialog.

In my opinion this exposes severe risks concerning application misbehaviour since many applications won't work as the developer intended them to work...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in overlay-scrollbar (Ubuntu):
status: New → Confirmed
davidcaste (davidcaste) wrote :

The only workaround I found is to uninstall the package "overlay-scrollbar", or disable the overlay scrollbars selectively:

#!/usr/bin/python
import os
os.environ['LIBOVERLAY_SCROLLBAR'] = '0'
from gi.repository import Gtk
...

Clint Rogers (clinton-yorba) wrote :

This is known to severely break at least one upstream package; please see http://redmine.yorba.org/issues/4591.

Zicu Radu (zradu1100) wrote :

Confirm this bug:

When I create a custom dialog in GTK (both, GTK2 or GTK3) and set it to be modal, all input to other windows of my application is ignored. This works nearly always, but it fails under certain conditions.

When I add a ScrolledWindow containing a TreeView to my dialog, it still works as supposed. But if I fill the TreeView with entries until the ScrolledWindow starts to display its scroll bars --- the modality is suddenly lost and I can click on my other windows!

On GNU/Linux Debian ubuntu 13.04 (32bits or 64bits), using the official 3.8.1 claws mail or the PPA 3.9.1 claws mail, the window managers (gnome 3 or unity or openbox(lxde)) do loose some popup windows. Have to kill the application.

To reproduce, try to configure a filter, you should "loose" a popup in the process, the popup is unresponsive and you are then stuck. It did happen for several different popups.

re-opened because I modified the wrong bug report!!

Tried with lxde and Claws 3.9.2 and it works fine for me.

I suspect that, if anything, it's mishandling of modal windows in unity, and that rather than losing a window it's actually a modal window that wrongly goes behind another window, thus making the presented window appear to be unresponsive.

This is not specific to unity. As I wrote down, it seems all window managers are affected. What I forgot to write down, sylpheed (the "other one") is affected by the same bug (evolution is not).

I saw what you wrote but, nevertheless, not all window managers are affected. Of the 3 you listed, I tried lxde and could not reproduce the problem.

evolution is gtk3. sylpheed, like claws-mail is gtk2.

Then it would be GNU/Linux Debian Ubuntu specific, with high suspicion on their gtk2 build.

This report could be relevant:
https://bugs.launchpad.net/ubuntu/+source/overlay-scrollbar/+bug/903302

Do you have the overlay-scrollbar packages installed?

Tested: popup windows now responsive after full overlay-gtk removal.

Great work!

moving the bug to proper faulty components.

Confirmed in ubuntu 13.04 (x86 and x86-64). In claws or sylpheed which are gtk2 applications, some modal boxes can become unresponsive with scrollbar overlay installed (add a proper filter in claws to reproduce). Everything works back to normal when the scrollbar ovrelay is removed.

Changed in claws-mail:
importance: Unknown → Medium
status: Unknown → Invalid

*** Bug 2920 has been marked as a duplicate of this bug. ***

*** Bug 2694 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.