watch focus event
This commit is contained in:
parent
f12d5332a8
commit
4cb4e9f8d4
9
x.c
9
x.c
@ -443,6 +443,10 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
|
|||||||
context_menu();
|
context_menu();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FocusIn:
|
||||||
|
case FocusOut:
|
||||||
|
printf("Focus Event\n");
|
||||||
|
wake_up();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -688,7 +692,7 @@ void x_win_setup(void)
|
|||||||
wa.background_pixmap = ParentRelative;
|
wa.background_pixmap = ParentRelative;
|
||||||
wa.event_mask =
|
wa.event_mask =
|
||||||
ExposureMask | KeyPressMask | VisibilityChangeMask |
|
ExposureMask | KeyPressMask | VisibilityChangeMask |
|
||||||
ButtonPressMask;
|
ButtonPressMask | FocusChangeMask;
|
||||||
|
|
||||||
screen_info scr;
|
screen_info scr;
|
||||||
x_screen_info(&scr);
|
x_screen_info(&scr);
|
||||||
@ -704,6 +708,9 @@ void x_win_setup(void)
|
|||||||
setopacity(xctx.win,
|
setopacity(xctx.win,
|
||||||
(unsigned long)((100 - settings.transparency) *
|
(unsigned long)((100 - settings.transparency) *
|
||||||
(0xffffffff / 100)));
|
(0xffffffff / 100)));
|
||||||
|
|
||||||
|
long root_event_mask = FocusChangeMask;
|
||||||
|
XSelectInput(xctx.dpy, root, root_event_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user