GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cannot raise window on top using configure() or raise_window() · Issue #280 · python-xlib/python-xlib

Cannot raise window on top using configure() or raise_window() #280

New issue
Copy link
New issue
Copy link
Open
Open
Cannot raise window on top using configure() or raise_window()#280
Copy link

Description

@invader-zimm
invader-zimm
opened on Dec 21, 2024
Issue body actions

I'm trying to bring a specific window on top of all else and set focus to it. This is what I have so far:

def focus_window(window_id):
    d = display.Display()
    window = d.create_resource_object('window', window_id)
    window.map()
    window.configure(x=10, y=30, width=800, height=600, stack_mode=X.Above)
    window.set_input_focus(X.RevertToParent, X.CurrentTime)
    d.sync()

if __name__ == "__main__":
    focus_window(0x034000fc)

With the code above, everything works except the window being drawn on top. The focus is put into the window of interest, said window is moved and resized as expected but it doesn't raise on top. If I use window.raise_window() nothing happens. Using either methods, I don't get any error messages, it just doesn't work.

Am I missing something, or doing something wrong? I'm using MATE Desktop (on X, of course), Python 3.12.7 on Fedora.

Also, is there a way to get the window ID from the process PID using python-xlib? At the moment I'm using wmctrl but I'm wondering if there's a better way.
Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.