[gedit] Present and focus file chooser when shown
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Present and focus file chooser when shown
- Date: Sat, 6 Sep 2014 09:09:12 +0000 (UTC)
commit c0183e6ca3709dce80e2d21222aacb1352fd99bf
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Sep 6 11:06:45 2014 +0200
Present and focus file chooser when shown
gedit/gedit-file-chooser-dialog-gtk.c | 3 ++-
gedit/gedit-file-chooser-dialog-osx.c | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-file-chooser-dialog-gtk.c b/gedit/gedit-file-chooser-dialog-gtk.c
index 812ac46..13dd9a1 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -201,7 +201,8 @@ chooser_set_do_overwrite_confirmation (GeditFileChooserDialog *dialog,
static void
chooser_show (GeditFileChooserDialog *dialog)
{
- gtk_widget_show (GTK_WIDGET (dialog));
+ gtk_window_present (GTK_WINDOW (dialog));
+ gtk_widget_grab_focus (GTK_WIDGET (dialog));
}
static void
diff --git a/gedit/gedit-file-chooser-dialog-osx.c b/gedit/gedit-file-chooser-dialog-osx.c
index 65f932f..5fefe2f 100644
--- a/gedit/gedit-file-chooser-dialog-osx.c
+++ b/gedit/gedit-file-chooser-dialog-osx.c
@@ -42,6 +42,7 @@ struct _GeditFileChooserDialogOSXPrivate
gboolean is_open;
gboolean is_modal;
+ gboolean is_running;
GtkResponseType cancel_response;
GtkResponseType accept_response;
@@ -715,6 +716,14 @@ chooser_show (GeditFileChooserDialog *dialog)
// Keep alive for the handler
g_object_ref (dialog);
+ if (priv->is_running)
+ {
+ // Just show it again
+ [priv->panel makeKeyAndOrderFront:nil];
+ return;
+ }
+
+ priv->is_running = TRUE;
void (^handler)(NSInteger ret) = ^(NSInteger result) {
GtkResponseType response;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]