! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
"Disable screen saver while playing movies" does not work correctly
Status:
RESOLVED: FIXED

Comments

Description Dave Malik 2011-03-13 02:55:59 CET
Go to preferences, ensure the option is checked.
Play some media...... screensaver kicks in - (is not inhibited)

WORKAROUND - Keep preferences window open, start playing media and change option off to on (or if it was off - then just change it to on).
Then, the screensaver is inhibited. 
It will remain inhibited while there is media in the play window (ie, Pause, back, forward).
But, if you STOP or load/play different media - then you have to repeat the change of state of the option (to on) again.

It looks like the function "parole_screen_saver_inhibit" is ONLY invoked from the  subroutine "parole_player_reset_saver_changed". If I am correct 
(a big "If", as I am only a novice and this is my first ever attempt at a bug report/post) --- and the "parole_player_reset_saver_changed" is only invoked when the user clicks the option - then that would explain the behavior I am seeing.
I apologize for not being able to discern further what a suitable remedy would be.
For myself, I have written a shell script replacement that preserves the screensaver settings of X, turns the screensaver off, calls parole and when parole closes - resets the screensaver settings.
But, it is nothing like as elegant as turning off the screensaver only when media is loaded/playing - which (I believe) is the program's intent.

Oh yes, the ABOUT box says " xfce 4.6.1" as well as "parole version 0.2.0.2".
Dave
Comment 1 Simon Steinbeiss editbugs 2012-07-23 02:28:04 CEST
Thanks for the report, we'll look into it.
Comment 2 Simon Steinbeiss editbugs 2012-07-23 02:29:31 CEST
*** Bug 8566 has been marked as a duplicate of this bug. ***
Comment 3 Simon Steinbeiss editbugs 2012-07-23 02:41:18 CEST
*** Bug 8440 has been marked as a duplicate of this bug. ***
Comment 4 Simon Steinbeiss editbugs 2012-07-23 02:43:14 CEST
*** Bug 6453 has been marked as a duplicate of this bug. ***
Comment 5 Sean Davis editbugs 2012-08-15 20:08:00 CEST
Unfortunately, it seems the workaround does not even work any more, with or without the power manager plugin.

This will require quite a bit of reworking.
Comment 6 Martin Spacek 2012-10-18 08:41:33 CEST
I can confirm I have the same problem (as do some others, like here: https://bbs.archlinux.org/viewtopic.php?id=137536). I'm running xfce 4.10 (Xubuntu 12.10 amd64) which comes with Parole 0.3.0.3.
Comment 7 Martin Spacek 2012-10-18 08:43:44 CEST
Forgot to mention, I've also tried the power manager plugin in Parole, with no luck.
Comment 8 Daniel Wilkins 2012-12-17 19:51:35 CET
Talked with ochosi briefly last night, and it seems like the best way to solve this would be faking key events, probably every minute(The lowest you're allowed to set a screensaver to, in everything I've seen.) He pointed me to totem but I can't seem to find a reference in there with grep, so I'm just going to play around with event sending and see if I can keep them from starting without changing anything that the user sees.
Comment 9 Michael Kogan 2012-12-17 20:29:29 CET
Maybe you can look at the code of Caffeine (which I'm currently using as workaround): http://bazaar.launchpad.net/~caffeine-developers/caffeine/main/view/head:/caffeine/core.py As far as I can see, Caffeine is just identifying the power management mechanism and then sending a signal (or running a command) to prevent sleep mode.
Comment 10 Daniel Wilkins 2012-12-17 21:01:03 CET
Yeah, that appears to actually be what you need to do. At least xscreensaver is actually distinguishing between real and fake events.
Comment 11 Daniel Wilkins 2012-12-17 22:18:52 CET
The bug is nearly solved now. turns out that there's a freedesktop specified screensaver controller(xdg-screensaver) that does everything we need. The only catch is that it requires that we supply the window's X id, which seems to be a bit annoying to track down in GTK. Working on that now.
Comment 12 Daniel Wilkins 2012-12-17 22:56:38 CET
I have this bug fixed. just need to figure out how to revert my git tree to its initial state so that I can get a good patch(any pointers on this? never worked with diff/patch before)
Comment 13 Daniel Wilkins 2012-12-17 23:11:25 CET
Created attachment 4804 
add screensaver inhibit/uninhibit support

This should do it. The only thing that I find iffy is that I hardcoded 12 as the max length of an X window id, anyone know how long they actually go? I'd rather not have this segfaulting when you have a lot of windows open.
Comment 14 Jérôme Guelfucci editbugs 2012-12-19 11:04:10 CET
Hello,

Some notes on your patch (please note that I'm not the maintainer):

1) See git format-patch to produce a clean patch, the current patch is hard to read and apply.
2) Instead of using GTK_WIDGET(window)->window, use gtk_widget_get_parent_window. That way, the code will compile even when building with GSeal enabled and the code is far more readable.
3) See g_strdup_printf to avoid making assumptions on the size of the window X ID.

Cheers,

Jérôme
Comment 15 Sean Davis editbugs 2012-12-19 11:47:40 CET
Thanks Tekk for the patch, it works great!  I've tweaked it a bit as Jérôme suggested, with the exception of one part.

Jérôme, you suggest using gtk_widget_get_parent_window, which according to the documentation, should return a GdkWindow.  However, it's returning a GdkDrawable, which cannot be casted to a GdkDrawable for one reason or another.

I've applied the tweaked patch to git-master if you'd like to take a look.  The command that does work is:

cmd = g_strdup_printf("xdg-screensaver suspend %d", (int)GDK_WINDOW_XID(GDK_WINDOW(GTK_WIDGET(window)->window)));

And the one that doesn't:
cmd = g_strdup_printf("xdg-screensaver suspend %d", (int)GDK_WINDOW_XID(GDK_WINDOW( gtk_widget_get_parent_window(GTK_WIDGET(window)) )));

Thoughts?

Thanks!
Sean
Comment 16 Jérôme Guelfucci editbugs 2012-12-19 13:57:59 CET
Created attachment 4806 
Fix the command to get the XID of a GtkWindow

Right, this is how I would do it then.
Comment 17 Daniel Wilkins 2012-12-19 17:55:15 CET
Thanks for the cleanup there Jérǒme, new to glib so I didn't know about g_strdup_printf nor git format-patch.
Comment 18 Sean Davis editbugs 2012-12-20 00:18:28 CET
Thanks both of you for your patches.  I think it's safe to say that this issue is finally resolved.  The latest code is now available in git-master.
Comment 19 Jérôme Guelfucci editbugs 2012-12-20 00:29:54 CET
Sean: thanks!

Tekk: I don't blame you! You did a nice job with this!

Bug #7407

Reported by:
Dave Malik
Reported on: 2011-03-13
Last modified on: 2012-12-20
Duplicates (3):
  • 6453 Xscreensaver never stops
  • 8440 Parole doesn't disable screeensaver while playing a movie
  • 8566 Parole not disabling xscreensaver during video playback

People

Assignee:
Simon Steinbeiss
CC List:
10 users

Version

Version:
0.2.0.2

Attachments

Additional information