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

  • Home
  • SEARCH
  • 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 196823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:48:01+00:00 2026-05-11T16:48:01+00:00

I’m developing a little side-project to display multiple wallpapers on multiple screens under GNOME

  • 0

I’m developing a little side-project to display multiple wallpapers on multiple screens under GNOME (something that apparently can’t be done by GNOME itself or anything else). I’ve figured out how to do the main part of it (using the ImageMagick components, for the curious); I’m trying to automate the configuration system.

To do that, I need a way to determine the dimensions of the individual screens are. Can anyone give me a hint where to look for that? I presume the X server itself has the information, but I’m not sure how my program can ask for it.

  • 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-11T16:48:01+00:00Added an answer on May 11, 2026 at 4:48 pm

    It looks like there’s a libXinerama API that can retrieve that information. I haven’t found any detailed information on it yet though.

    General X.org programming information can be found here (PDF file). Information on the functions provided by libXinerama can be found here (online copy of a manpage, not a lot of information in it).

    Here’s a small C++ program that I whipped up from those references to retrieve the dimensions and offsets of each of the monitors hooked into Xinerama. It also works for nVidia TwinView; I don’t presently have an ATI card to test it on their BigDesktop system, but I suspect it would work on it as well.

    #include <cstdlib>
    #include <iostream>
    
    #include <X11/extensions/Xinerama.h>
    
    using std::cout;
    using std::endl;
    
    int main(int argc, char *argv[]) {
        bool success=false;
        Display *d=XOpenDisplay(NULL);
        if (d) {
            int dummy1, dummy2;
            if (XineramaQueryExtension(d, &dummy1, &dummy2)) {
                if (XineramaIsActive(d)) {
                    int heads=0;
                    XineramaScreenInfo *p=XineramaQueryScreens(d, &heads);
                    if (heads>0) {
                        for (int x=0; x<heads; ++x)
                            cout << "Head " << x+1 << " of " << heads << ": " <<
                                p[x].width << "x" << p[x].height << " at " <<
                                p[x].x_org << "," << p[x].y_org << endl;
                        success=true;
                    } else cout << "XineramaQueryScreens says there aren't any" << endl;
                    XFree(p);
                } else cout << "Xinerama not active" << endl;
            } else cout << "No Xinerama extension" << endl;
            XCloseDisplay(d);
        } else cout << "Can't open display" << endl;
    
        return (success ? EXIT_SUCCESS : EXIT_FAILURE);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.