Lazarus
Free Pascal => Unix => Topic started by: Key-Real 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?
-
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
-
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
-
rsz, я не думаю, что в данном случае, это правильное решение. Человек обрабатывает события приходящие.
Key-Real, события FocusIn и FocusOut.
Если есть желание, посмотрите процедуру в ZenGL - app_ProcessMessages. Модуль zgl_application.
Вообще довольно странно, что я нашёл больше информации на русском языке, чем на английском. Andru описывал на своём сайте создание низкоуровневых приложений для Linux.
ссылка, описание на русском (http://andru-kun.inf.ua/articles.html) :(
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 (http://andru-kun.inf.ua/articles.html) :(
-
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
-
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
-
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
-
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.
-
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.