mirror of https://github.com/yshui/picom.git
Merge pull request #1075 from Monsterovich/fix-event-handling
This commit is contained in:
commit
8ee2162a1b
|
@ -26,6 +26,7 @@ Assuming you already have all the usual building tools installed (e.g. gcc, pyth
|
||||||
* libXext
|
* libXext
|
||||||
* xproto
|
* xproto
|
||||||
* xcb
|
* xcb
|
||||||
|
* xcb-util
|
||||||
* xcb-damage
|
* xcb-damage
|
||||||
* xcb-dpms
|
* xcb-dpms
|
||||||
* xcb-xfixes
|
* xcb-xfixes
|
||||||
|
|
11
src/event.c
11
src/event.c
|
@ -7,6 +7,7 @@
|
||||||
#include <X11/extensions/sync.h>
|
#include <X11/extensions/sync.h>
|
||||||
#include <xcb/damage.h>
|
#include <xcb/damage.h>
|
||||||
#include <xcb/randr.h>
|
#include <xcb/randr.h>
|
||||||
|
#include <xcb/xcb_event.h>
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -106,7 +107,7 @@ static inline xcb_window_t attr_pure ev_window(session_t *ps, xcb_generic_event_
|
||||||
|
|
||||||
static inline const char *ev_name(session_t *ps, xcb_generic_event_t *ev) {
|
static inline const char *ev_name(session_t *ps, xcb_generic_event_t *ev) {
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
switch (ev->response_type & 0x7f) {
|
switch (XCB_EVENT_RESPONSE_TYPE(ev)) {
|
||||||
CASESTRRET(FocusIn);
|
CASESTRRET(FocusIn);
|
||||||
CASESTRRET(FocusOut);
|
CASESTRRET(FocusOut);
|
||||||
CASESTRRET(CreateNotify);
|
CASESTRRET(CreateNotify);
|
||||||
|
@ -665,7 +666,7 @@ ev_selection_clear(session_t *ps, xcb_selection_clear_event_t attr_unused *ev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
|
void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
|
||||||
if ((ev->response_type & 0x7f) != KeymapNotify) {
|
if (XCB_EVENT_RESPONSE_TYPE(ev) != KeymapNotify) {
|
||||||
discard_pending(ps, ev->full_sequence);
|
discard_pending(ps, ev->full_sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,9 +688,10 @@ void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
|
||||||
// For even more details, see:
|
// For even more details, see:
|
||||||
// https://bugs.freedesktop.org/show_bug.cgi?id=35945
|
// https://bugs.freedesktop.org/show_bug.cgi?id=35945
|
||||||
// https://lists.freedesktop.org/archives/xcb/2011-November/007337.html
|
// https://lists.freedesktop.org/archives/xcb/2011-November/007337.html
|
||||||
auto proc = XESetWireToEvent(ps->dpy, ev->response_type, 0);
|
auto response_type = XCB_EVENT_RESPONSE_TYPE(ev);
|
||||||
|
auto proc = XESetWireToEvent(ps->dpy, response_type, 0);
|
||||||
if (proc) {
|
if (proc) {
|
||||||
XESetWireToEvent(ps->dpy, ev->response_type, proc);
|
XESetWireToEvent(ps->dpy, response_type, proc);
|
||||||
XEvent dummy;
|
XEvent dummy;
|
||||||
|
|
||||||
// Stop Xlib from complaining about lost sequence numbers.
|
// Stop Xlib from complaining about lost sequence numbers.
|
||||||
|
@ -708,6 +710,7 @@ void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
|
||||||
// XXX redraw needs to be more fine grained
|
// XXX redraw needs to be more fine grained
|
||||||
queue_redraw(ps);
|
queue_redraw(ps);
|
||||||
|
|
||||||
|
// the events sent from SendEvent will be ignored
|
||||||
switch (ev->response_type) {
|
switch (ev->response_type) {
|
||||||
case FocusIn: ev_focus_in(ps, (xcb_focus_in_event_t *)ev); break;
|
case FocusIn: ev_focus_in(ps, (xcb_focus_in_event_t *)ev); break;
|
||||||
case FocusOut: ev_focus_out(ps, (xcb_focus_out_event_t *)ev); break;
|
case FocusOut: ev_focus_out(ps, (xcb_focus_out_event_t *)ev); break;
|
||||||
|
|
|
@ -20,7 +20,7 @@ required_xcb_packages = [
|
||||||
]
|
]
|
||||||
|
|
||||||
required_packages = [
|
required_packages = [
|
||||||
'x11', 'x11-xcb', 'xcb-renderutil', 'xcb-image', 'xext', 'pixman-1'
|
'x11', 'x11-xcb', 'xcb-renderutil', 'xcb-image', 'xext', 'pixman-1', 'xcb-util'
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach i : required_packages
|
foreach i : required_packages
|
||||||
|
|
Loading…
Reference in New Issue