[gnome-control-center/user-accounts-avatar-chooser-set-transient-for] users: Make FileChooser inside AvatarChooser transient to main window
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/user-accounts-avatar-chooser-set-transient-for] users: Make FileChooser inside AvatarChooser transient to main window
- Date: Thu, 3 Mar 2022 14:44:37 +0000 (UTC)
commit 64f4e3f699a6d80ad0c3ea7c95fb702fc070c616
Author: Felipe Borges <felipeborges gnome org>
Date: Thu Mar 3 15:42:23 2022 +0100
users: Make FileChooser inside AvatarChooser transient to main window
Depends on
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1253
Fixes #1677
panels/user-accounts/cc-avatar-chooser.c | 8 +++++---
panels/user-accounts/cc-avatar-chooser.h | 2 +-
panels/user-accounts/cc-user-panel.c | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/panels/user-accounts/cc-avatar-chooser.c b/panels/user-accounts/cc-avatar-chooser.c
index a5e4f3c6d..a8b88a148 100644
--- a/panels/user-accounts/cc-avatar-chooser.c
+++ b/panels/user-accounts/cc-avatar-chooser.c
@@ -43,6 +43,8 @@
struct _CcAvatarChooser {
GtkPopover parent;
+ GtkWidget *transient_for;
+
GtkWidget *crop_area;
GtkWidget *user_flowbox;
GtkWidget *flowbox;
@@ -158,7 +160,7 @@ cc_avatar_chooser_select_file (CcAvatarChooser *self)
GtkFileFilter *filter;
GtkWindow *toplevel;
- toplevel = (GtkWindow*) gtk_widget_get_native (GTK_WIDGET (self));
+ toplevel = (GtkWindow*) gtk_widget_get_native (GTK_WIDGET (self->transient_for));
chooser = gtk_file_chooser_dialog_new (_("Browse for more pictures"),
toplevel,
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -348,13 +350,13 @@ setup_photo_popup (CcAvatarChooser *self)
}
CcAvatarChooser *
-cc_avatar_chooser_new ()
+cc_avatar_chooser_new (GtkWidget *transient_for)
{
CcAvatarChooser *self;
self = g_object_new (CC_TYPE_AVATAR_CHOOSER,
NULL);
-
+ self->transient_for = transient_for;
self->thumb_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
setup_photo_popup (self);
diff --git a/panels/user-accounts/cc-avatar-chooser.h b/panels/user-accounts/cc-avatar-chooser.h
index 2e9e2c764..879e482d9 100644
--- a/panels/user-accounts/cc-avatar-chooser.h
+++ b/panels/user-accounts/cc-avatar-chooser.h
@@ -31,7 +31,7 @@ G_DECLARE_FINAL_TYPE (CcAvatarChooser, cc_avatar_chooser, CC, AVATAR_CHOOSER, Gt
typedef struct _CcAvatarChooser CcAvatarChooser;
-CcAvatarChooser *cc_avatar_chooser_new (void);
+CcAvatarChooser *cc_avatar_chooser_new (GtkWidget *transient_for);
void cc_avatar_chooser_free (CcAvatarChooser *dialog);
void cc_avatar_chooser_set_user (CcAvatarChooser *dialog,
ActUser *user);
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 96278fad5..d2481a48f 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -1384,7 +1384,7 @@ setup_main_window (CcUserPanel *self)
g_signal_connect_object (self->um, "notify::is-loaded", G_CALLBACK (users_loaded), self,
G_CONNECT_SWAPPED);
}
- self->avatar_chooser = cc_avatar_chooser_new ();
+ self->avatar_chooser = cc_avatar_chooser_new (GTK_WIDGET (self));
gtk_menu_button_set_popover (self->user_avatar_edit_button,
GTK_WIDGET (self->avatar_chooser));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]