GtkFileChooserDialog does not act as modal
<p>I have a <a href="https://paste.gnome.org/pvxwgixip/lyrvkg" rel="nofollow">custom</a> <code>GtkFileChooserDialog</code> created with Glade. The <code>Modal</code> property is marked.
I also have a <code>GtkFileChooserButton</code> that uses this <code>GtkFileChooserDialog</code> as its dialog:</p>

<pre><code>class ImgChooserBttWithCapture(Gtk.FileChooserButton):
    """
    The custom Gtk.FileChooserButton and Gtt.FileChooserDialog with a button for call capture app
    """

    def __init__(self, cap_app_path):
        self.builder = Gtk.Builder.new_from_file(
            UIS_PATH + 'images_chooser_dialog.xml')
        self.chooser_dialog = self.builder.get_object('icd_photo_chsrdialog')

        super().__init__(dialog=self.chooser_dialog)
        self.cap_app_path = cap_app_path
        self.set_title('Selecione uma imagem')
        self.set_halign(Gtk.Align.START)
        self.set_valign(Gtk.Align.FILL)
        self.set_hexpand(True)
        self.set_tooltip_text('Clique para escolher uma nova imagem')
        self.set_local_only(False)

        handlers = {'onCaptureButtonClicked': self._on_capture_button_clicked}

        self.builder.connect_signals(handlers)

    def _on_capture_button_clicked(self, button):

        try:
            subprocess.call([self.cap_app_path])
        except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as ex:

            self.builder.add_from_file(UIS_PATH + 'information_window.xml')
            msg_dialog = self.builder.get_object('iw_messagedialog')

            msg_dialog.set_title('Erro')
            msg_dialog.set_markup(
                '&lt;span size="12000"&gt;&lt;b&gt;NÃ£o foi possÃ­vel abrir o aplicativo&lt;/b&gt;&lt;/span&gt;')

            msg_dialog.format_secondary_markup(
                'O aplicativo de captura nÃ£o estÃ¡ disponÃ­vel.\nVerifique o caminho para o aplicativo de caputura em configuraÃ§Ãµes.\n' + '&lt;span foreground="red"&gt;&lt;u&gt;' + str(ex) + '&lt;/u&gt;&lt;/span&gt;')

            msg_dialog.set_property('message-type', Gtk.MessageType.ERROR)
            msg_dialog.set_transient_for(self.chooser_dialog)
            self.builder.get_object('iw_message_image').set_from_file(
                'views/uis/images/message_error.png')

            msg_dialog.run()
            msg_dialog.destroy()
</code></pre>

<p>But, when I click on the button, the dialog is not modal, that is, I can interact with the other window.</p>

<p>Would <a href="http://stackoverflow.com/a/39873728/1981374">grabbing</a> the pointer work for you?</p>

<pre><code>//pass all events to window apart LEAVE_NOTIFY_MASK 
MainWindow-&gt;set_events(GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_TOUCHPAD_GESTURE_MASK);
MainWindow-&gt;set_modal(true);
auto display = MainWindow-&gt;get_display();
auto window = MainWindow-&gt;get_window();
auto grabSuccess = display-&gt;get_default_seat()-&gt;grab(window, Gdk::SEAT_CAPABILITY_ALL, true);
if(grabSuccess != Gdk::GRAB_SUCCESS)
{
    std::clog&lt;&lt;"grab failed: "&lt;&lt;grabSuccess&lt;&lt;std::endl;
}
</code></pre>

python gtk gtk3 pygobject