Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6862645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:41:11+00:00 2026-05-27T02:41:11+00:00

How does one set the X11 display in Python-Clutter? I am trying to set

  • 0

How does one set the X11 display in Python-Clutter? I am trying to set it to XSCREENSAVER_WINDOW. I have tried importing clutter.x11 and using set_display(), but this doesn’t seem to be the correct command. Does anyone know the right way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:41:12+00:00Added an answer on May 27, 2026 at 2:41 am

    While searching around I found this thread, and by looking at the avatar picture, I assume it’s your thread 😉 I’ll re post the code given by LemursDontExist so you have it all in one.


    Short explanation: to make a program a screensaver in X Windows, the program checks if it is running as a screensaver, that means if it was invoked by the windowing system as such. This is done by checking if the environment variable DISPLAY is set to XSCREENSAVER_WINDOW.

    In that case, the program needs to go full screen and react to certain events. This is exactly what the code below does. Setting this variable is done through the xscreensaver application, you don’t do it yourself.

    The bit you’re missing is the clutter-gtk python binding. In current Ubuntu, the package name is gir1.2-clutter-gtk-0.10. With that, you can use the custom window class together with the clutter API.


    class GsThemeWindow(gtk.Window):
        __gtype_name__ = 'GsThemeWindow'
    
    def __init__(self):
        super(GsThemeWindow, self).__init__()
        self.connect("destroy", gtk.main_quit)
    
    def do_realize(self):
        ident = os.environ.get('XSCREENSAVER_WINDOW')
        if not ident is None:
            self.window = gtk.gdk.window_foreign_new(int(ident, 16))
            self.window.set_events(gtk.gdk.EXPOSURE_MASK |
                                   gtk.gdk.STRUCTURE_MASK)
            x, y, w, h, depth = self.window.get_geometry()
            self.size_allocate(gtk.gdk.Rectangle(x, y, w, h))
            self.set_default_size(w, h)
            self.set_decorated(False)
        else:
            self.window = gtk.gdk.Window(
                self.get_parent_window(),
                width=self.allocation.width,
                height=self.allocation.height,
                window_type=gtk.gdk.WINDOW_TOPLEVEL,
                wclass=gtk.gdk.INPUT_OUTPUT,
                event_mask=self.get_events() | gtk.gdk.EXPOSURE_MASK)
        self.window.set_user_data(self)
        self.style.attach(self.window)
        self.set_flags(self.flags() | gtk.REALIZED)
    

    For a short overview on how to use clutter with python (it has changed a lot), see this example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one set the UITableView Section border color? I have tried and cant
How does one set the zoom level on a mapview? I have a map
How does one set a default value for a text input using ActiveScaffold 1.2RC1?
How does one set a timeout on a BufferedReader and a PrintWriter created using
How does one set the date on the CalendarDatePicker. i.e. it defaults to current
How does one set the color of a line in matplotlib with scalar values
How does one set the size of the output image in GraphViz via the
Does anyone know how I go about putting a line chart for one set
In general, how does one set a control to take up the entire Height
How does one generate a set of lists that incorporate the index from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.