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 8852717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:28:17+00:00 2026-06-14T13:28:17+00:00

Is there a way to create a window with Xlib which only display the

  • 0

Is there a way to create a window with Xlib which only display the border lines, title, close button and that you can move with the mouse? The content of the window must be empty (or “totally transparent”, although “transparency” sounds more like an effect I don’t need). Basically the window should show the background area.

  • 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-06-14T13:28:18+00:00Added an answer on June 14, 2026 at 1:28 pm

    I’m not sure if it is what you want, but following code creates an X window with transparent background but still using the window decoration of your window manager.

    It will only work though if your X11 and graphics hardware configuration supports visuals with a depth of 32 bit.

    #include <X11/Xlib.h>
    #include <X11/Xutil.h>
    
    int main(int argc, char* argv[])
    {
        Display* display = XOpenDisplay(NULL);
    
        XVisualInfo vinfo;
        XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &vinfo);
    
        XSetWindowAttributes attr;
        attr.colormap = XCreateColormap(display, DefaultRootWindow(display), vinfo.visual, AllocNone);
        attr.border_pixel = 0;
        attr.background_pixel = 0;
    
        Window win = XCreateWindow(display, DefaultRootWindow(display), 0, 0, 300, 200, 0, vinfo.depth, InputOutput, vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr);
        XSelectInput(display, win, StructureNotifyMask);
        GC gc = XCreateGC(display, win, 0, 0);
    
        Atom wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", 0);
        XSetWMProtocols(display, win, &wm_delete_window, 1);
    
        XMapWindow(display, win);
    
        int keep_running = 1;
        XEvent event;
    
        while (keep_running) {
            XNextEvent(display, &event);
    
            switch(event.type) {
                case ClientMessage:
                    if (event.xclient.message_type == XInternAtom(display, "WM_PROTOCOLS", 1) && (Atom)event.xclient.data.l[0] == XInternAtom(display, "WM_DELETE_WINDOW", 1))
                        keep_running = 0;
    
                    break;
    
                default:
                    break;
            }
        }
    
        XDestroyWindow(display, win);
        XCloseDisplay(display);
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to create a window (similar to a screen-saver) that will
Is there a way to create a mini window in flash that contain an
Is there a way to create a ScrollViewer which only allows content to scroll
Is there a way to create a callback function that fires when a list
Is there any way to create a dynamic Pinterest button? I'm trying to add
Is there a way to create a new code window in Visual Studio 2010
Is there a way to create a conditional binding in XAML? Example: <Window x:Name=Me
Is there any way to create a custom animation for NSPopover? I can switch
i'm trying to create a window that can be scaled, just like the iPhone/iPad
Is there a way to create a fixed position window (a transparent Div?)centered in

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.