Author Topic: How to minimize a X11 window  (Read 880 times)


  • New Member
  • *
  • Posts: 21
How to minimize a X11 window
« on: March 14, 2021, 01:02:37 pm »
I have a main loop like:



  while XPending(gfxDisplay)<>0 do begin

              if (e._type=keypress) or (e._type=keyrelease) then break;

how to minimize a X11 window?


  • Hero Member
  • *****
  • Posts: 2878
Re: How to minimize a X11 window
« Reply #1 on: March 14, 2021, 02:28:20 pm »
Since this is normally something done by the window manager rather than by a program itself, I suspect that you're going to need to invoke wmctrl. You might find that you can use an API instead, but it would be functionally equivalent.

Working out the API will almost certainly be a pain, but it would be a better choice since you can't rely on wmctrl being universally installed... I had to investigate this stuff a few months ago since I needed a list of windows that looked like unrequited dialog(ue)s for monitoring purposes.

Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories:


  • New Member
  • *
  • Posts: 27
Re: How to minimize a X11 window
« Reply #2 on: August 04, 2021, 11:06:23 am »
Take a look at how xdotool does it. It uses the XIconifyWindow function to minimize any window.

So the function you are looking for is XIconifyWindow:


TinyPortal © 2005-2018