mirror of https://github.com/davatorium/rofi.git
Fix unclosable window bug.
Fix annoyance, when it failed to grab keyboard, it still shows windows and waits for input. This causes an unaccessible Rofi instance.
This commit is contained in:
parent
7887344d44
commit
aeefabe7a0
|
@ -485,7 +485,7 @@ int pointer_get ( Window root, int *x, int *y )
|
|||
return 0;
|
||||
}
|
||||
|
||||
int take_keyboard ( Window w )
|
||||
static int take_keyboard ( Window w )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1168,8 +1168,9 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
|||
XMoveResizeWindow ( display, box, x, y, w, h );
|
||||
XMapRaised ( display, box );
|
||||
|
||||
take_keyboard ( box );
|
||||
|
||||
// if grabbing keyboard failed, fall through
|
||||
if(take_keyboard ( box ))
|
||||
{
|
||||
for (;; )
|
||||
{
|
||||
XEvent ev;
|
||||
|
@ -1399,6 +1400,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
|||
}
|
||||
|
||||
release_keyboard ();
|
||||
}
|
||||
|
||||
if ( *input != NULL )
|
||||
{
|
||||
|
@ -1407,8 +1409,6 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
|||
|
||||
*input = strdup ( text->text );
|
||||
|
||||
|
||||
|
||||
textbox_free ( text );
|
||||
|
||||
for ( i = 0; i < max_lines; i++ )
|
||||
|
|
Loading…
Reference in New Issue