xwindow_buttons_grab(): Ignore XCB_NONE as window

Trying to grab buttons on window "XCB_NONE" results in an X11 error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-09-30 18:19:23 +02:00
parent 2452747e04
commit f0297e5dd2
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ xwindow_configure(xcb_window_t win, area_t geometry, int border)
void
xwindow_buttons_grab(xcb_window_t win, button_array_t *buttons)
{
if(win == XCB_NONE)
return;
/* Ungrab everything first */
xcb_ungrab_button(globalconf.connection, XCB_BUTTON_INDEX_ANY, win, XCB_BUTTON_MASK_ANY);