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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:53:52+00:00 2026-06-09T21:53:52+00:00

I am working on an X11 window manager, writing it in python. I am

  • 0

I am working on an X11 window manager, writing it in python. I am encountering a problem, where I get, and handle ConfigureWindowEvents. But, even then, when a window is mapped, it shows up as a two pixel high, one pixel wide window. I have put together the following example code so that others may test it, and tell me if I am doing this wrong. I based my ConfigureEvent handling code on qtile’s

import xcb
import xcb.xproto as xproto
from xcb.xproto import ConfigWindow as cw

conn = xcb.connect()
root = conn.get_setup().roots[0].root
eventmask = [xproto.EventMask.SubstructureRedirect]
err =conn.core.ChangeWindowAttributesChecked(root, xproto.CW.EventMask, eventmask)
check = err.check()
if check:
    print check

while True:
    e = conn.wait_for_event()

    if isinstance(e, xproto.MapRequestEvent):
        conn.core.MapWindow(e.window)

    if isinstance(e, xproto.ConfigureRequestEvent):
        y = x = w = h = bw = 0
        if e.value_mask & cw.X:
            x = e.x
            print "x:", x
        if e.value_mask & cw.Y:
            y = e.y
            print "y:", y
        if e.value_mask & cw.Height:
            h = e.height
            print "h:", h
        if e.value_mask & cw.Width:
            w = e.width
            print 'w:', w
        if e.value_mask & cw.BorderWidth:
            bw = e.border_width
            print 'bw:', bw
        mask = cw.X | cw.Y |  cw.Width | cw.Height | cw.BorderWidth
        values = {cw.X: x, cw.Y: y, cw.Width:  w, cw.Height: h, cw.BorderWidth: bw}
        err = conn.core.ConfigureWindowChecked(e.window, mask, values)
        err.check()
    conn.flush()
    print e

I’m using the Checked functions in hope of catching errors

  • 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-09T21:53:53+00:00Added an answer on June 9, 2026 at 9:53 pm

    I got my answer from the xcb mailing list, it was quite fast:

    values = {cw.X: x, cw.Y: y, cw.Width:  w, cw.Height: h, cw.BorderWidth: bw}
    

    should be

    values = [x, y, w, h, bw]
    

    Then all was right with the world again.

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

Sidebar

Related Questions

I have a rather peculiar problem, when i'm working on Python in Max OSX
My python script is working now, but I'm having a little trouble: Here is
There is a team working on acceptance testing X11 GUI application in our company,
Working with H2 I get this error when I try to write a row
I have been porting my system to X11 and I have a problem with
I am currently working on a multi window application that spans over multiple screens.
Working with an .asp application that connects and displays data cleanly. Problem occurs with
I'm working with Python's Mechanize module. I've come across 3 different sites that cannot
I have a working project on Linux (Ubuntu 11.04), but when i try to
I'm working on project that need do call the same method several times, but

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.