代码: 全选
● xwininfo -tree -root|grep -C 6 desktop
0x2c005b5 (has no name): () 950x2+9+0 +902+355
0x2c005b4 (has no name): () 23x44+0+0 +893+355
0x1600111 (has no name): () 1920x1080+0+0 +0+0
1 child:
0x1600112 (has no name): () 1920x1080+0+0 +0+0
1 child:
0x1c00004 "桌面": ("desktop_window" "Nautilus") 1920x1080+0+0 +0+0
2 children:
0x1c00072 (has no name): () 1920x1080+0+0 +0+0
0x1c00005 (has no name): () 1x1+-1+-1 +-1+-1
0x1200003 "main.py": ("main.py" "Main.py") 24x14+1876+1026 +1876+1026
1 child:
0x1200004 (has no name): () 1x1+-1+-1 +1875+1025
代码: 全选
● dog drawonroot.pl
sub wininfo{
my $w=shift;
my ($x, $y, $width, $height, $depth) = $w->get_geometry;
printf "%10x:\t${width}x$height+$x+$y\@$depth\ttype:%s\n", $w->get_xid, $w->get_type_hint;
}
Gtk2->init;
$window=Gtk2::Gdk->get_default_root_window;
($drawable,$x_offset,$y_offset)=$window->get_internal_paint_info;
wininfo($window);
@wlist = $window->get_children;
foreach(@wlist){ wininfo($_); }
wininfo($_);
exit;
代码: 全选
● drawonroot.pl
15d: 1920x1080+0+0@24 type:normal
3c00001: 10x10+10+10@24 type:normal
a0000a: 10x10+0+0@24 type:normal
就算直接从xwininfo的结果得到 0x1c00004,怎么指定此窗口?
$_=Gtk2::Gdk::Window->lookup(0x1c00004); 可不行。