Recent

Author Topic: How to minimize a X11 window  (Read 4831 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: 3077
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: 45
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

Seenkao

  • Full Member
  • ***
  • Posts: 223
Re: How to minimize a X11 window
« Reply #3 on: August 05, 2021, 09:52:59 pm »
rsz, я не думаю, что в данном случае, это правильное решение. Человек обрабатывает события приходящие.

Key-Real, события FocusIn и FocusOut.
Если есть желание, посмотрите процедуру в ZenGL - app_ProcessMessages. Модуль zgl_application.

Вообще довольно странно, что я нашёл больше информации на русском языке, чем на английском. Andru описывал на своём сайте создание низкоуровневых приложений для Linux.
ссылка, описание на русском  :(

google translate:
rsz, I do not think that in this case, this is the correct solution. The person processes incoming events.

Key-Real, FocusIn and FocusOut events.
If you want, look at the procedure in ZenGL - app_ProcessMessages. Zgl_application module.

In general, it's rather strange that I found more information in Russian than in English. Andru described on his website how to create low-level applications for Linux.
link, description in Russian :(

winni

  • Hero Member
  • *****
  • Posts: 2667
Re: How to minimize a X11 window
« Reply #4 on: August 05, 2021, 11:20:32 pm »


In general, it's rather strange that I found more information in Russian than in English.

Hi!

No  - that is known history.
The USSR had worldwide the best eduction in natural science.
Today the percentage of students  of computer science in the USA with an US-Passport is: 5% !!!

In the early days of the web there were a lot of russian pages with great Delphi-solutions. Especially for Low-Level-Jobs. You would not find them in other languages.

Like one ingenious pearl:
A soundcard driver for the PC speaker .....
Poor man's solution.....

Winni


« Last Edit: August 05, 2021, 11:24:15 pm by winni »

Fred vS

  • Hero Member
  • *****
  • Posts: 2388
    • StrumPract is the musicians best friend
Re: How to minimize a X11 window
« Reply #5 on: August 05, 2021, 11:33:08 pm »


In general, it's rather strange that I found more information in Russian than in English.

Hi!

No  - that is known history.
The USSR had worldwide the best eduction in natural science.
Today the percentage of students  of computer science in the USA with an US-Passport is: 5% !!!

In the early days of the web there were a lot of russian pages with great Delphi-solutions. Especially for Low-Level-Jobs. You would not find them in other languages.

Like one ingenious pearl:
A soundcard driver for the PC speaker .....
Poor man's solution.....

Winni

I totally agree with you.

Also I am impressed by the will of Russians to finish things that they started and to share their knowledge  .
For example, in the MSEgui project, the only complete and clear documentations + examples are in Russian.

Fre;D
« Last Edit: August 06, 2021, 12:37:06 am by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

winni

  • Hero Member
  • *****
  • Posts: 2667
Re: How to minimize a X11 window
« Reply #6 on: August 06, 2021, 12:50:58 am »
Hi!

Forgotten???

First man in space:

Yuri Gagarin, 1961-04-12 , 106 minutes,
three times higher than the billionaires of today

That was 60 years ago!!!

Winni
« Last Edit: August 06, 2021, 12:58:02 am by winni »

Fred vS

  • Hero Member
  • *****
  • Posts: 2388
    • StrumPract is the musicians best friend
Re: How to minimize a X11 window
« Reply #7 on: August 06, 2021, 05:01:15 am »
Hi!

Forgotten???

First man in space:

Yuri Gagarin, 1961-04-12 , 106 minutes,
three times higher than the billionaires of today

That was 60 years ago!!!

Winni

I remember a debate about the ink-pens used for the Apollo missions (no tablets in those time, all was on paper).
Millions of dollars spent to find a system that works in weightlessness .

The Russian solution, just as effective, was to use pencils.
« Last Edit: August 06, 2021, 05:04:55 am by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

rsz

  • New Member
  • *
  • Posts: 45
Re: How to minimize a X11 window
« Reply #8 on: August 06, 2021, 05:46:59 am »
rsz, I do not think that in this case, this is the correct solution. The person processes incoming events.
You are right of course, I was thinking of how to minimize windows for other programs not handling it in the current program.
« Last Edit: August 06, 2021, 06:46:43 am by rsz »

 

TinyPortal © 2005-2018