mirror of
https://github.com/davatorium/rofi.git
synced 2025-03-10 17:06:37 -04:00
Merge remote-tracking branch 'origin/master' into glib-loop
This commit is contained in:
commit
874f587021
1 changed files with 0 additions and 26 deletions
|
@ -140,32 +140,6 @@ static int switcher_get ( const char *name )
|
|||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param display Connection to the X server.
|
||||
* @param x11_fd File descriptor from the X server to listen on.
|
||||
*
|
||||
* Function waits for a new XEvent with a timeout.
|
||||
*/
|
||||
static inline MainLoopEvent wait_for_xevent_or_timeout ( Display *display, int x11_fd )
|
||||
{
|
||||
// Check if events are pending.
|
||||
if ( XPending ( display ) ) {
|
||||
return ML_XEVENT;
|
||||
}
|
||||
// If not, wait for timeout.
|
||||
struct timeval tv = { .tv_usec = 200000, .tv_sec = 0 };
|
||||
fd_set in_fds;
|
||||
// Create a File Description Set containing x11_fd
|
||||
FD_ZERO ( &in_fds );
|
||||
FD_SET ( x11_fd, &in_fds );
|
||||
|
||||
// Wait for X Event or a Timer
|
||||
if ( select ( x11_fd + 1, &in_fds, 0, 0, &tv ) == 0 ) {
|
||||
return ML_TIMEOUT;
|
||||
}
|
||||
return ML_XEVENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Levenshtein Sorting.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue