Recent

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

Key-Real

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

var
     e:TxEVENT;

...

  while XPending(gfxDisplay)<>0 do begin
              XNextEvent(gfxDisplay,@e);

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




how to minimize a X11 window?

MarkMLl

  • 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.

MarkMLl
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: https://github.com/MarkMLl?tab=repositories

rsz

  • 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.
Source: https://github.com/jordansissel/xdotool/blob/c3a3bf29120f295caaec5d401d77956860a82363/xdo.c#L1965

So the function you are looking for is XIconifyWindow:
https://tronche.com/gui/x/xlib/ICC/client-to-window-manager/XIconifyWindow.html

 

TinyPortal © 2005-2018