Caffeine wont activate

Bug #1768801 reported by Calvin Cutts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Caffeine
Invalid
Undecided
Unassigned

Bug Description

When I right click on the caffeine indicator and click activate nothing happens. It has worked fine up to now.

I'm running Ubuntu Budgie 18.04.

I tried terminating the processes (caffeine and caffeine indicator) then re-running them, but it didn't work.

Revision history for this message
Reuben Thomas (rrt) wrote :

Sorry you're having problems!

When you say "nothing happens", do you mean that the indicator doesn't change to show that Caffeine is active? Or that having activated the indicator, the screensaver still kicks in?

Revision history for this message
Calvin Cutts (astralogic) wrote :

The indicator doesn't change, and the screensaver still kicks in.

Revision history for this message
Reuben Thomas (rrt) wrote :

If you run caffeine-indicator from a terminal, do you get any error messages?

Also, does caffeine itself work? (It seems that might be a separate problem: if the indicator doesn't change when you click it, it may simply not be activating caffeine).

Revision history for this message
Calvin Cutts (astralogic) wrote :

Running "caffeine-indicator" from the terminal doesn't produce any errors, it doesn't have any output at all, although it does launch the indicator.

None of the menu options available from the indicator (activate/about/quit) do anything when clicked.

I'm new to Linux and I don't know how to test/use caffeine without using the indicator.

Revision history for this message
Reuben Thomas (rrt) wrote :

Thanks for the feedback. Sounds like something has gone wrong with the user interface of caffeine-indicator, I guess because of changes in the underlying libraries in Ubuntu 18.04. Unfortunately I won't be upgrading to 18.04 until late August (when 18.04.1 is released), so I'm unlikely to be able to test it before then.

To test caffeine on its own, just run "caffeine" (in a terminal is probably best, again you can then see any output). Then see whether it works (that is, whether setting a window full-screen disables the screensaver).

Revision history for this message
Reuben Thomas (rrt) wrote :

I can confirm that caffeine-indicator works fine on Ubuntu 18.04 in GNOME. Your problem is most likely with xdg-screensaver. Closing the bug.

Changed in caffeine:
status: New → Invalid
Revision history for this message
avadeaux (ubuntu-avadeaux) wrote :

I couldn't get caffeine to work either. After trying various tips from the net without result without success, I fished out the relevant parts from the Python code to a minimal script, and debugged that until it worked. There were at least two problems. One was that xdg-screensaver identified the wrong screen saver to wake up (which wasn't caffeine's fault of course, but it made caffeine not work). It tried to wake up the Gnome screensaver, which wasn't even installed, instead of xscreensaver that I was using. Another was that ewmh.getActiveWindow() did not work when the script was running as a startup program in Gnome. There may have been more. Anyway, I'm attaching the very short script that worked as a caffeine replacement for my specific needs.

Revision history for this message
Reuben Thomas (rrt) wrote :

Thanks for the report, @avadeaux. Please could you expand on your remark that "ewmh.getActiveWindow() did not work when the script was running as a startup program in Gnome"?

I use Caffeine as a startup program, and I have no problem with this, and I can't see how it would be a problem.

Revision history for this message
avadeaux (ubuntu-avadeaux) wrote :

I don't remember if there was an exception or if it returned None. If it works for you, maybe it's a timing problem: a slice of time during startup when no active window is defined.

Revision history for this message
Reuben Thomas (rrt) wrote :

This is what I mean: it doesn't matter if there's no active window, it just returns `None`, and the code does nothing.

Revision history for this message
Reuben Thomas (rrt) wrote :

If you do actually find a bug, I'd be very grateful for a report!

Revision history for this message
avadeaux (ubuntu-avadeaux) wrote :

Ah sorry, it's not a timing problem. It doesn't just return None during startup, it stays None when the script is run as a startup application. Attaching a test script. When this is run from a Gnome terminal, the contents of /tmp/awtest.txt becomes:

   running awtest
   window: <class 'Xlib.display.Window'>(0x02400006)
   window: <class 'Xlib.display.Window'>(0x02400006)
   window: <class 'Xlib.display.Window'>(0x02400006)

And so on, but when it's run as a startup application, I get:

   running awtest
   window: None
   window: None
   window: None

It never changes to an actual window. I also tried it with the line 'ewmh = EWMH()' inside the loop, but that made no difference.

I haven't verified that this is an actual problem in caffeine, but the way I read the code, it should mean that it never deactivates the screensaver.

Revision history for this message
Reuben Thomas (rrt) wrote :

That's great, thanks very much for investigating and supplying a test! I'll look into it.

Revision history for this message
Reuben Thomas (rrt) wrote :

@avadeaux, I can't reproduce your result with your script:

$ cat /tmp/awtest.txt
running awtest
window: None
window: None
window: None
window: None
window: <class 'Xlib.display.Window'>(0x03c0000e)
window: <class 'Xlib.display.Window'>(0x03c0000e)
window: <class 'Xlib.display.Window'>(0x03e00021)
window: <class 'Xlib.display.Window'>(0x03c0000e)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.