[epiphany/wip/exalm/tabs: 26/30] Fix muting
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/tabs: 26/30] Fix muting
- Date: Sat, 26 Sep 2020 08:16:34 +0000 (UTC)
commit 7dd57cb53e2d8708c19d925f06126d9538123e98
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Sep 23 03:25:19 2020 +0500
Fix muting
src/ephy-window.c | 4 ++--
src/window-commands.c | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 1ca2a0b21..ed2c99da2 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2584,7 +2584,7 @@ tab_view_setup_menu_cb (HdyTabView *tab_view,
position = hdy_tab_view_get_page_position (tab_view, page);
pinned = hdy_tab_page_get_pinned (page);
- view = ephy_embed_get_web_view (EPHY_EMBED (hdy_tab_page_get_content (page)));
+ view = ephy_embed_get_web_view (EPHY_EMBED (hdy_tab_page_get_child (page)));
audio_playing = webkit_web_view_is_playing_audio (WEBKIT_WEB_VIEW (view));
muted = webkit_web_view_get_is_muted (WEBKIT_WEB_VIEW (view));
}
@@ -2624,7 +2624,7 @@ tab_view_setup_menu_cb (HdyTabView *tab_view,
g_variant_new_boolean (muted));
action = g_action_map_lookup_action (G_ACTION_MAP (action_group),
- "close-tab");
+ "close");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), !page || !pinned);
}
diff --git a/src/window-commands.c b/src/window-commands.c
index e4092da05..bac105a65 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -2883,13 +2883,16 @@ window_cmd_change_tabs_mute_state (GSimpleAction *action,
EphyWebView *view;
gboolean mute;
- mute = g_variant_get_boolean (state);
-
- embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
+ embed = EPHY_EMBED (ephy_tab_view_get_current_page (ephy_window_get_tab_view (window)));
g_assert (embed != NULL);
view = ephy_embed_get_web_view (embed);
+ if (!webkit_web_view_is_playing_audio (WEBKIT_WEB_VIEW (view)))
+ return;
+
+ mute = !webkit_web_view_get_is_muted (WEBKIT_WEB_VIEW (view));
+
webkit_web_view_set_is_muted (WEBKIT_WEB_VIEW (view), mute);
g_simple_action_set_state (action, g_variant_new_boolean (mute));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]