Author: belegdol
Update of /cvs/free/rpms/gnome-mplayer/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv22366
Modified Files:
gnome-mplayer.spec
Added Files:
gnome-mplayer-inhibit.patch
Log Message:
* Wed Jul 01 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.6-2
- Fixed screensaver inhibition
gnome-mplayer-inhibit.patch:
--- NEW FILE gnome-mplayer-inhibit.patch ---
Index: src/dbus-interface.h
===================================================================
--- src/dbus-interface.h (wersja 1365)
+++ src/dbus-interface.h (wersja 1366)
@@ -30,5 +30,6 @@
#include "support.h"
DBusConnection *connection;
-uint cookie;
+uint ss_cookie;
+uint sm_cookie;
gboolean dbus_hookup(gint windowid, gint controlid);
Index: src/dbus-interface.c
===================================================================
--- src/dbus-interface.c (wersja 1365)
+++ src/dbus-interface.c (wersja 1366)
@@ -1163,17 +1163,9 @@
void dbus_unhook()
{
-
- DBusMessage *message;
-
if (connection != NULL) {
- message =
- dbus_message_new_method_call("org.gnome.ScreenSaver",
"/org/gnome/ScreenSaver",
- "org.gnome.ScreenSaver",
"UnInhibit");
- dbus_message_append_args(message, DBUS_TYPE_INT32, &cookie,
DBUS_TYPE_INVALID);
- dbus_connection_send(connection, message, NULL);
- dbus_message_unref(message);
- // dbus_connection_close(connection);
+ dbus_enable_screensaver();
+ // dbus_connection_close(connection);
dbus_connection_unref(connection);
connection = NULL;
}
@@ -1184,13 +1176,22 @@
DBusMessage *message;
if (connection != NULL) {
- message =
- dbus_message_new_method_call("org.gnome.ScreenSaver",
"/org/gnome/ScreenSaver",
- "org.gnome.ScreenSaver",
"UnInhibit");
- dbus_message_append_args(message, DBUS_TYPE_INT32, &cookie,
DBUS_TYPE_INVALID);
+ message =
+ dbus_message_new_method_call("org.gnome.ScreenSaver",
"/org/gnome/ScreenSaver",
+ "org.gnome.ScreenSaver",
"UnInhibit");
+ dbus_message_append_args(message, DBUS_TYPE_INT32, &ss_cookie,
DBUS_TYPE_INVALID);
dbus_connection_send(connection, message, NULL);
dbus_message_unref(message);
- }
+
+ message =
+ dbus_message_new_method_call("org.gnome.SessionManager",
"/org/gnome/SessionManager",
+ "org.gnome.SessionManager",
"UnInhibit");
+ dbus_message_append_args(message, DBUS_TYPE_INT32, &sm_cookie,
DBUS_TYPE_INVALID);
+ dbus_connection_send(connection, message, NULL);
+ dbus_message_unref(message);
+
+
+ }
}
void dbus_disable_screensaver()
@@ -1200,6 +1201,7 @@
DBusMessage *message;
const gchar *app;
const gchar *reason;
+ gint flags;
if (connection != NULL) {
dbus_error_init(&error);
@@ -1211,12 +1213,34 @@
dbus_message_append_args(message, DBUS_TYPE_STRING, &app, DBUS_TYPE_STRING,
&reason,
DBUS_TYPE_INVALID);
reply_message = dbus_connection_send_with_reply_and_block(connection, message,
200, &error);
+
if (reply_message) {
- dbus_message_get_args(reply_message, &error, DBUS_TYPE_INT32,
&cookie, NULL);
+ dbus_message_get_args(reply_message, &error, DBUS_TYPE_INT32,
&ss_cookie, NULL);
dbus_message_unref(reply_message);
}
-
+
dbus_message_unref(message);
dbus_error_free(&error);
+
+
+ message =
+ dbus_message_new_method_call("org.gnome.SessionManager",
"/org/gnome/SessionManager",
+ "org.gnome.SessionManager",
"Inhibit");
+ app = g_strdup_printf("gnome-mplayer");
+ reason = g_strdup_printf("playback");
+ flags = 8;
+ dbus_message_append_args(message, DBUS_TYPE_STRING, &app, DBUS_TYPE_UINT32,
&(idledata->windowid),
+ DBUS_TYPE_STRING, &reason, DBUS_TYPE_UINT32, &flags,
+ DBUS_TYPE_INVALID);
+ reply_message = dbus_connection_send_with_reply_and_block(connection, message, 200,
&error);
+
+ if (reply_message) {
+ dbus_message_get_args(reply_message, &error, DBUS_TYPE_INT32,
&sm_cookie, NULL);
+ dbus_message_unref(reply_message);
+ }
+
+ dbus_message_unref(message);
+ dbus_error_free(&error);
+
}
}
Index: gnome-mplayer.spec
===================================================================
RCS file: /cvs/free/rpms/gnome-mplayer/devel/gnome-mplayer.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- gnome-mplayer.spec 5 Jun 2009 18:48:59 -0000 1.18
+++ gnome-mplayer.spec 1 Jul 2009 16:16:53 -0000 1.19
@@ -1,6 +1,6 @@
Name: gnome-mplayer
Version: 0.9.6
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: An MPlayer GUI, a full-featured binary
Group: Applications/Multimedia
@@ -10,6 +10,7 @@
%if 0%{?fedora} >= 11
Patch0: gnome-mplayer-flatvolume.patch
%endif
+Patch1: gnome-mplayer-inhibit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: alsa-lib-devel
@@ -94,9 +95,11 @@
%if 0%{?fedora} >= 11
pushd generic
%patch0 -p0 -b .flatvolume
+%patch2 -p0 -b .inhibit
popd
pushd minimal
%patch0 -p0 -b .flatvolume
+%patch2 -p0 -b .inhibit
popd
%endif
@@ -200,6 +203,9 @@
%changelog
+* Wed Jul 01 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.6-2
+- Fixed screensaver inhibition
+
* Sun Jun 05 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.6-1
- Updated to 0.9.6
- Dropped upstreamed patches