How do I bring a processes window to the foreground on X Windows? (C++)

前端 未结 5 2024
小鲜肉
小鲜肉 2020-12-25 08:47

I have the PID for the process (and the name), I want to bring it to the front on linux (ubuntu). On mac I would simply do SetFrontProcess(pid), on windows I\'d

5条回答
  •  旧时难觅i
    2020-12-25 09:09

    From the bash command line, you could also use the terrific xdotool, which lets you specify the following to raise the XBMC window and type a backslash into it:

    xdotool search --name 'XBMC Media Center' windowactivate  --sync key backslash
    

    This program has an actual library under it, libxdo2, which you could use instead if XRaiseWindow fails you. I understand that libxdo goes to some lengths to always raise the window, regardless of windowmanager.

提交回复
热议问题