![]() |
![]()
| ![]() |
![]()
NAMEX11::Protocol::ChooseWindow -- user click to choose window SYNOPSISuse X11::Protocol::ChooseWindow; my $client_window = X11::Protocol::ChooseWindow->choose (X => $X); DESCRIPTIONThis spot of code lets the user click on a toplevel window to choose it, in a similar style to the "xwininfo" or "xkill" programs. ImplementationThe choose is implemented in a similar way to the "xwininfo" etc programs. It consists of GrabPointer() on the root window, wait for a "ButtonPress" and "ButtonRelease" from the user, get the frame window from the "ButtonPress" event, then the client window under there from frame_window_to_client() of "X11::Protocol::WM". "KeyPress" events are not used and they go to the focus window in the usual way. This can be good in a command line program since it lets the user press "^C" ("SIGINT") in an "xterm" or similar. Perhaps in the future there could be an option to watch for "Esc" to cancel or some such. A virtual root per root_to_virtual_root() in "X11::Protocol::WM" is used if present. This helps "ChooseWindow" work with "amiwm" and similar virtual root window managers. FUNCTIONSThe following choose() is in class method style with the intention of perhaps in the future having objects of type "X11::Protocol::ChooseWindow" holding state and advanced by events supplied by an external main loop. Choosing
SEE ALSOX11::Protocol, X11::Protocol::WM, X11::CursorFont xwininfo(1), xkill(1), and their dsimple.c Select_Window() code "Inter-Client Communication Conventions Manual" section "WM_STATE Property" for notes on using "WM_STATE" to identify client windows. HOME PAGE<http://user42.tuxfamily.org/x11-protocol-other/index.html> LICENSECopyright 2010, 2011, 2012, 2013, 2014, 2016, 2017, 2019 Kevin Ryde X11-Protocol-Other is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. X11-Protocol-Other is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>.
|