Results 1 to 3 of 3

Thread: Catch power events (suspend, resume) on linux

  1. #1
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Catch power events (suspend, resume) on linux

    Hi, on Windows I implemented QWidget::winEvent() and process the power events (suspend, standby, resume; using WM_POWERBROADCAST) there. This works quite well.
    Now I need to implement the same functionality under linux. I looked at QWidget::X11Event(), but it seems that XEvent does not handle power events like standby or resume.

    Did I overlook something? Or is there another way to catch power events on linux?

    Ginsengelf

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Catch power events (suspend, resume) on linux

    The closest to a standard API you can get on Linux desktops probably is UPower (http://upower.freedesktop.org/), which is exposed as the D-Bus interface org.freedesktop.UPower. It features a few interesting signals, such as Sleeping() and Resuming(). See the documentation of Qt D-Bus to know how to interface them with your application.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Catch power events (suspend, resume) on linux

    If you are looking for a Qt API, have a look at Solid: http://inqlude.org/libraries/solid.html

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 15th December 2010, 08:06
  2. open-close-suspend-resume mouse functions in QWSServer
    By masterbraind in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 9th November 2010, 22:07
  3. Replies: 2
    Last Post: 26th May 2010, 15:22
  4. ow to suspend and resume an external application
    By josecarlosmissias in forum Newbie
    Replies: 0
    Last Post: 10th December 2009, 19:09
  5. Replies: 0
    Last Post: 5th May 2008, 13:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.