Модераторы: xvr
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> xfce4. Как получить список, запущенных окон? 
:(
    Опции темы
poss
Дата 14.8.2014, 01:05 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 24
Регистрация: 23.7.2014

Репутация: нет
Всего: нет



xfce4. Как получить список, запущенных окон?
PM MAIL   Вверх
tzirechnoy
Дата 14.8.2014, 19:06 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
***


Профиль
Группа: Завсегдатай
Сообщений: 1173
Регистрация: 30.1.2009

Репутация: 3
Всего: 16



xwininfo -root -tree

PS Прочти ICCCM.
PM MAIL   Вверх
poss
Дата 17.9.2014, 09:22 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 24
Регистрация: 23.7.2014

Репутация: нет
Всего: нет



выдало:
Код

root@xubuntu:~# xwininfo -root -tree

xwininfo: Window id: 0x2e0 (the root window) (has no name)

  Root window id: 0x2e0 (the root window) (has no name)
  Parent window id: 0x0 (none)
     80 children:
     0x3e000ee "Xfce Terminal": ()  10x10+-100+-100  +-100+-100
     0x3e00082 "Xfce Terminal": ("xfce4-terminal" "Xfce4-terminal")  166x211+332+157  +332+157
        1 child:
        0x3e00083 (has no name): ()  1x1+-1+-1  +331+156
     0x3e00048 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3e00001 "Xfce Terminal": ("xfce4-terminal" "Xfce4-terminal")  10x10+10+10  +10+10
        1 child:
        0x3e00002 (has no name): ()  1x1+-1+-1  +9+9
     0x260004e "Whisker Menu": ("wrapper-1.0" "Wrapper-1.0")  400x500+0+244  +0+244
        1 child:
        0x260004f (has no name): ()  1x1+-1+-1  +-1+243
     0x3a0004b (has no name): ()  104x21+629+27  +629+27
     0x300002f (has no name): ()  1x1+-1+-1  +-1+-1
     0x3000001 "xfce4-notifyd": ("xfce4-notifyd" "Xfce4-notifyd")  10x10+10+10  +10+10
        1 child:
        0x3000002 (has no name): ()  1x1+-1+-1  +9+9
     0x2a0084e "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  238x142+1112+601  +1112+601
        1 child:
        0x2a0084f (has no name): ()  1x1+-1+-1  +1111+600
     0x380006c "google-chrome": ("google-chrome" "Google-chrome")  200x200+0+0  +0+0
        1 child:
        0x380006d (has no name): ()  1x1+-1+-1  +-1+-1
     0x3a0004a "Chromium clipboard": ()  10x10+-100+-100  +-100+-100
     0x3800041 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3800026 "google-chrome": ("google-chrome" "Google-chrome")  200x200+0+0  +0+0
        1 child:
        0x3800027 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3800023 "google-chrome": ("google-chrome" "Google-chrome")  200x200+0+0  +0+0
        1 child:
        0x3800024 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3800003 "google-chrome": ("google-chrome" "Google-chrome")  200x200+0+0  +0+0
        1 child:
        0x3800004 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3800001 "google-chrome": ("google-chrome" "Google-chrome")  10x10+10+10  +10+10
        1 child:
        0x3800002 (has no name): ()  1x1+-1+-1  +9+9
     0x2e00001 "main": ("main" "VBoxClipboard")  1x1+0+0  +0+0
     0x3200004 (has no name): ()  1x1+0+0  +0+0
     0x3600069 (has no name): ()  1x1+-1+-1  +-1+-1
     0x360005d "VirtualBox": ("VirtualBox" "VirtualBox")  200x200+0+0  +0+0
        1 child:
        0x360005e (has no name): ()  1x1+-1+-1  +-1+-1
     0x3600003 "VirtualBox": ("VirtualBox" "VirtualBox")  200x200+0+0  +0+0
        1 child:
        0x3600004 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3600001 "VirtualBox": ("VirtualBox" "VirtualBox")  10x10+10+10  +10+10
        1 child:
        0x3600002 (has no name): ()  1x1+-1+-1  +9+9
     0xc09119 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  1x1+-100+-100  +-100+-100
        1 child:
        0xc0911a (has no name): ()  1x1+-1+-1  +-101+-101
     0x2000011 "Skype™ 4.3 for Linux": ("skype" "Skype")  720x472+323+148  +323+148
        1 child:
        0x2000024 (has no name): ()  1x1+-1+-1  +322+147
     0x2000029 "Skype™ 4.3 for Linux": ("skype" "Skype")  683x307+1100+311  +1100+311
     0x340005d "skype": ("skype" "Skype")  200x200+0+0  +0+0
        1 child:
        0x340005e (has no name): ()  1x1+-1+-1  +-1+-1
     0x2000004 (has no name): ()  1x1+0+0  +0+0
     0x2000002 "skype": ("skype" "Skype")  683x307+0+0  +0+0
        1 child:
        0x200000f (has no name): ()  100x30+0+0  +0+0
     0x3400003 "skype": ("skype" "Skype")  200x200+0+0  +0+0
        1 child:
        0x3400004 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3400001 "skype": ("skype" "Skype")  10x10+10+10  +10+10
        1 child:
        0x3400002 (has no name): ()  1x1+-1+-1  +9+9
     0xc00178 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  246x174+1120+570  +1120+570
        1 child:
        0xc00179 (has no name): ()  1x1+-1+-1  +1119+569
     0x2a00a50 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  210x265+1060+478  +1060+478
        1 child:
        0x2a00a51 (has no name): ()  1x1+-1+-1  +1059+477
     0x2a00094 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  255x456+1086+287  +1086+287
        1 child:
        0x2a00095 (has no name): ()  1x1+-1+-1  +1085+286
     0x1a0000b "Connection Information": ("nm-applet" "Nm-applet")  343x483+511+130  +511+130
        1 child:
        0x1a0000c (has no name): ()  1x1+-1+-1  +510+129
     0x1a00008 (has no name): ()  1x1+-1+-1  +-1+-1
     0x1400008 (has no name): ()  1x1+-1+-1  +-1+-1
     0xe00062 (has no name): ()  1x1+-1+-1  +-1+-1
     0xe00029 "Thunar": ()  10x10+-100+-100  +-100+-100
     0x10000b6 (has no name): ()  1x1+-1+-1  +-1+-1
     0x10000b4 "xfdesktop": ()  10x10+-100+-100  +-100+-100
     0x2c00001 "blueman-applet": ("blueman-applet" "Blueman-applet")  10x10+10+10  +10+10
        1 child:
        0x2c00002 (has no name): ()  1x1+-1+-1  +9+9
     0x2a00009 (has no name): ()  1x1+-1+-1  +-1+-1
     0x2a00001 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  10x10+10+10  +10+10
        1 child:
        0x2a00002 (has no name): ()  1x1+-1+-1  +9+9
     0xa004d2 (has no name): ()  1366x743+0+0  +0+0
     0x600004 (has no name): ()  10x10+0+0  +0+0
     0x260002e (has no name): ()  1x1+-1+-1  +-1+-1
     0x280004c "wrapper-1.0": ()  10x10+-100+-100  +-100+-100
     0x2800046 (has no name): ()  1x1+-1+-1  +-1+-1
     0xc00032 (has no name): ()  1x1+-1+-1  +-1+-1
     0xc0002f (has no name): ()  10x10+0+0  +0+0
     0x2800001 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  10x10+10+10  +10+10
        1 child:
        0x2800002 (has no name): ()  1x1+-1+-1  +9+9
     0x2600001 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  10x10+10+10  +10+10
        1 child:
        0x2600002 (has no name): ()  1x1+-1+-1  +9+9
     0x600003 (has no name): ()  1x1+-1+-1  +-1+-1
     0x2400003 "update-notifier": ()  10x10+-100+-100  +-100+-100
     0x2400001 "update-notifier": ("update-notifier" "Update-notifier")  10x10+10+10  +10+10
        1 child:
        0x2400002 (has no name): ()  1x1+-1+-1  +9+9
     0x2200001 "polkit-gnome-authentication-agent-1": ("polkit-gnome-authentication-agent-1" "Polkit-gnome-authentication-agent-1")  10x10+10+10  +10+10
        1 child:
        0x2200002 (has no name): ()  1x1+-1+-1  +9+9
     0x1c00001 "xfce4-volumed": ("xfce4-volumed" "Xfce4-volumed")  10x10+10+10  +10+10
        1 child:
        0x1c00002 (has no name): ()  1x1+-1+-1  +9+9
     0x1a00001 "NetworkManager Applet": ("nm-applet" "Nm-applet")  10x10+10+10  +10+10
        1 child:
        0x1a00002 (has no name): ()  1x1+-1+-1  +9+9
     0x1800001 "xfce4-power-manager": ("xfce4-power-manager" "Xfce4-power-manager")  10x10+10+10  +10+10
        1 child:
        0x1800002 (has no name): ()  1x1+-1+-1  +9+9
     0xa000cb (has no name): ()  1x1+-1+-1  +-1+-1
     0xa000ae "Xfwm4": ("xfwm4" "Xfwm4")  5x5+-1000+-1000  +-1000+-1000
        1 child:
        0xa000af (has no name): ()  1x1+-1+-1  +-1001+-1001
     0x1400003 "light-locker": ()  10x10+-100+-100  +-100+-100
     0x1400001 "light-locker": ("light-locker" "Light-locker")  10x10+10+10  +10+10
        1 child:
        0x1400002 (has no name): ()  1x1+-1+-1  +9+9
     0xa000ad (has no name): ()  10x10+-100+-100  +-100+-100
     0x1000001 "xfdesktop": ("xfdesktop" "Xfdesktop")  10x10+10+10  +10+10
        1 child:
        0x1000002 (has no name): ()  1x1+-1+-1  +9+9
     0xe00001 "Thunar": ("Thunar" "Thunar")  10x10+10+10  +10+10
        1 child:
        0xe00002 (has no name): ()  1x1+-1+-1  +9+9
     0xc00001 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  10x10+10+10  +10+10
        1 child:
        0xc00002 (has no name): ()  1x1+-1+-1  +9+9
     0xa00001 "xfwm4": ("xfwm4" "Xfwm4")  10x10+10+10  +10+10
        1 child:
        0xa00002 (has no name): ()  1x1+-1+-1  +9+9
     0x600001 "xfsettingsd": ("xfsettingsd" "Xfsettingsd")  10x10+10+10  +10+10
        1 child:
        0x600002 (has no name): ()  1x1+-1+-1  +9+9
     0x400003 (has no name): ()  1x1+1+1  +1+1
     0x400001 "xfce4-session": ("xfce4-session" "Xfce4-session")  10x10+10+10  +10+10
        1 child:
        0x400002 (has no name): ()  1x1+-1+-1  +9+9
     0xa000cf (has no name): ()  1x768+-1+0  +-1+0
     0xa000d0 (has no name): ()  1x768+1366+0  +1366+0
     0xa000d1 (has no name): ()  1366x1+0+-1  +0+-1
     0xa000d2 (has no name): ()  1366x1+0+768  +0+768
     0xa004ad (has no name): ()  1366x25+0+743  +0+743
        16 children:
        0xc00004 "xfce4-panel": ("xfce4-panel" "Xfce4-panel")  1366x25+0+0  +0+743
           4 children:
           0xc0002a (has no name): ()  156x24+1034+1  +1034+744
              1 child:
              0x2a00004 "wrapper-2.0": ("wrapper-2.0" "Wrapper-2.0")  156x24+0+0  +1034+744
                 1 child:
                 0x2a00005 (has no name): ()  1x1+-1+-1  +1033+743
           0xc00029 (has no name): ()  2x24+1032+1  +1032+744
              1 child:
              0x2800004 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  2x24+0+0  +1032+744
                 1 child:
                 0x2800005 (has no name): ()  1x1+-1+-1  +1031+743
           0xc00026 (has no name): ()  139x24+0+1  +0+744
              1 child:
              0x2600004 "wrapper-1.0": ("wrapper-1.0" "Wrapper-1.0")  139x24+0+0  +0+744
                 1 child:
                 0x2600005 (has no name): ()  1x1+-1+-1  +-1+743
           0xc00005 (has no name): ()  1x1+-1+-1  +-1+742
        0xa004bc (has no name): ()  1x1+0+0  +0+743
        0xa004bb (has no name): ()  1x1+0+0  +0+743
        0xa004ba (has no name): ()  1x1+0+0  +0+743
        0xa004b9 (has no name): ()  1x1+0+0  +0+743
        0xa004b8 (has no name): ()  1x1+0+0  +0+743
        0xa004b7 (has no name): ()  1x1+0+0  +0+743
        0xa004b6 (has no name): ()  1x1+0+0  +0+743
        0xa004b5 (has no name): ()  1x1+0+0  +0+743
        0xa004b4 (has no name): ()  1x1+0+0  +0+743
        0xa004b3 (has no name): ()  1x1+0+0  +0+743
        0xa004b2 (has no name): ()  1x1+0+0  +0+743
        0xa004b1 (has no name): ()  1x1+0+0  +0+743
        0xa004b0 (has no name): ()  1x1+0+0  +0+743
        0xa004af (has no name): ()  1x1+0+0  +0+743
        0xa004ae (has no name): ()  1x1+0+0  +0+743
     0xba9090 (has no name): ()  1366x743+0+0  +0+0
        16 children:
        0x3e00004 "Terminal - root@xubuntu: ~": ("xfce4-terminal" "Xfce4-terminal")  1366x719+0+24  +0+24
           1 child:
           0x3e00005 (has no name): ()  1x1+-1+-1  +-1+23
        0xba909f (has no name): ()  20x24+1346+0  +1346+0
        0xba909e (has no name): ()  20x24+1324+0  +1324+0
        0xba909d (has no name): ()  20x24+1302+0  +1302+0
        0xba909c (has no name): ()  1x1+0+0  +0+0
        0xba909b (has no name): ()  1x1+0+0  +0+0
        0xba909a (has no name): ()  20x24+0+0  +0+0
        0xba9099 (has no name): ()  563x3+8+0  +8+0
        0xba9098 (has no name): ()  1366x24+0+0  +0+0
        0xba9097 (has no name): ()  8x24+571+0  +571+0
        0xba9096 (has no name): ()  8x24+0+0  +0+0
        0xba9095 (has no name): ()  1x1+578+407  +578+407
        0xba9094 (has no name): ()  1x1+0+407  +0+407
        0xba9093 (has no name): ()  577x1+1+407  +1+407
        0xba9092 (has no name): ()  1x383+578+24  +578+24
        0xba9091 (has no name): ()  1x383+0+24  +0+24
     0xb012d8 (has no name): ()  1366x743+0+0  +0+0
        16 children:
        0x3a00001 "VPF::xfce4. Как получить список, запущенных окон? - Форум программистов - Google Chrome": ("Google-chrome" "Google-chrome")  1366x743+0+0  +0+0
        0xb012e7 (has no name): ()  1x1+0+0  +0+0
        0xb012e6 (has no name): ()  1x1+0+0  +0+0
        0xb012e5 (has no name): ()  1x1+0+0  +0+0
        0xb012e4 (has no name): ()  1x1+0+0  +0+0
        0xb012e3 (has no name): ()  1x1+0+0  +0+0
        0xb012e2 (has no name): ()  1x1+0+0  +0+0
        0xb012e1 (has no name): ()  1x1+0+0  +0+0
        0xb012e0 (has no name): ()  1x1+0+0  +0+0
        0xb012df (has no name): ()  1x1+0+0  +0+0
        0xb012de (has no name): ()  1x1+0+0  +0+0
        0xb012dd (has no name): ()  1x1+0+0  +0+0
        0xb012dc (has no name): ()  1x1+0+0  +0+0
        0xb012db (has no name): ()  1x1+0+0  +0+0
        0xb012da (has no name): ()  1x1+0+0  +0+0
        0xb012d9 (has no name): ()  1x1+0+0  +0+0
     0xb0043a (has no name): ()  1366x743+0+0  +0+0
        16 children:
        0x3200002 "debian 7 [Running] - Oracle VM VirtualBox": ("Qt-subapplication" "VirtualBox")  1366x719+0+24  +0+24
           5 children:
           0x32000a4 (has no name): ()  1x1+-1+-1  +-1+23
           0x3200015 (has no name): ()  1366x22+0+697  +0+721
           0x3200013 (has no name): ()  1366x27+0+0  +0+24
           0x3200011 (has no name): ()  1366x670+0+27  +0+51
              1 child:
              0x3200017 (has no name): ()  1366x670+0+0  +0+51
                 3 children:
                 0x3200019 (has no name): ()  720x15+0+385  +0+436
                 0x320001b (has no name): ()  15x480+625+0  +625+51
                 0x320001d (has no name): ()  1366x670+0+0  +0+51
           0x320000f (has no name): ()  100x30+0+0  +0+24
        0xb00449 (has no name): ()  20x24+1346+0  +1346+0
        0xb00448 (has no name): ()  20x24+1324+0  +1324+0
        0xb00447 (has no name): ()  20x24+1302+0  +1302+0
        0xb00446 (has no name): ()  1x1+0+0  +0+0
        0xb00445 (has no name): ()  1x1+0+0  +0+0
        0xb00444 (has no name): ()  20x24+0+0  +0+0
        0xb00443 (has no name): ()  1x1+0+0  +0+0
        0xb00442 (has no name): ()  1366x24+0+0  +0+0
        0xb00441 (has no name): ()  1x1+0+0  +0+0
        0xb00440 (has no name): ()  1x1+0+0  +0+0
        0xb0043f (has no name): ()  1x1+0+0  +0+0
        0xb0043e (has no name): ()  1x1+0+0  +0+0
        0xb0043d (has no name): ()  1x1+0+0  +0+0
        0xb0043c (has no name): ()  1x1+0+0  +0+0
        0xb0043b (has no name): ()  1x1+0+0  +0+0
     0xa0074a (has no name): ()  1366x768+0+0  +0+0
        16 children:
        0x1000003 "Desktop": ("xfdesktop" "Xfdesktop")  1366x768+0+0  +0+0
           1 child:
           0x1000004 (has no name): ()  1x1+-1+-1  +-1+-1
        0xa00759 (has no name): ()  1x1+0+0  +0+0
        0xa00758 (has no name): ()  1x1+0+0  +0+0
        0xa00757 (has no name): ()  1x1+0+0  +0+0
        0xa00756 (has no name): ()  1x1+0+0  +0+0
        0xa00755 (has no name): ()  1x1+0+0  +0+0
        0xa00754 (has no name): ()  1x1+0+0  +0+0
        0xa00753 (has no name): ()  1x1+0+0  +0+0
        0xa00752 (has no name): ()  1x1+0+0  +0+0
        0xa00751 (has no name): ()  1x1+0+0  +0+0
        0xa00750 (has no name): ()  1x1+0+0  +0+0
        0xa0074f (has no name): ()  1x1+0+0  +0+0
        0xa0074e (has no name): ()  1x1+0+0  +0+0
        0xa0074d (has no name): ()  1x1+0+0  +0+0
        0xa0074c (has no name): ()  1x1+0+0  +0+0
        0xa0074b (has no name): ()  1x1+0+0  +0+0



Как мне привести их в c++ к переменной типа window? Мне кажется ICCCM это уже лишнее, не так ли? мне нужно знать только api иксов?

Это сообщение отредактировал(а) poss - 17.9.2014, 09:26
PM MAIL   Вверх
tzirechnoy
Дата 17.9.2014, 23:31 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
***


Профиль
Группа: Завсегдатай
Сообщений: 1173
Регистрация: 30.1.2009

Репутация: 3
Всего: 16



Цитата
Как мне привести их в c++ к переменной типа window?


1) К Window.
2) И это libX11, а не C++.
3) man strtol. На первое число в каждой строке. Window -- это 32-bit цэлое, можно приводить одно к другому. Вообще, какой-то странно-детский вопрос. Можэт, сначала потренировать C/C++? На учебных примерах возрастающей сложности.
4) ICCCM -- это как раз обязательное. Вот Xproto вообще говоря можно не читать, а писать на каком-нибудь высокоуровневом тулките. А тем более -- Xlib, который вообще опцыональная обёртка, хотя и очень распространённая. А ICCCM -- это обязательный минимум для написания вменяемых приложэний под X11.
И да, разумеется, если ты вылез за пределы пользовательского приложэния -- т.е. вот полез в чужые окна, вот в это всё -- то Xproto, NETWM, Xlib, описание XKeyboard -- ужэ тожэ обязательны.
5) И да, xwininfo -root -tree -- было информацыей к размышлению. И исходником для ковыряния. И, собственно, скорее всего точным ответом на вопрос, который ты задал -- но неправильным на вопрос, который ты хотел задать.
А правильный ответ можно получить прочтя ICCCM и NETWM.


PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "С/С++: Программирование под Unix/Linux"
xvr
  • Проставьте несколько ключевых слов темы, чтобы её можно было легче найти.
  • Не забывайте пользоваться кнопкой "Код".
  • Вопросы мобильной разработки тут
  • Телепатов на форуме нет! Задавайте чёткий, конкретный и полный вопрос. Указывайте полностью ошибки компилятора и компоновщика.
  • Новое сообщение должно иметь прямое отношение к разделу форума. Флуд, флейм, оффтопик запрещены.
  • Категорически запрещается обсуждение вареза, "кряков", взлома программ и т.д.

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, xvr.

 
 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | C/C++: Программирование под Unix/Linux | Следующая тема »


 




[ Время генерации скрипта: 0.0902 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.