Skip to contentSkip to conversation

qemu disables screensaver

Qemu-devel Applied Jaap Versteegh 6 participants 12 messages May 20, 2010 – Feb 20, 2011

lore
Share & tools
lore
#0 lore raw

Public bug reported:

lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.

** Affects: qemu
Importance: Undecided
Status: New

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#1 lore raw

** Attachment added: "Code used to check idle time."
http://launchpadlibrarian.net/48825708/idletime

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#2 lore raw
In reply to Jaap Versteegh

Debian bugreport about this: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578672 (#578672).
I tried it here again, with your program (using 0.12.4 from debian) - and it works as expected for me, no resets every 4 secs, screen saver triggers after configured time even if the input is grabbed by kvm window (Ctrl+Alt). Hmmm?

** Bug watch added: Debian Bug tracker #578672
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578672

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#3 lore raw
In reply to Jaap Versteegh

When I run
$xtrace qemu

I get:
001:<:00xx: 4: Request(115): ForceScreenSaver mode=Reset(0x00)

every 4 seconds, which explains things I suppose.
Why is that??

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#4 lore raw
In reply to Jaap Versteegh

Looks like it is SDL related, because setting
SDL_VIDEO_ALLOW_SCREENSAVER=1
fixes it.

I understand disabling the screensaver is the default in SDL so the screensaver won't activate while watching a movie or playing a game.
http://www.libsdl.org/faq.php?action=listentries&category=9#90

Since I don't think this behaviour is desirable for qemu, I guess it would be useful to prevent the disabling of the screensaver in code.

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#5 lore raw

PATCH 1/1 sdl: Do not disable screensaver by default

From: Jan Kiszka <[email protected]>

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

---

Cool, thanks for digging out SDL_VIDEO_ALLOW_SCREENSAVER. I came across by this issue as well but I was too lazy to analyze to reason. This patch solves it for me.

 sdl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sdl.c +4 -0
index 16a48e9..3bdd518 100644
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     if (no_frame)
         gui_noframe = 1;
 
+    if (!full_screen) {
+        setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+    }
+
     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
Signature · 1 line
1.6.0.2
#6 lore raw

Re: [Qemu-devel] [PATCH] sdl: Do not disable screensaver by default

Quoted 9 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

Applied. Thanks.

This also fixes https://bugs.launchpad.net/qemu/+bug/583462.

Regards,

Anthony Liguori

Quoted 25 lines

---

Cool, thanks for digging out SDL_VIDEO_ALLOW_SCREENSAVER. I came across by this issue as well but I was too lazy to analyze to reason. This patch solves it for me.

  sdl.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
sdl.c +4 -0
index 16a48e9..3bdd518 100644
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
      if (no_frame)
          gui_noframe = 1;
 
+    if (!full_screen) {
+        setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+    }
+
      flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
      if (SDL_Init (flags)) {
          fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
#7 lore raw

Re: [Qemu-devel] [PATCH] sdl: Do not disable screensaver by default

In reply to Jan Kiszka
Quoted 22 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

---

Cool, thanks for digging out SDL_VIDEO_ALLOW_SCREENSAVER. I came across by this issue as well but I was too lazy to analyze to reason. This patch solves it for me.

  sdl.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
sdl.c +0 -0
index 16a48e9..3bdd518 100644

sdl.c void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) · line 861

Quoted 7 lines
sdl.c +4 -0
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
      if (no_frame)
          gui_noframe = 1;
 
+    if (!full_screen) {
+        setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+    }
+

I think it's conceptually wrong.

It's trivial to toggle full-screen mode by hitting Ctrl+Alt+F. Following this logic, on each toggle we should toggle the environment variable (which wont work). Or else the next bug report to be filed is that screen saver isn't re-enabled when switching from fullscreen to window and it isn't re-disabled when switching to fullscreen.

How about not poking at screensaver by default unconditionally? To me it sound more correct. I.e., the above setenv(), but without the if part...

Thanks!

/mjt

#8 lore raw

Re: [Qemu-devel] [PATCH] sdl: Do not disable screensaver by default

Quoted 34 lines · Michael Tokarev
Quoted 22 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

---

Cool, thanks for digging out SDL_VIDEO_ALLOW_SCREENSAVER. I came across by this issue as well but I was too lazy to analyze to reason. This patch solves it for me.

sdl.c | 4 ++++

1 files changed, 4 insertions(+), 0 deletions(-)
sdl.c +0 -0
index 16a48e9..3bdd518 100644

sdl.c void sdl_display_init(DisplayState *ds, int · line 862

Quoted 8 lines
sdl.c +4 -0
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int
 full_screen, int no_frame)
 if (no_frame)
 gui_noframe = 1;
 
+ if (!full_screen) {
+ setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+ }
+

I think it's conceptually wrong.

Quoted 6 lines

It's trivial to toggle full-screen mode by hitting Ctrl+Alt+F. Following this logic, on each toggle we should toggle the environment variable (which wont work). Or else the next bug report to be filed is that screen saver isn't re-enabled when switching from fullscreen to window and it isn't re-disabled when switching to fullscreen.

One more data point: guest can not turn off our monitor anyway, even in full-screen mode. So I think that by default our local screen saver should continue working regardless.

Quoted 7 lines

How about not poking at screensaver by default unconditionally? To me it sound more correct. I.e., the above setenv(), but without the if part...

Thanks!

/mjt

#9 lore raw

Re: [Qemu-devel] [PATCH] sdl: Do not disable screensaver by default

In reply to Michael Tokarev
Quoted 27 lines · Michael Tokarev
Quoted 26 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

---

Cool, thanks for digging out SDL_VIDEO_ALLOW_SCREENSAVER. I came across by this issue as well but I was too lazy to analyze to reason. This patch solves it for me.

  sdl.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
sdl.c +0 -0
index 16a48e9..3bdd518 100644
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int 
 full_screen, int no_frame)
      if (no_frame)
          gui_noframe = 1;
 
Quoted 8 lines

sdl.c void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) · line 861

Quoted 4 lines
sdl.c +4 -0
+    if (!full_screen) {
+        setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+    }
+

I think it's conceptually wrong.

It's trivial to toggle full-screen mode by hitting Ctrl+Alt+F.

I don't think it's worth jumping through hoops to conditionally disable/enable screensaver.

More sophisticated screen saver behavior should be implemented in upstream SDL.

Regards,

Anthony Liguori

Quoted 13 lines

Following this logic, on each toggle we should toggle the environment variable (which wont work). Or else the next bug report to be filed is that screen saver isn't re-enabled when switching from fullscreen to window and it isn't re-disabled when switching to fullscreen.

How about not poking at screensaver by default unconditionally? To me it sound more correct. I.e., the above setenv(), but without the if part...

Thanks!

/mjt

#10 lore raw
In reply to Jaap Versteegh

This is now fixed by:

commit 111f8ec99b67aeef152c71a5db12f0c0cb2422bd

Author: Jan Kiszka <[email protected]>
Date:   Sun May 23 10:29:34 2010 +0200

sdl: Do not disable screensaver by default

Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired.

** Changed in: qemu
Status: New => Fix Committed

Signature · 11 lines
qemu disables screensaver
https://bugs.launchpad.net/bugs/583462
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: Fix Committed

Bug description:
lucid, with compiz and fglrx:

Screensaver on host will not kick in when qemu is running (kvm or no kvm). It seems to be related to the fact that the idle time reported by libXss.so on the host is being reset every four seconds or so when qemu is running, eventhough there is no activity on either guest or host.
#11 lore raw
In reply to Jaap Versteegh

** Changed in: qemu
Status: Fix Committed => Fix Released

Signature · 18 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/583462

Title:
  qemu disables screensaver

Status in QEMU:
  Fix Released

Bug description:
  lucid, with compiz and fglrx:

  Screensaver on host will not kick in when qemu is running (kvm or no
  kvm). It seems to be related to the fact that the idle time reported
  by libXss.so on the host is being reset every four seconds or so when
  qemu is running, eventhough there is no activity on either guest or
  host.