diff --git a/.github/workflows/apidoc.yml b/.github/workflows/apidoc.yml index 50c8c94dc..faddc2a06 100644 --- a/.github/workflows/apidoc.yml +++ b/.github/workflows/apidoc.yml @@ -66,6 +66,8 @@ jobs: libxcb-shape0-dev \ libxcb-util0-dev \ libxcb-xfixes0-dev \ + libxcb-composite0-dev \ + libxcb-damage0-dev \ libxcb-xinerama0-dev \ libxcb-xkb-dev \ libxcb-xrm-dev \ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 228536aca..628d422aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -116,6 +116,8 @@ jobs: libxcb-shape0-dev \ libxcb-util0-dev \ libxcb-xfixes0-dev \ + libxcb-composite0-dev \ + libxcb-damage0-dev \ libxcb-xinerama0-dev \ libxcb-xkb-dev \ libxcb-xrm-dev \ diff --git a/awesome.c b/awesome.c index 2b17c725f..f5da5d512 100644 --- a/awesome.c +++ b/awesome.c @@ -55,6 +55,8 @@ #include #include #include +#include +#include #include @@ -725,6 +727,8 @@ main(int argc, char **argv) xcb_prefetch_extension_data(globalconf.connection, &xcb_xinerama_id); xcb_prefetch_extension_data(globalconf.connection, &xcb_shape_id); xcb_prefetch_extension_data(globalconf.connection, &xcb_xfixes_id); + xcb_prefetch_extension_data(globalconf.connection, &xcb_composite_id); + xcb_prefetch_extension_data(globalconf.connection, &xcb_damage_id); if (xcb_cursor_context_new(globalconf.connection, globalconf.screen, &globalconf.cursor_ctx) < 0) fatal("Failed to initialize xcb-cursor"); @@ -793,6 +797,18 @@ main(int argc, char **argv) xcb_discard_reply(globalconf.connection, xcb_xfixes_query_version(globalconf.connection, 1, 0).sequence); + query = xcb_get_extension_data(globalconf.connection, &xcb_composite_id); + globalconf.have_composite = query && query->present; + if (globalconf.have_composite) + xcb_discard_reply(globalconf.connection, + xcb_composite_query_version(globalconf.connection, 0, 3).sequence); + + query = xcb_get_extension_data(globalconf.connection, &xcb_damage_id); + globalconf.have_damage = query && query->present; + if (globalconf.have_damage) + xcb_discard_reply(globalconf.connection, + xcb_damage_query_version(globalconf.connection, 1, 0).sequence); + event_init(); /* Allocate the key symbols */ diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 592c2b252..83928a3d5 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -148,6 +148,8 @@ set(AWESOME_DEPENDENCIES xcb-icccm xcb-icccm>=0.3.8 xcb-xfixes + xcb-composite + xcb-damage # NOTE: it's not clear what version is required, but 1.10 works at least. # See https://github.com/awesomeWM/awesome/pull/149#issuecomment-94208356. xcb-xkb diff --git a/docs/10-building-and-testing.md b/docs/10-building-and-testing.md index b68fd4ccb..b0d511044 100644 --- a/docs/10-building-and-testing.md +++ b/docs/10-building-and-testing.md @@ -16,6 +16,8 @@ environment): - [libxcb-keysyms >= 0.3.4](https://xcb.freedesktop.org/) - [libxcb-icccm >= 0.3.8](https://xcb.freedesktop.org/) - [libxcb-xfixes](https://xcb.freedesktop.org/) +- [libxcb-composite](https://xcb.freedesktop.org/) +- [libxcb-damage](https://xcb.freedesktop.org/) - [xcb-util-xrm >= 1.0](https://github.com/Airblader/xcb-util-xrm) - [libxkbcommon](http://xkbcommon.org/) with X11 support enabled - [libstartup-notification >= diff --git a/event.c b/event.c index 0e0ac4329..cda05049d 100644 --- a/event.c +++ b/event.c @@ -47,6 +47,7 @@ #include #include #include +#include #define DO_EVENT_HOOK_CALLBACK(type, xcbtype, xcbeventprefix, arraytype, match) \ static void \ @@ -1023,6 +1024,10 @@ event_handle_selectionclear(xcb_selection_clear_event_t *ev) selection_handle_selectionclear(ev); } +static void +event_handle_damage_notify(xcb_damage_notify_event_t *ev) { +} + /** \brief awesome xerror function. * There's no way to check accesses to destroyed windows, thus those cases are * ignored (especially on UnmapNotify's). @@ -1143,6 +1148,7 @@ void event_handle(xcb_generic_event_t *event) EXTENSION_EVENT(shape, XCB_SHAPE_NOTIFY, event_handle_shape_notify); EXTENSION_EVENT(xkb, 0, event_handle_xkb_notify); EXTENSION_EVENT(xfixes, XCB_XFIXES_SELECTION_NOTIFY, event_handle_xfixes_selection_notify); + EXTENSION_EVENT(damage, XCB_DAMAGE_NOTIFY, event_handle_damage_notify); #undef EXTENSION_EVENT } @@ -1165,6 +1171,10 @@ void event_init(void) reply = xcb_get_extension_data(globalconf.connection, &xcb_xfixes_id); if (reply && reply->present) globalconf.event_base_xfixes = reply->first_event; + + reply = xcb_get_extension_data(globalconf.connection, &xcb_damage_id); + if (reply && reply->present) + globalconf.event_base_damage = reply->first_event; } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/globalconf.h b/globalconf.h index 970849bf5..cd4854f75 100644 --- a/globalconf.h +++ b/globalconf.h @@ -126,6 +126,10 @@ typedef struct bool have_xkb; /** Check for XFixes extension */ bool have_xfixes; + /** Check for Composite extension */ + bool have_composite; + /** Check for Damage extenion */ + bool have_damage; /** Custom searchpaths are present, the runtime is tinted */ bool have_searchpaths; /** When --no-argb is used in the modeline or command line */ @@ -134,6 +138,7 @@ typedef struct uint8_t event_base_xkb; uint8_t event_base_randr; uint8_t event_base_xfixes; + uint8_t event_base_damage; /** Clients list */ client_array_t clients; /** Embedded windows */