File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Applications/Workspace/WM Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 3434#include <X11/Xlib.h>
3535#include <X11/Xatom.h>
3636#include <string.h>
37+ #include <sys/time.h>
3738
3839#include <core/WMcore.h>
3940#include <core/util.h>
@@ -1847,13 +1848,16 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent *event)
18471848 // data.l[2] = direction
18481849 // data.l[3] = button
18491850 // data.l[4] = source indication
1850- static unsigned long last_event_serial = 0 ;
1851+ static struct timeval prev_time = {.tv_sec = 0L , .tv_usec = 0L };
1852+ struct timeval cur_time = {.tv_sec = 0L , .tv_usec = 0L };
18511853 XEvent xevent ;
18521854
1853- if (last_event_serial == event -> serial ) {
1855+ gettimeofday (& cur_time , NULL );
1856+ // fprintf(stderr, "%s: elapsed %li seconds since last XClientMessageEvent.\n", __func__,
1857+ // cur_time.tv_sec - prev_time.tv_sec);
1858+ if (prev_time .tv_sec > 0L && (cur_time .tv_sec - prev_time .tv_sec ) < 1L ) {
18541859 return False ;
18551860 }
1856- last_event_serial = event -> serial ;
18571861
18581862 // fprintf(stderr,
18591863 // "%s: _NET_WM_MOVERESIZE: %li, %li | direction: %li, button: %li, source direction: %li "
@@ -1895,6 +1899,7 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent *event)
18951899 }
18961900 break ;
18971901 }
1902+ gettimeofday (& prev_time , NULL );
18981903 return True ;
18991904 }
19001905
You can’t perform that action at this time.
0 commit comments