1
0
mirror of https://github.com/dguglielmi/sunny-overlay.git synced 2025-12-06 22:32:37 +01:00

- Add fix for totem.

This commit is contained in:
2015-05-03 14:25:06 +02:00
parent a9e9aaf986
commit de52f801cf
18 changed files with 879 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
From ef3da6bbf05dfdc8d0c289f3134b67f3eea925e9 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 11 Feb 2015 11:49:47 +0100
Subject: build: Bump required grilo for GRL_METADATA_KEY_TITLE_FROM_FILENAME
https://bugzilla.gnome.org/show_bug.cgi?id=744315
diff --git a/configure.ac b/configure.ac
index 65e3069..20ec003 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ VALA_REQS=0.14.1
PEAS_REQS=1.1.0
PYTHON_REQS=2.3
PYGOBJECT_REQS=2.90.3
-GRILO_REQS=0.2.10
+GRILO_REQS=0.2.11
GRILO_PLS_REQS=0.2.1
LIBXML_REQS=2.6.0
--
cgit v0.10.2

View File

@@ -0,0 +1,83 @@
From ea29374ebcdb0877832f6eeb61451571bb13bdc4 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 22 Apr 2015 13:28:38 +0200
Subject: main: Fix (again) doubling files added on the cmd line
When handling local command-line options, we would process all the
options and send them as "remote" commands through totem. But the
"remote-command" action would activate the application first. Thus we
would do something like:
- process command-line options in totem_object_app_handle_local_options()
which calls totem_options_process_for_server(), which sends out
"remote-command" actions
- when handling "remote-command", to make sure that the application is
actually ready, we call "activate".
- but we didn't clear the filenames struct member in optionstate, so we
process it again in "activate"
With help from Carlos Maddela <maddela@labyrinth.net.au>
https://bugzilla.gnome.org/show_bug.cgi?id=740995
diff --git a/src/totem-options.c b/src/totem-options.c
index f48bf74..daba578 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -78,11 +78,12 @@ totem_send_remote_command (Totem *totem,
}
void
-totem_options_process_for_server (Totem *totem,
- const TotemCmdLineOptions *options)
+totem_options_process_for_server (Totem *totem,
+ TotemCmdLineOptions *options)
{
TotemRemoteCommand action;
GList *commands, *l;
+ char **filenames;
int i;
commands = NULL;
@@ -103,12 +104,15 @@ totem_options_process_for_server (Totem *totem,
action = TOTEM_REMOTE_COMMAND_ENQUEUE;
}
+ filenames = options->filenames;
+ options->filenames = NULL;
+
/* Send the files to enqueue */
- for (i = 0; options->filenames && options->filenames[i] != NULL; i++) {
+ for (i = 0; filenames && filenames[i] != NULL; i++) {
const char *filename;
char *full_path;
- filename = options->filenames[i];
+ filename = filenames[i];
full_path = totem_create_full_path (filename);
totem_send_remote_command (totem, action, full_path ? full_path : filename);
@@ -122,6 +126,8 @@ totem_options_process_for_server (Totem *totem,
}
}
+ g_clear_pointer (&filenames, g_strfreev);
+
if (options->playpause) {
commands = g_list_append (commands, GINT_TO_POINTER
(TOTEM_REMOTE_COMMAND_PLAYPAUSE));
diff --git a/src/totem-options.h b/src/totem-options.h
index cdc3888..662b775 100644
--- a/src/totem-options.h
+++ b/src/totem-options.h
@@ -55,7 +55,7 @@ extern TotemCmdLineOptions optionstate;
void totem_options_register_remote_commands (Totem *totem);
void totem_options_process_for_server (Totem *totem,
- const TotemCmdLineOptions* options);
+ TotemCmdLineOptions* options);
G_END_DECLS
--
cgit v0.10.2

View File

@@ -0,0 +1,31 @@
From dc35bff8a374ba1cf28212a79e15609f7acfdcd3 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Sun, 29 Mar 2015 15:22:18 +0200
Subject: grilo: Simplify test whether to monitor a source
A little bit cleaner.
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 7408a9b..20580dd 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -1297,12 +1297,12 @@ source_added_cb (GrlRegistry *registry,
MODEL_RESULTS_IS_PRETHUMBNAIL, TRUE,
MODEL_RESULTS_CAN_REMOVE, can_remove (source, NULL),
-1);
- monitor = TRUE;
+
+ if (g_str_equal (id, "grl-filesystem") == FALSE)
+ monitor = TRUE;
}
- if (monitor &&
- (ops & GRL_OP_NOTIFY_CHANGE) &&
- g_str_equal (id, "grl-filesystem") == FALSE) {
+ if (monitor && (ops & GRL_OP_NOTIFY_CHANGE)) {
grl_source_notify_change_start (source, NULL);
g_signal_connect (G_OBJECT (source), "content-changed",
G_CALLBACK (content_changed_cb), self);
--
cgit v0.10.2

View File

@@ -0,0 +1,25 @@
From c56350fa481667837c4d2cb64d63217dea8a2b82 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Sun, 29 Mar 2015 15:22:53 +0200
Subject: grilo: Don't monitor tracker
See also:
https://bugzilla.gnome.org/show_bug.cgi?id=746974
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 20580dd..733d9c9 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -1282,7 +1282,8 @@ source_added_cb (GrlRegistry *registry,
if (source_is_recent (source)) {
browse (self, self->priv->recent_model,
NULL, source, NULL, -1);
- monitor = TRUE;
+ if (g_str_equal (id, "grl-tracker-source") == FALSE)
+ monitor = TRUE;
} else if (!source_is_browse_blacklisted (source)) {
const GdkPixbuf *icon;
--
cgit v0.10.2

View File

@@ -0,0 +1,26 @@
From c7fdff8eea6485373fb75f1402c6ce58bb0a1813 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 13 Mar 2015 10:02:29 +0100
Subject: main: Fix Videos icon not showing in volume control
Forcefully set PulseAudio icon property. Seems that PulseAudio's client
libraries aren't quite working things out in some cases.
https://bugzilla.gnome.org/show_bug.cgi?id=745874
diff --git a/src/totem.c b/src/totem.c
index 2600921..3152ae0 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -72,7 +72,7 @@ main (int argc, char **argv)
g_set_application_name (_("Videos"));
gtk_window_set_default_icon_name ("totem");
g_setenv("PULSE_PROP_media.role", "video", TRUE);
-
+ g_setenv("PULSE_PROP_application.icon_name", "totem", TRUE);
/* Build the main Totem object */
totem = g_object_new (TOTEM_TYPE_OBJECT,
--
cgit v0.10.2

View File

@@ -0,0 +1,31 @@
From dd2b351e5bdc31da2b047b5a009825209cf0d492 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 23 Apr 2015 17:19:31 +0200
Subject: grilo: Add debug statements
https://bugzilla.gnome.org/show_bug.cgi?id=746165
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 733d9c9..a0c9027 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -2487,6 +2487,8 @@ totem_grilo_finalize (GObject *object)
void
totem_grilo_start (TotemGrilo *self)
{
+ g_debug ("TotemGrilo: Resuming videos thumbnailing");
+
totem_grilo_resume_icon_thumbnailing ();
if (self->priv->plugins_loaded)
@@ -2501,6 +2503,7 @@ totem_grilo_start (TotemGrilo *self)
void
totem_grilo_pause (TotemGrilo *self)
{
+ g_debug ("TotemGrilo: Pausing videos thumbnailing");
totem_grilo_pause_icon_thumbnailing ();
}
--
cgit v0.10.2

View File

@@ -0,0 +1,91 @@
From 295b6d0896177b0f3f778fb0fc1b0efd5595fde3 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 23 Apr 2015 17:21:44 +0200
Subject: main: Fix thumbnailing starting when launching with a video
We were previously relying on optionstate.filenames being non-NULL to
avoid starting thumbnailing when the user opened the player with a
video, but that actually caused doubly-adding those files passed on the
command-line, and didn't work when the Open() GApplication method was
used.
Use a separate option to keep track of whether to start populating the
grilo icon view and thumbnailing, so that thumbnailing doesn't hamper
playback performance.
https://bugzilla.gnome.org/show_bug.cgi?id=746165
diff --git a/src/totem-object.c b/src/totem-object.c
index 5ec8255..b9eb2f2 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -145,6 +145,8 @@ totem_object_app_open (GApplication *application,
GSList *slist = NULL;
int i;
+ optionstate.had_filenames = (n_files > 0);
+
g_application_activate (application);
totem_object_set_main_page (TOTEM_OBJECT (application), "player");
@@ -237,21 +239,23 @@ totem_object_app_activate (GApplication *app)
* it comes from a plugin */
totem_object_plugins_init (totem);
- if (optionstate.filenames == NULL) {
- totem_object_set_main_page (totem, "grilo");
- if (totem_session_try_restore (totem) == FALSE)
+ /* We're only supposed to be called from totem_object_app_handle_local_options()
+ * and totem_object_app_open() */
+ g_assert (optionstate.filenames == NULL);
+
+ if (!optionstate.had_filenames) {
+ if (totem_session_try_restore (totem) == FALSE) {
+ totem_object_set_main_page (totem, "grilo");
totem_object_set_mrl (totem, NULL, NULL);
+ } else {
+ totem_object_set_main_page (totem, "player");
+ }
} else {
totem_object_set_main_page (totem, "player");
- if (totem_object_open_files (totem, optionstate.filenames))
- totem_object_play_pause (totem);
- else
- totem_object_set_mrl (totem, NULL, NULL);
-
- g_strfreev (optionstate.filenames);
- optionstate.filenames = NULL;
}
+ optionstate.had_filenames = FALSE;
+
/* Set the logo at the last minute so we won't try to show it before a video */
bacon_video_widget_set_logo (totem->bvw, "totem");
diff --git a/src/totem-options.c b/src/totem-options.c
index daba578..06b4f7c 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -106,6 +106,7 @@ totem_options_process_for_server (Totem *totem,
filenames = options->filenames;
options->filenames = NULL;
+ options->had_filenames = (filenames != NULL);
/* Send the files to enqueue */
for (i = 0; filenames && filenames[i] != NULL; i++) {
diff --git a/src/totem-options.h b/src/totem-options.h
index 662b775..f388706 100644
--- a/src/totem-options.h
+++ b/src/totem-options.h
@@ -48,6 +48,7 @@ typedef struct {
gboolean replace;
gint64 seek;
gchar **filenames;
+ gboolean had_filenames;
} TotemCmdLineOptions;
extern const GOptionEntry all_options[];
--
cgit v0.10.2

View File

@@ -0,0 +1,23 @@
From fa130c465423038db5636aa5cb977e90f0794ac8 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 24 Apr 2015 15:58:23 +0200
Subject: grilo: Make thumbnail reading cancellable
https://bugzilla.gnome.org/show_bug.cgi?id=748370
diff --git a/src/icon-helpers.c b/src/icon-helpers.c
index 08d556a..feb15b3 100644
--- a/src/icon-helpers.c
+++ b/src/icon-helpers.c
@@ -296,7 +296,7 @@ totem_grilo_get_thumbnail (GObject *object,
file = g_file_new_for_uri (url_thumb);
g_task_set_task_data (task, file, g_object_unref);
- g_file_read_async (file, G_PRIORITY_DEFAULT, NULL,
+ g_file_read_async (file, G_PRIORITY_DEFAULT, cancellable,
get_stream_thumbnail_cb, task);
}
--
cgit v0.10.2

View File

@@ -0,0 +1,37 @@
From ee959d9d4611c820218b6f015734a7e4f86aedfd Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 24 Apr 2015 17:17:36 +0200
Subject: grilo: Limit ourselves to running one thumbnailer at a time
Our thumbnailer currently doesn't have support for using hardware
decoding, so it's pretty CPU intensive. On my machine (i7 laptop with an
SSD), one thumbnailer would take about 40% of CPU. This causes both lag
when navigating the videos list, and carries on hampering video playback
if thumbnailing is started before playback.
This is good enough to mark this bug as fixed:
https://bugzilla.gnome.org/show_bug.cgi?id=748370
though a better solution would be to cancel thumbnailing in
totem_grilo_pause(), make sure that
gnome_desktop_thumbnail_path_for_uri() is cancellable, and try to
distinguish in totem-grilo.c between cancellation because the player is
getting shut down, and cancellation because we want all the resources to
go to the player.
diff --git a/src/icon-helpers.c b/src/icon-helpers.c
index feb15b3..f073f26 100644
--- a/src/icon-helpers.c
+++ b/src/icon-helpers.c
@@ -30,7 +30,7 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API 1
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
-#define DEFAULT_MAX_THREADS 5
+#define DEFAULT_MAX_THREADS 1
#define THUMB_SEARCH_SIZE 256
#define THUMB_SEARCH_HEIGHT (THUMB_SEARCH_SIZE / 4 * 3)
--
cgit v0.10.2

View File

@@ -0,0 +1,31 @@
From 404cfda65a5b444bad4fe0fd6dbf73da8ec36d88 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 27 Apr 2015 13:32:58 +0200
Subject: build: Fix detection of valac
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
AM_PROG_VALAC very helpfully sets $VALAC to:
"Absolute path to the Vala compiler, or simply valac if no suitable
compiler Vala could be found at configure runtime."
We were checking for $VALAC being empty, thus still trying to build Vala
plugins even if Vala wasn't available.
diff --git a/configure.ac b/configure.ac
index 20ec003..47718b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,7 +263,7 @@ AC_ARG_ENABLE([vala],
AC_MSG_RESULT([$enable_vala])
if test "x$enable_vala" != "xno"; then
AM_PROG_VALAC([$VALA_REQS])
- if test "x$VALAC" = "x"; then
+ if test "$VALAC" = "valac"; then
if test "x$enable_vala" = "xyes"; then
AC_MSG_ERROR([Vala plugin support explicitly requested, but not found])
fi
--
cgit v0.10.2