mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Use a GTK grab when showing a modal GtkFileChooserNativeWin32
This commit is contained in:
parent
7cef454c86
commit
c138aaabf3
@ -41,6 +41,7 @@
|
||||
#include "gtktogglebutton.h"
|
||||
#include "gtkheaderbar.h"
|
||||
#include "gtklabel.h"
|
||||
#include "gtkmain.h"
|
||||
#include "gtkfilefilterprivate.h"
|
||||
#include "gtknative.h"
|
||||
|
||||
@ -50,6 +51,9 @@
|
||||
|
||||
typedef struct {
|
||||
GtkFileChooserNative *self;
|
||||
|
||||
GtkWidget *grab_widget;
|
||||
|
||||
IFileDialogEvents *events;
|
||||
|
||||
HWND parent;
|
||||
@ -318,6 +322,12 @@ filechooser_win32_thread_data_free (FilechooserWin32ThreadData *data)
|
||||
if (data->events)
|
||||
IFileDialogEvents_Release (data->events);
|
||||
|
||||
if (data->grab_widget)
|
||||
{
|
||||
gtk_grab_remove (data->grab_widget);
|
||||
g_object_unref (data->grab_widget);
|
||||
}
|
||||
|
||||
g_clear_object (&data->current_folder);
|
||||
g_clear_object (&data->current_file);
|
||||
g_free (data->current_name);
|
||||
@ -969,6 +979,12 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (data->modal)
|
||||
{
|
||||
data->grab_widget = g_object_ref_sink (gtk_label_new (""));
|
||||
gtk_grab_add (GTK_WIDGET (data->grab_widget));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user