diff options
| author | Po Lu | 2022-12-05 20:41:37 +0800 |
|---|---|---|
| committer | Po Lu | 2022-12-05 20:42:41 +0800 |
| commit | c1a3e8830bb2fa8c3e8056bb42360f3504c434e9 (patch) | |
| tree | 124305c7514becd8bb6b10a602000f5abf5fb684 /src | |
| parent | a8574e76ff054aa70598ac7c21abc39736be9874 (diff) | |
| download | emacs-c1a3e8830bb2fa8c3e8056bb42360f3504c434e9.tar.gz emacs-c1a3e8830bb2fa8c3e8056bb42360f3504c434e9.zip | |
Fix build with old XCB
* src/xfns.c (x_get_net_workarea):
* src/xterm.c (x_dnd_compute_toplevels, x_dnd_get_proxy_proto)
(x_dnd_get_wm_state_and_proto, handle_one_xevent): Do not
include xcb_aux.h. Use XA_ constants instead of XCB_ATOM_ ones.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 8 | ||||
| -rw-r--r-- | src/xterm.c | 31 |
2 files changed, 19 insertions, 20 deletions
diff --git a/src/xfns.c b/src/xfns.c index d713d3c378c..6d09527409c 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5723,13 +5723,13 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) | |||
| 5723 | = xcb_get_property (dpyinfo->xcb_connection, 0, | 5723 | = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 5724 | (xcb_window_t) dpyinfo->root_window, | 5724 | (xcb_window_t) dpyinfo->root_window, |
| 5725 | (xcb_atom_t) dpyinfo->Xatom_net_current_desktop, | 5725 | (xcb_atom_t) dpyinfo->Xatom_net_current_desktop, |
| 5726 | XCB_ATOM_CARDINAL, 0, 1); | 5726 | XA_CARDINAL, 0, 1); |
| 5727 | 5727 | ||
| 5728 | workarea_cookie | 5728 | workarea_cookie |
| 5729 | = xcb_get_property (dpyinfo->xcb_connection, 0, | 5729 | = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 5730 | (xcb_window_t) dpyinfo->root_window, | 5730 | (xcb_window_t) dpyinfo->root_window, |
| 5731 | (xcb_atom_t) dpyinfo->Xatom_net_workarea, | 5731 | (xcb_atom_t) dpyinfo->Xatom_net_workarea, |
| 5732 | XCB_ATOM_CARDINAL, 0, UINT32_MAX); | 5732 | XA_CARDINAL, 0, UINT32_MAX); |
| 5733 | 5733 | ||
| 5734 | reply = xcb_get_property_reply (dpyinfo->xcb_connection, | 5734 | reply = xcb_get_property_reply (dpyinfo->xcb_connection, |
| 5735 | current_desktop_cookie, &error); | 5735 | current_desktop_cookie, &error); |
| @@ -5740,7 +5740,7 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) | |||
| 5740 | else | 5740 | else |
| 5741 | { | 5741 | { |
| 5742 | if (xcb_get_property_value_length (reply) != 4 | 5742 | if (xcb_get_property_value_length (reply) != 4 |
| 5743 | || reply->type != XCB_ATOM_CARDINAL || reply->format != 32) | 5743 | || reply->type != XA_CARDINAL || reply->format != 32) |
| 5744 | rc = false; | 5744 | rc = false; |
| 5745 | else | 5745 | else |
| 5746 | current_workspace = *(uint32_t *) xcb_get_property_value (reply); | 5746 | current_workspace = *(uint32_t *) xcb_get_property_value (reply); |
| @@ -5755,7 +5755,7 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) | |||
| 5755 | free (error), rc = false; | 5755 | free (error), rc = false; |
| 5756 | else | 5756 | else |
| 5757 | { | 5757 | { |
| 5758 | if (rc && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 | 5758 | if (rc && reply->type == XA_CARDINAL && reply->format == 32 |
| 5759 | && (xcb_get_property_value_length (reply) / sizeof (uint32_t) | 5759 | && (xcb_get_property_value_length (reply) / sizeof (uint32_t) |
| 5760 | >= current_workspace + 4)) | 5760 | >= current_workspace + 4)) |
| 5761 | { | 5761 | { |
diff --git a/src/xterm.c b/src/xterm.c index d3842810c3f..ab31f0d93e6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -574,7 +574,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 574 | #ifdef USE_XCB | 574 | #ifdef USE_XCB |
| 575 | #include <xcb/xproto.h> | 575 | #include <xcb/xproto.h> |
| 576 | #include <xcb/xcb.h> | 576 | #include <xcb/xcb.h> |
| 577 | #include <xcb/xcb_aux.h> | ||
| 578 | #endif | 577 | #endif |
| 579 | 578 | ||
| 580 | /* If we have Xfixes extension, use it for pointer blanking. */ | 579 | /* If we have Xfixes extension, use it for pointer blanking. */ |
| @@ -3072,7 +3071,7 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo) | |||
| 3072 | 0, 0); | 3071 | 0, 0); |
| 3073 | get_property_cookies[i] | 3072 | get_property_cookies[i] |
| 3074 | = xcb_get_property (dpyinfo->xcb_connection, 0, (xcb_window_t) toplevels[i], | 3073 | = xcb_get_property (dpyinfo->xcb_connection, 0, (xcb_window_t) toplevels[i], |
| 3075 | (xcb_atom_t) dpyinfo->Xatom_wm_state, XCB_ATOM_ANY, | 3074 | (xcb_atom_t) dpyinfo->Xatom_wm_state, 0, |
| 3076 | 0, 2); | 3075 | 0, 2); |
| 3077 | xm_property_cookies[i] | 3076 | xm_property_cookies[i] |
| 3078 | = xcb_get_property (dpyinfo->xcb_connection, 0, (xcb_window_t) toplevels[i], | 3077 | = xcb_get_property (dpyinfo->xcb_connection, 0, (xcb_window_t) toplevels[i], |
| @@ -3083,7 +3082,7 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo) | |||
| 3083 | = xcb_get_property (dpyinfo->xcb_connection, 0, | 3082 | = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3084 | (xcb_window_t) toplevels[i], | 3083 | (xcb_window_t) toplevels[i], |
| 3085 | (xcb_atom_t) dpyinfo->Xatom_net_frame_extents, | 3084 | (xcb_atom_t) dpyinfo->Xatom_net_frame_extents, |
| 3086 | XCB_ATOM_CARDINAL, 0, 4); | 3085 | XA_CARDINAL, 0, 4); |
| 3087 | get_geometry_cookies[i] | 3086 | get_geometry_cookies[i] |
| 3088 | = xcb_get_geometry (dpyinfo->xcb_connection, (xcb_window_t) toplevels[i]); | 3087 | = xcb_get_geometry (dpyinfo->xcb_connection, (xcb_window_t) toplevels[i]); |
| 3089 | 3088 | ||
| @@ -3211,7 +3210,7 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo) | |||
| 3211 | { | 3210 | { |
| 3212 | if (xcb_get_property_value_length (extent_property_reply) == 16 | 3211 | if (xcb_get_property_value_length (extent_property_reply) == 16 |
| 3213 | && extent_property_reply->format == 32 | 3212 | && extent_property_reply->format == 32 |
| 3214 | && extent_property_reply->type == XCB_ATOM_CARDINAL) | 3213 | && extent_property_reply->type == XA_CARDINAL) |
| 3215 | { | 3214 | { |
| 3216 | fextents = xcb_get_property_value (extent_property_reply); | 3215 | fextents = xcb_get_property_value (extent_property_reply); |
| 3217 | frame_extents[0] = fextents[0]; | 3216 | frame_extents[0] = fextents[0]; |
| @@ -3585,13 +3584,13 @@ x_dnd_get_proxy_proto (struct x_display_info *dpyinfo, Window wdesc, | |||
| 3585 | xdnd_proxy_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3584 | xdnd_proxy_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3586 | (xcb_window_t) wdesc, | 3585 | (xcb_window_t) wdesc, |
| 3587 | (xcb_atom_t) dpyinfo->Xatom_XdndProxy, | 3586 | (xcb_atom_t) dpyinfo->Xatom_XdndProxy, |
| 3588 | XCB_ATOM_WINDOW, 0, 1); | 3587 | XA_WINDOW, 0, 1); |
| 3589 | 3588 | ||
| 3590 | if (proto_out) | 3589 | if (proto_out) |
| 3591 | xdnd_proto_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3590 | xdnd_proto_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3592 | (xcb_window_t) wdesc, | 3591 | (xcb_window_t) wdesc, |
| 3593 | (xcb_atom_t) dpyinfo->Xatom_XdndAware, | 3592 | (xcb_atom_t) dpyinfo->Xatom_XdndAware, |
| 3594 | XCB_ATOM_ATOM, 0, 1); | 3593 | XA_ATOM, 0, 1); |
| 3595 | 3594 | ||
| 3596 | if (proxy_out) | 3595 | if (proxy_out) |
| 3597 | { | 3596 | { |
| @@ -3603,7 +3602,7 @@ x_dnd_get_proxy_proto (struct x_display_info *dpyinfo, Window wdesc, | |||
| 3603 | else | 3602 | else |
| 3604 | { | 3603 | { |
| 3605 | if (reply->format == 32 | 3604 | if (reply->format == 32 |
| 3606 | && reply->type == XCB_ATOM_WINDOW | 3605 | && reply->type == XA_WINDOW |
| 3607 | && (xcb_get_property_value_length (reply) >= 4)) | 3606 | && (xcb_get_property_value_length (reply) >= 4)) |
| 3608 | *proxy_out = *(xcb_window_t *) xcb_get_property_value (reply); | 3607 | *proxy_out = *(xcb_window_t *) xcb_get_property_value (reply); |
| 3609 | 3608 | ||
| @@ -3621,7 +3620,7 @@ x_dnd_get_proxy_proto (struct x_display_info *dpyinfo, Window wdesc, | |||
| 3621 | else | 3620 | else |
| 3622 | { | 3621 | { |
| 3623 | if (reply->format == 32 | 3622 | if (reply->format == 32 |
| 3624 | && reply->type == XCB_ATOM_ATOM | 3623 | && reply->type == XA_ATOM |
| 3625 | && (xcb_get_property_value_length (reply) >= 4)) | 3624 | && (xcb_get_property_value_length (reply) >= 4)) |
| 3626 | *proto_out = (int) *(xcb_atom_t *) xcb_get_property_value (reply); | 3625 | *proto_out = (int) *(xcb_atom_t *) xcb_get_property_value (reply); |
| 3627 | 3626 | ||
| @@ -3805,15 +3804,15 @@ x_dnd_get_wm_state_and_proto (struct x_display_info *dpyinfo, | |||
| 3805 | wmstate_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3804 | wmstate_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3806 | (xcb_window_t) window, | 3805 | (xcb_window_t) window, |
| 3807 | (xcb_atom_t) dpyinfo->Xatom_wm_state, | 3806 | (xcb_atom_t) dpyinfo->Xatom_wm_state, |
| 3808 | XCB_ATOM_ANY, 0, 2); | 3807 | 0, 0, 2); |
| 3809 | xdnd_proto_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3808 | xdnd_proto_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3810 | (xcb_window_t) window, | 3809 | (xcb_window_t) window, |
| 3811 | (xcb_atom_t) dpyinfo->Xatom_XdndAware, | 3810 | (xcb_atom_t) dpyinfo->Xatom_XdndAware, |
| 3812 | XCB_ATOM_ATOM, 0, 1); | 3811 | XA_ATOM, 0, 1); |
| 3813 | xdnd_proxy_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3812 | xdnd_proxy_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3814 | (xcb_window_t) window, | 3813 | (xcb_window_t) window, |
| 3815 | (xcb_atom_t) dpyinfo->Xatom_XdndProxy, | 3814 | (xcb_atom_t) dpyinfo->Xatom_XdndProxy, |
| 3816 | XCB_ATOM_WINDOW, 0, 1); | 3815 | XA_WINDOW, 0, 1); |
| 3817 | xm_style_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, | 3816 | xm_style_cookie = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 3818 | (xcb_window_t) window, | 3817 | (xcb_window_t) window, |
| 3819 | (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO, | 3818 | (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO, |
| @@ -3860,7 +3859,7 @@ x_dnd_get_wm_state_and_proto (struct x_display_info *dpyinfo, | |||
| 3860 | else | 3859 | else |
| 3861 | { | 3860 | { |
| 3862 | if (reply->format == 32 | 3861 | if (reply->format == 32 |
| 3863 | && reply->type == XCB_ATOM_WINDOW | 3862 | && reply->type == XA_WINDOW |
| 3864 | && (xcb_get_property_value_length (reply) >= 4)) | 3863 | && (xcb_get_property_value_length (reply) >= 4)) |
| 3865 | *proxy_out = *(xcb_window_t *) xcb_get_property_value (reply); | 3864 | *proxy_out = *(xcb_window_t *) xcb_get_property_value (reply); |
| 3866 | 3865 | ||
| @@ -19239,7 +19238,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19239 | = xcb_get_property (dpyinfo->xcb_connection, 0, | 19238 | = xcb_get_property (dpyinfo->xcb_connection, 0, |
| 19240 | (xcb_window_t) FRAME_OUTER_WINDOW (f), | 19239 | (xcb_window_t) FRAME_OUTER_WINDOW (f), |
| 19241 | (xcb_atom_t) dpyinfo->Xatom_net_wm_window_opacity, | 19240 | (xcb_atom_t) dpyinfo->Xatom_net_wm_window_opacity, |
| 19242 | XCB_ATOM_CARDINAL, 0, 1); | 19241 | XA_CARDINAL, 0, 1); |
| 19243 | opacity_reply | 19242 | opacity_reply |
| 19244 | = xcb_get_property_reply (dpyinfo->xcb_connection, | 19243 | = xcb_get_property_reply (dpyinfo->xcb_connection, |
| 19245 | opacity_cookie, &error); | 19244 | opacity_cookie, &error); |
| @@ -19248,9 +19247,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19248 | free (error), rc = false; | 19247 | free (error), rc = false; |
| 19249 | else | 19248 | else |
| 19250 | rc = (opacity_reply->format == 32 | 19249 | rc = (opacity_reply->format == 32 |
| 19251 | && (opacity_reply->type == XCB_ATOM_CARDINAL | 19250 | && (opacity_reply->type == XA_CARDINAL |
| 19252 | || opacity_reply->type == XCB_ATOM_ATOM | 19251 | || opacity_reply->type == XA_ATOM |
| 19253 | || opacity_reply->type == XCB_ATOM_WINDOW) | 19252 | || opacity_reply->type == XA_WINDOW) |
| 19254 | && (xcb_get_property_value_length (opacity_reply) >= 4)); | 19253 | && (xcb_get_property_value_length (opacity_reply) >= 4)); |
| 19255 | 19254 | ||
| 19256 | if (rc) | 19255 | if (rc) |