Skip to content
Browse files

Suppress duplicate ScreenChange events.

  • Loading branch information...
1 parent d8f2ca1 commit 90d977dc31ee4e083bbf04baccf4f73e7de6acd6 Kris Maglione committed with Suraj N. Kurapati Apr 13, 2012
Showing with 13 additions and 6 deletions.
  1. +6 −5 cmd/wmii/debug.h
  2. +1 −0 cmd/wmii/fs.c
  3. +5 −1 cmd/wmii/main.c
  4. +1 −0 cmd/wmii/message.c
View
11 cmd/wmii/debug.h
@@ -4,11 +4,12 @@ enum DebugOpt {
D9p = 1<<0,
DDnd = 1<<1,
DEvent = 1<<2,
- DEwmh = 1<<3,
- DFocus = 1<<4,
- DGeneric= 1<<5,
- DStack = 1<<6,
- NDebugOpt = 7,
+ DEvents = 1<<3,
+ DEwmh = 1<<4,
+ DFocus = 1<<5,
+ DGeneric= 1<<6,
+ DStack = 1<<7,
+ NDebugOpt = 8,
};
#define Debug(x) if(((debugflag|debugfile)&(x)) && setdebug(x))
View
1 cmd/wmii/fs.c
@@ -155,6 +155,7 @@ event(const char *format, ...) {
va_end(ap);
ixp_pending_write(&events, buffer, strlen(buffer));
+ Dprint(DEvents, "%s", buffer);
}
static int dflags;
View
6 cmd/wmii/main.c
@@ -160,6 +160,7 @@ regerror(char *err) {
void
init_screens(void) {
+ static int old_n, old_nscreens;
Rectangle *rects;
View *v;
int i, n, m;
@@ -216,7 +217,10 @@ init_screens(void) {
if(selview)
view_update(selview);
- event("ScreenChange %d %d\n", n, nscreens);
+ if (old_n != n || old_nscreens != nscreens)
+ event("ScreenChange %d %d\n", n, nscreens);
+ old_n = n;
+ old_nscreens = nscreens;
}
static void
View
1 cmd/wmii/message.c
@@ -113,6 +113,7 @@ char* debugtab[] = {
"9p",
"dnd",
"event",
+ "events",
"ewmh",
"focus",
"generic",

0 comments on commit 90d977d

Please sign in to comment.
Something went wrong with that request. Please try again.