Browse Source

fix some deprecated atom constants

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Gregor Best 9 years ago
parent
commit
5d0a81c8bf
8 changed files with 39 additions and 38 deletions
  1. 2
    1
      common/xutil.h
  2. 18
    18
      ewmh.c
  3. 1
    1
      objects/widget.c
  4. 1
    1
      objects/widgets/systray.c
  5. 12
    12
      property.c
  6. 2
    2
      selection.c
  7. 1
    1
      systray.c
  8. 2
    2
      xwindow.c

+ 2
- 1
common/xutil.h View File

@@ -27,6 +27,7 @@
27 27
 #include <xcb/xcb_aux.h>
28 28
 #include <xcb/xcb_event.h>
29 29
 #include <xcb/xcb_atom.h>
30
+#include <xcb/xproto.h>
30 31
 
31 32
 #include "common/array.h"
32 33
 #include "common/atoms.h"
@@ -35,7 +36,7 @@ static inline char *
35 36
 xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply)
36 37
 {
37 38
     if(reply
38
-       && (reply->type == STRING
39
+       && (reply->type == XCB_ATOM_STRING
39 40
            || reply->type == UTF8_STRING
40 41
            || reply->type == COMPOUND_TEXT)
41 42
        && reply->format == 8

+ 18
- 18
ewmh.c View File

@@ -72,7 +72,7 @@ ewmh_client_update_hints(lua_State *L)
72 72
         state[i++] = _NET_WM_STATE_DEMANDS_ATTENTION;
73 73
 
74 74
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
75
-                        c->window, _NET_WM_STATE, ATOM, 32, i, state);
75
+                        c->window, _NET_WM_STATE, XCB_ATOM_ATOM, 32, i, state);
76 76
 
77 77
     return 0;
78 78
 }
@@ -108,7 +108,7 @@ ewmh_update_desktop_geometry(int phys_screen)
108 108
 
109 109
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
110 110
                         xutil_screen_get(globalconf.connection, phys_screen)->root,
111
-                        _NET_DESKTOP_GEOMETRY, CARDINAL, 32, countof(sizes), sizes);
111
+                        _NET_DESKTOP_GEOMETRY, XCB_ATOM_CARDINAL, 32, countof(sizes), sizes);
112 112
 }
113 113
 
114 114
 static int
@@ -125,7 +125,7 @@ ewmh_update_net_active_window(lua_State *L)
125 125
 
126 126
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
127 127
 			xutil_screen_get(globalconf.connection, c->phys_screen)->root,
128
-			_NET_ACTIVE_WINDOW, WINDOW, 32, 1, &win);
128
+			_NET_ACTIVE_WINDOW, XCB_ATOM_WINDOW, 32, 1, &win);
129 129
 
130 130
     return 0;
131 131
 }
@@ -185,7 +185,7 @@ ewmh_init(int phys_screen)
185 185
     int i;
186 186
 
187 187
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
188
-                        xscreen->root, _NET_SUPPORTED, ATOM, 32,
188
+                        xscreen->root, _NET_SUPPORTED, XCB_ATOM_ATOM, 32,
189 189
                         countof(atom), atom);
190 190
 
191 191
     /* create our own window */
@@ -195,11 +195,11 @@ ewmh_init(int phys_screen)
195 195
                       XCB_COPY_FROM_PARENT, xscreen->root_visual, 0, NULL);
196 196
 
197 197
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
198
-                        xscreen->root, _NET_SUPPORTING_WM_CHECK, WINDOW, 32,
198
+                        xscreen->root, _NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 32,
199 199
                         1, &father);
200 200
 
201 201
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
202
-                        father, _NET_SUPPORTING_WM_CHECK, WINDOW, 32,
202
+                        father, _NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 32,
203 203
                         1, &father);
204 204
 
205 205
     /* set the window manager name */
@@ -209,7 +209,7 @@ ewmh_init(int phys_screen)
209 209
     /* set the window manager PID */
210 210
     i = getpid();
211 211
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
212
-                        father, _NET_WM_PID, CARDINAL, 32, 1, &i);
212
+                        father, _NET_WM_PID, XCB_ATOM_CARDINAL, 32, 1, &i);
213 213
 
214 214
     ewmh_update_desktop_geometry(phys_screen);
215 215
 
@@ -236,7 +236,7 @@ ewmh_update_net_client_list(int phys_screen)
236 236
 
237 237
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
238 238
 			xutil_screen_get(globalconf.connection, phys_screen)->root,
239
-			_NET_CLIENT_LIST, WINDOW, 32, n, wins);
239
+			_NET_CLIENT_LIST, XCB_ATOM_WINDOW, 32, n, wins);
240 240
 }
241 241
 
242 242
 /** Set the client list in stacking order, bottom to top.
@@ -254,7 +254,7 @@ ewmh_update_net_client_list_stacking(int phys_screen)
254 254
 
255 255
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
256 256
 			xutil_screen_get(globalconf.connection, phys_screen)->root,
257
-			_NET_CLIENT_LIST_STACKING, WINDOW, 32, n, wins);
257
+			_NET_CLIENT_LIST_STACKING, XCB_ATOM_WINDOW, 32, n, wins);
258 258
 }
259 259
 
260 260
 void
@@ -264,7 +264,7 @@ ewmh_update_net_numbers_of_desktop(int phys_screen)
264 264
 
265 265
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
266 266
 			xutil_screen_get(globalconf.connection, phys_screen)->root,
267
-			_NET_NUMBER_OF_DESKTOPS, CARDINAL, 32, 1, &count);
267
+			_NET_NUMBER_OF_DESKTOPS, XCB_ATOM_CARDINAL, 32, 1, &count);
268 268
 }
269 269
 
270 270
 void
@@ -274,7 +274,7 @@ ewmh_update_net_current_desktop(int phys_screen)
274 274
 
275 275
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
276 276
                         xutil_screen_get(globalconf.connection, phys_screen)->root,
277
-                        _NET_CURRENT_DESKTOP, CARDINAL, 32, 1, &idx);
277
+                        _NET_CURRENT_DESKTOP, XCB_ATOM_CARDINAL, 32, 1, &idx);
278 278
 }
279 279
 
280 280
 void
@@ -467,7 +467,7 @@ ewmh_client_update_desktop(client_t *c)
467 467
         if(is_client_tagged(c, tags->tab[i]))
468 468
         {
469 469
             xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
470
-                                c->window, _NET_WM_DESKTOP, CARDINAL, 32, 1, &i);
470
+                                c->window, _NET_WM_DESKTOP, XCB_ATOM_CARDINAL, 32, 1, &i);
471 471
             return;
472 472
         }
473 473
     /* It doesn't have any tags, remove the property */
@@ -500,7 +500,7 @@ ewmh_update_strut(xcb_window_t window, strut_t *strut)
500 500
         };
501 501
 
502 502
         xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
503
-                            window, _NET_WM_STRUT_PARTIAL, CARDINAL, 32, countof(state), state);
503
+                            window, _NET_WM_STRUT_PARTIAL, XCB_ATOM_CARDINAL, 32, countof(state), state);
504 504
     }
505 505
 }
506 506
 
@@ -518,10 +518,10 @@ ewmh_client_check_hints(client_t *c)
518 518
                                     _NET_WM_DESKTOP, XCB_GET_PROPERTY_TYPE_ANY, 0, 1);
519 519
 
520 520
     c1 = xcb_get_property_unchecked(globalconf.connection, false, c->window,
521
-                                    _NET_WM_STATE, ATOM, 0, UINT32_MAX);
521
+                                    _NET_WM_STATE, XCB_ATOM_ATOM, 0, UINT32_MAX);
522 522
 
523 523
     c2 = xcb_get_property_unchecked(globalconf.connection, false, c->window,
524
-                                    _NET_WM_WINDOW_TYPE, ATOM, 0, UINT32_MAX);
524
+                                    _NET_WM_WINDOW_TYPE, XCB_ATOM_ATOM, 0, UINT32_MAX);
525 525
 
526 526
     reply = xcb_get_property_reply(globalconf.connection, c0, NULL);
527 527
     if(reply && reply->value_len && (data = xcb_get_property_value(reply)))
@@ -598,7 +598,7 @@ ewmh_process_client_strut(client_t *c, xcb_get_property_reply_t *strut_r)
598 598
     if(!strut_r)
599 599
     {
600 600
         xcb_get_property_cookie_t strut_q = xcb_get_property_unchecked(globalconf.connection, false, c->window,
601
-                                                                       _NET_WM_STRUT_PARTIAL, CARDINAL, 0, 12);
601
+                                                                       _NET_WM_STRUT_PARTIAL, XCB_ATOM_CARDINAL, 0, 12);
602 602
         strut_r = mstrut_r = xcb_get_property_reply(globalconf.connection, strut_q, NULL);
603 603
     }
604 604
 
@@ -651,7 +651,7 @@ xcb_get_property_cookie_t
651 651
 ewmh_window_icon_get_unchecked(xcb_window_t w)
652 652
 {
653 653
   return xcb_get_property_unchecked(globalconf.connection, false, w,
654
-                                    _NET_WM_ICON, CARDINAL, 0, UINT32_MAX);
654
+                                    _NET_WM_ICON, XCB_ATOM_CARDINAL, 0, UINT32_MAX);
655 655
 }
656 656
 
657 657
 int
@@ -660,7 +660,7 @@ ewmh_window_icon_from_reply(xcb_get_property_reply_t *r)
660 660
     uint32_t *data;
661 661
     uint64_t len;
662 662
 
663
-    if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2)
663
+    if(!r || r->type != XCB_ATOM_CARDINAL || r->format != 32 || r->length < 2)
664 664
         return 0;
665 665
 
666 666
     data = (uint32_t *) xcb_get_property_value(r);

+ 1
- 1
objects/widget.c View File

@@ -253,7 +253,7 @@ widget_render(wibox_t *wibox)
253 253
         xcb_get_property_cookie_t prop_c;
254 254
         xcb_screen_t *s = xutil_screen_get(globalconf.connection, ctx->phys_screen);
255 255
         prop_c = xcb_get_property_unchecked(globalconf.connection, false, s->root, _XROOTPMAP_ID,
256
-                                            PIXMAP, 0, 1);
256
+                                            XCB_ATOM_PIXMAP, 0, 1);
257 257
         if((prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL)))
258 258
         {
259 259
             if(prop_r->value_len

+ 1
- 1
objects/widgets/systray.c View File

@@ -74,7 +74,7 @@ systray_draw(widget_t *widget, draw_context_t *ctx,
74 74
     /** \todo stop setting that property on each redraw */
75 75
     xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
76 76
                         globalconf.screens.tab[p->ctx.phys_screen].systray.window,
77
-                        _NET_SYSTEM_TRAY_ORIENTATION, CARDINAL, 32, 1, &orient);
77
+                        _NET_SYSTEM_TRAY_ORIENTATION, XCB_ATOM_CARDINAL, 32, 1, &orient);
78 78
 }
79 79
 
80 80
 /** Delete a systray widget.

+ 12
- 12
property.c View File

@@ -65,11 +65,11 @@
65 65
     }
66 66
 
67 67
 
68
-HANDLE_TEXT_PROPERTY(wm_name, WM_NAME, client_set_alt_name)
68
+HANDLE_TEXT_PROPERTY(wm_name, XCB_ATOM_WM_NAME, client_set_alt_name)
69 69
 HANDLE_TEXT_PROPERTY(net_wm_name, _NET_WM_NAME, client_set_name)
70
-HANDLE_TEXT_PROPERTY(wm_icon_name, WM_ICON_NAME, client_set_alt_icon_name)
70
+HANDLE_TEXT_PROPERTY(wm_icon_name, XCB_ATOM_WM_ICON_NAME, client_set_alt_icon_name)
71 71
 HANDLE_TEXT_PROPERTY(net_wm_icon_name, _NET_WM_ICON_NAME, client_set_icon_name)
72
-HANDLE_TEXT_PROPERTY(wm_client_machine, WM_CLIENT_MACHINE, client_set_machine)
72
+HANDLE_TEXT_PROPERTY(wm_client_machine, XCB_ATOM_WM_CLIENT_MACHINE, client_set_machine)
73 73
 HANDLE_TEXT_PROPERTY(wm_window_role, WM_WINDOW_ROLE, client_set_role)
74 74
 
75 75
 #undef HANDLE_TEXT_PROPERTY
@@ -138,7 +138,7 @@ property_update_wm_client_leader(client_t *c, xcb_get_property_reply_t *reply)
138 138
     if(no_reply)
139 139
     {
140 140
         client_leader_q = xcb_get_property_unchecked(globalconf.connection, false, c->window,
141
-                                                     WM_CLIENT_LEADER, WINDOW, 0, 32);
141
+                                                     WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 1, 32);
142 142
 
143 143
         reply = xcb_get_property_reply(globalconf.connection, client_leader_q, NULL);
144 144
     }
@@ -279,7 +279,7 @@ property_update_net_wm_pid(client_t *c,
279 279
     if(no_reply)
280 280
     {
281 281
         xcb_get_property_cookie_t prop_c =
282
-            xcb_get_property_unchecked(globalconf.connection, false, c->window, _NET_WM_PID, CARDINAL, 0L, 1L);
282
+            xcb_get_property_unchecked(globalconf.connection, false, c->window, _NET_WM_PID, XCB_ATOM_CARDINAL, 0L, 1L);
283 283
         reply = xcb_get_property_reply(globalconf.connection, prop_c, NULL);
284 284
     }
285 285
 
@@ -430,15 +430,15 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev)
430 430
     HANDLE_L(_XEMBED_INFO, property_handle_xembed_info)
431 431
 
432 432
     /* ICCCM stuff */
433
-    HANDLE_L(WM_TRANSIENT_FOR, property_handle_wm_transient_for)
433
+    HANDLE_L(XCB_ATOM_WM_TRANSIENT_FOR, property_handle_wm_transient_for)
434 434
     HANDLE_L(WM_CLIENT_LEADER, property_handle_wm_client_leader)
435
-    HANDLE_L(WM_NORMAL_HINTS, property_handle_wm_normal_hints)
436
-    HANDLE_L(WM_HINTS, property_handle_wm_hints)
437
-    HANDLE_L(WM_NAME, property_handle_wm_name)
438
-    HANDLE_L(WM_ICON_NAME, property_handle_wm_icon_name)
439
-    HANDLE_L(WM_CLASS, property_handle_wm_class)
435
+    HANDLE_L(XCB_ATOM_WM_NORMAL_HINTS, property_handle_wm_normal_hints)
436
+    HANDLE_L(XCB_ATOM_WM_HINTS, property_handle_wm_hints)
437
+    HANDLE_L(XCB_ATOM_WM_NAME, property_handle_wm_name)
438
+    HANDLE_L(XCB_ATOM_WM_ICON_NAME, property_handle_wm_icon_name)
439
+    HANDLE_L(XCB_ATOM_WM_CLASS, property_handle_wm_class)
440 440
     HANDLE_L(WM_PROTOCOLS, property_handle_wm_protocols)
441
-    HANDLE_L(WM_CLIENT_MACHINE, property_handle_wm_client_machine)
441
+    HANDLE_L(XCB_ATOM_WM_CLIENT_MACHINE, property_handle_wm_client_machine)
442 442
     HANDLE_L(WM_WINDOW_ROLE, property_handle_wm_window_role)
443 443
 
444 444
     /* EWMH stuff */

+ 2
- 2
selection.c View File

@@ -52,7 +52,7 @@ luaA_selection_get(lua_State *L)
52 52
     }
53 53
 
54 54
     xcb_convert_selection(globalconf.connection, selection_window,
55
-                          PRIMARY, UTF8_STRING, XSEL_DATA, XCB_CURRENT_TIME);
55
+                          XCB_ATOM_PRIMARY, UTF8_STRING, XSEL_DATA, XCB_CURRENT_TIME);
56 56
     xcb_flush(globalconf.connection);
57 57
 
58 58
     xcb_generic_event_t *event;
@@ -83,7 +83,7 @@ luaA_selection_get(lua_State *L)
83 83
         xcb_selection_notify_event_t *event_notify =
84 84
             (xcb_selection_notify_event_t *) event;
85 85
 
86
-        if(event_notify->selection == PRIMARY
86
+        if(event_notify->selection == XCB_ATOM_PRIMARY
87 87
            && event_notify->property != XCB_NONE)
88 88
         {
89 89
             xcb_get_text_property_reply_t prop;

+ 1
- 1
systray.c View File

@@ -273,7 +273,7 @@ systray_iskdedockapp(xcb_window_t w)
273 273
      * thanks KDE. */
274 274
     kde_check_q = xcb_get_property_unchecked(globalconf.connection, false, w,
275 275
                                              _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR,
276
-                                             WINDOW, 0, 1);
276
+                                             XCB_ATOM_WINDOW, 0, 1);
277 277
 
278 278
     kde_check = xcb_get_property_reply(globalconf.connection, kde_check_q, NULL);
279 279
 

+ 2
- 2
xwindow.c View File

@@ -157,7 +157,7 @@ xwindow_get_opacity(xcb_window_t win)
157 157
 
158 158
     xcb_get_property_cookie_t prop_c =
159 159
         xcb_get_property_unchecked(globalconf.connection, false, win,
160
-                                   _NET_WM_WINDOW_OPACITY, CARDINAL, 0L, 1L);
160
+                                   _NET_WM_WINDOW_OPACITY, XCB_ATOM_CARDINAL, 0L, 1L);
161 161
 
162 162
     xcb_get_property_reply_t *prop_r =
163 163
         xcb_get_property_reply(globalconf.connection, prop_c, NULL);
@@ -196,7 +196,7 @@ xwindow_set_opacity(xcb_window_t win, double opacity)
196 196
         {
197 197
             uint32_t real_opacity = opacity * 0xffffffff;
198 198
             xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win,
199
-                                _NET_WM_WINDOW_OPACITY, CARDINAL, 32, 1L, &real_opacity);
199
+                                _NET_WM_WINDOW_OPACITY, XCB_ATOM_CARDINAL, 32, 1L, &real_opacity);
200 200
         }
201 201
         else
202 202
             xcb_delete_property(globalconf.connection, win, _NET_WM_WINDOW_OPACITY);

Loading…
Cancel
Save