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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:42:02+00:00 2026-05-30T10:42:02+00:00

When creating a Window in XLib What are the masks I provide to the

  • 0

When creating a Window in XLib

  1. What are the masks I provide to the SetWindowAttributes.event_mask member?
  2. What do I have to pass to the 11th paramater of XCreateWindow()
  3. What are the Events I am looking for in the main message loop (Where I use XNextEvent(lDisplay, &xEvent);?
  4. Since X behaves differently than Microsoft’s Win32 API, how do I determine if the mouse is over my window or a window in my “Application” and not over the desktop?

I have looked for a similar post. If there is already one out there please point me in the right direction.


Update

For those who want the easy answer to parts 1-3:

1.

xAttributes.event_mask =  ExposureMask | KeyPressMask | ButtonPress |
                          StructureNotifyMask | ButtonReleaseMask |
                          KeyReleaseMask | EnterWindowMask | LeaveWindowMask |
                          PointerMotionMask | Button1MotionMask | VisibilityChangeMask |
                          ColormapChangeMask;

2.

unsigned long valuemask = CWEventMask | CWBackPixel | CWBorderPixel | CWCursor;


  1.                 switch (xEvent.type)
                    {
                    case MapNotify:
                        break;
                    case Expose:
                        // If this is not the last expose event break
                        if (xEvent.xexpose.count != 0)
                            break;
                        else
                            break;
                    case ConfigureNotify:
                        break;
                    case VisibilityNotify:
                        break;
                    case DestroyNotify:
                        break;
                    case ButtonPress:
                    case ButtonRelease:
                    case EnterNotify:
                    case MotionNotify:
                    case LeaveNotify:
                        if(_mouseHandler)
                            _mouseHandler->HandleInput(lDisplay, &xEvent);
                        break;
                    case KeyPress:
                    case KeyRelease:
                        if(_keyboardHandler)
                            _keyboardHandler->HandleInput(lDisplay, &xEvent);
                        break;
                    default:
                        if(_keyboardHandler)
                            _keyboardHandler->HandleInput(lDisplay, &xEvent);
                        break;
                    }
    
  • 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-30T10:42:03+00:00Added an answer on May 30, 2026 at 10:42 am

    XLib is pretty well documented. For example XLib Programming Manual: Event Masks

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

Sidebar

Related Questions

I am creating window c# desktop application I have three columns in my datagridview
I have a query I am creating a Window App in vb.net (4.0) in
Win32 API provides many styles for window creating and I'm looking for a style
I have an opengl program and I am using SDL for the window creating
I am creating window application basic. As i have created datagrid with 2 columns
When creating a window using CreateWindow(...) , which requires the window width and height,
In previous versions of Xcode creating a window-based, universal application would populate the project
Im creating a navigation window with tabs round cornered. im trying to do this
I am creating a modal window using Twitter Bootstrap. The default behavior is if
I am creating an X11 window for a game, but it seems to only

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.