diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-20 13:19:02 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-20 13:19:02 +0100 |
commit | f8c275ead72f4492e214ce3c8a82c1926fc6ffb5 (patch) | |
tree | c8cc87a96b7e905537b72769ac711b9a65a9a5d5 /src | |
parent | 954e251ad8dc2b9c7eb0ae4f8e3eb6518aee430f (diff) | |
download | totem-f8c275ead72f4492e214ce3c8a82c1926fc6ffb5.tar.gz |
backend: Simplify code that uses the toplevel window
We're already keeping track of it for the cursor, might as well use it
in the rest of the code.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bacon-video-widget.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c index 00a5de80e..296aae16f 100644 --- a/src/backend/bacon-video-widget.c +++ b/src/backend/bacon-video-widget.c @@ -1163,7 +1163,6 @@ bvw_handle_element_message (BaconVideoWidget *bvw, GstMessage *msg) const GValue *val; GFile *file; GMountOperation *mount_op; - GtkWidget *toplevel; GstState target_state; const char *uri; @@ -1178,10 +1177,6 @@ bvw_handle_element_message (BaconVideoWidget *bvw, GstMessage *msg) GST_DEBUG ("Trying to mount location '%s'", GST_STR_NULL (uri)); - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (bvw)); - if (toplevel == GTK_WIDGET (bvw) || !GTK_IS_WINDOW (toplevel)) - toplevel = NULL; - val = gst_structure_get_value (structure, "file"); if (val == NULL) goto done; @@ -1195,7 +1190,7 @@ bvw_handle_element_message (BaconVideoWidget *bvw, GstMessage *msg) bacon_video_widget_stop (bvw); bvw->target_state = target_state; - mount_op = gtk_mount_operation_new (toplevel ? GTK_WINDOW (toplevel) : NULL); + mount_op = gtk_mount_operation_new (bvw->parent_toplevel); bvw->mount_in_progress = TRUE; bvw->mount_cancellable = g_cancellable_new (); g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE, @@ -1424,7 +1419,6 @@ done: static gboolean bvw_check_missing_auth (BaconVideoWidget * bvw, GstMessage * err_msg) { - GtkWidget *toplevel; GMountOperationClass *klass; int code; @@ -1455,8 +1449,7 @@ bvw_check_missing_auth (BaconVideoWidget * bvw, GstMessage * err_msg) GST_DEBUG ("Trying to get auth for location '%s'", GST_STR_NULL (bvw->mrl)); if (bvw->auth_dialog == NULL) { - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (bvw)); - bvw->auth_dialog = gtk_mount_operation_new (GTK_WINDOW (toplevel)); + bvw->auth_dialog = gtk_mount_operation_new (bvw->parent_toplevel); g_signal_connect (G_OBJECT (bvw->auth_dialog), "reply", G_CALLBACK (bvw_auth_reply_cb), bvw); } |