Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
8766feda
Commit
8766feda
authored
May 11, 2009
by
Felix Geyer
Committed by
Rémi Denis-Courmont
May 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KDE4 screensaver preemption (fixes #2730)
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
109900f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
modules/misc/screensaver.c
modules/misc/screensaver.c
+30
-10
No files found.
modules/misc/screensaver.c
View file @
8766feda
...
...
@@ -50,6 +50,10 @@
#define GS_PATH "/org/gnome/ScreenSaver"
#define GS_INTERFACE "org.gnome.ScreenSaver"
#define FDS_SERVICE "org.freedesktop.ScreenSaver"
#define FDS_PATH "/ScreenSaver"
#define FDS_INTERFACE "org.freedesktop.ScreenSaver"
#endif
/*****************************************************************************
...
...
@@ -67,8 +71,11 @@ static void poke_screensaver( intf_thread_t *p_intf,
DBusConnection
*
p_connection
);
static
void
screensaver_send_message_void
(
intf_thread_t
*
p_intf
,
DBusConnection
*
p_connection
,
const
char
*
psz_service
,
const
char
*
psz_path
,
const
char
*
psz_interface
,
const
char
*
psz_name
);
static
bool
screensaver_is_running
(
DBusConnection
*
p_connection
);
static
bool
screensaver_is_running
(
DBusConnection
*
p_connection
,
const
char
*
psz_service
);
struct
intf_sys_t
...
...
@@ -235,34 +242,47 @@ static DBusConnection * dbus_init( intf_thread_t *p_intf )
static
void
poke_screensaver
(
intf_thread_t
*
p_intf
,
DBusConnection
*
p_connection
)
{
if
(
screensaver_is_running
(
p_connection
)
)
if
(
screensaver_is_running
(
p_connection
,
GS_SERVICE
)
)
{
# ifdef SCREENSAVER_DEBUG
msg_Dbg
(
p_intf
,
"found a running gnome-screensaver instance"
);
# endif
/* gnome-screensaver changed it's D-Bus interface, so we need both */
screensaver_send_message_void
(
p_intf
,
p_connection
,
"Poke"
);
screensaver_send_message_void
(
p_intf
,
p_connection
,
"SimulateUserActivity"
);
screensaver_send_message_void
(
p_intf
,
p_connection
,
GS_SERVICE
,
GS_PATH
,
GS_INTERFACE
,
"Poke"
);
screensaver_send_message_void
(
p_intf
,
p_connection
,
GS_SERVICE
,
GS_PATH
,
GS_INTERFACE
,
"SimulateUserActivity"
);
}
else
if
(
screensaver_is_running
(
p_connection
,
FDS_SERVICE
)
)
{
# ifdef SCREENSAVER_DEBUG
msg_Dbg
(
p_intf
,
"found a running freedesktop-screensaver instance"
);
# endif
screensaver_send_message_void
(
p_intf
,
p_connection
,
FDS_SERVICE
,
FDS_PATH
,
FDS_INTERFACE
,
"SimulateUserActivity"
);
}
# ifdef SCREENSAVER_DEBUG
else
{
msg_Dbg
(
p_intf
,
"found no running
gnome
-screensaver instance"
);
msg_Dbg
(
p_intf
,
"found no running
(gnome|freedesktop)
-screensaver instance"
);
}
# endif
}
static
void
screensaver_send_message_void
(
intf_thread_t
*
p_intf
,
DBusConnection
*
p_connection
,
const
char
*
psz_service
,
const
char
*
psz_path
,
const
char
*
psz_interface
,
const
char
*
psz_name
)
{
DBusMessage
*
p_message
;
if
(
!
p_connection
||
!
psz_name
)
return
;
p_message
=
dbus_message_new_method_call
(
GS_SERVICE
,
GS_PATH
,
GS_INTERFACE
,
psz_name
);
p_message
=
dbus_message_new_method_call
(
psz_service
,
psz_path
,
psz_interface
,
psz_name
);
if
(
p_message
==
NULL
)
{
msg_Err
(
p_intf
,
"DBUS initialization failed: message initialization"
);
...
...
@@ -279,7 +299,7 @@ static void screensaver_send_message_void ( intf_thread_t *p_intf,
dbus_message_unref
(
p_message
);
}
static
bool
screensaver_is_running
(
DBusConnection
*
p_connection
)
static
bool
screensaver_is_running
(
DBusConnection
*
p_connection
,
const
char
*
psz_service
)
{
DBusError
error
;
bool
b_return
;
...
...
@@ -287,7 +307,7 @@ static bool screensaver_is_running( DBusConnection *p_connection )
if
(
!
p_connection
)
return
false
;
dbus_error_init
(
&
error
);
b_return
=
dbus_bus_name_has_owner
(
p_connection
,
GS_SERVICE
,
&
error
);
b_return
=
dbus_bus_name_has_owner
(
p_connection
,
psz_service
,
&
error
);
if
(
dbus_error_is_set
(
&
error
)
)
dbus_error_free
(
&
error
);
return
b_return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment