~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to ewmh.c

  • Committer: Olaf 'Rhialto' Seibert
  • Date: 2014-08-14 22:54:20 UTC
  • mto: This revision was merged to the branch mainline in revision 335.
  • Revision ID: rhialto@falu.nl-20140814225420-rmuenaiabesovg2y
Automated atoms!

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include <X11/Xatom.h>
57
57
 
58
58
#include "ewmh.h"
 
59
#include "ewmh_atoms.h"
59
60
#include "ctwm.h"
60
61
#include "screen.h"
61
62
#include "events.h"
68
69
 
69
70
#define DEBUG_EWMH      1
70
71
 
71
 
static Atom MANAGER;
72
 
Atom NET_CURRENT_DESKTOP;
73
 
static Atom NET_ACTIVE_WINDOW;
74
 
static Atom NET_CLIENT_LIST;
75
 
static Atom NET_CLIENT_LIST_STACKING;
76
 
static Atom NET_DESKTOP_GEOMETRY;
77
 
static Atom NET_DESKTOP_VIEWPORT;
78
 
static Atom NET_NUMBER_OF_DESKTOPS;
79
 
static Atom NET_SHOWING_DESKTOP;
80
 
static Atom NET_SUPPORTED;
81
 
static Atom NET_SUPPORTING_WM_CHECK;
82
 
static Atom NET_VIRTUAL_ROOTS;
83
 
static Atom NET_WM_DESKTOP;
84
 
static Atom NET_WM_ICON;
85
 
static Atom NET_WM_MOVERESIZE;
86
 
static Atom NET_WM_NAME;
87
 
static Atom NET_WM_STATE;
88
 
static Atom NET_WM_STATE_MAXIMIZED_VERT;
89
 
static Atom NET_WM_STATE_MAXIMIZED_HORZ;
90
 
static Atom NET_WM_STATE_FULLSCREEN;
91
 
static Atom NET_WM_STRUT;
92
 
static Atom NET_WM_STRUT_PARTIAL;
93
 
static Atom NET_WM_WINDOW_TYPE;
94
 
static Atom NET_WM_WINDOW_TYPE_DESKTOP;
95
 
static Atom NET_WM_WINDOW_TYPE_DOCK;
96
 
static Atom NET_WM_WINDOW_TYPE_NORMAL;
97
 
static Atom NET_WORKAREA;
98
 
static Atom UTF8_STRING;
 
72
Atom XEWMHAtom[NUM_EWMH_XATOMS];
99
73
 
100
74
#define NET_WM_STATE_REMOVE        0    /* remove/unset property */
101
75
#define NET_WM_STATE_ADD           1    /* add/set property */
150
124
 
151
125
static void EwmhInitAtoms(void)
152
126
{
153
 
        MANAGER             = XInternAtom(dpy, "MANAGER", False);
154
 
        NET_ACTIVE_WINDOW   = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
155
 
        NET_CLIENT_LIST     = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
156
 
        NET_CLIENT_LIST_STACKING = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False);
157
 
        NET_CURRENT_DESKTOP = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False);
158
 
        NET_DESKTOP_GEOMETRY    = XInternAtom(dpy, "_NET_DESKTOP_GEOMETRY", False);
159
 
        NET_DESKTOP_VIEWPORT    = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False);
160
 
        NET_NUMBER_OF_DESKTOPS  = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False);
161
 
        NET_SHOWING_DESKTOP     = XInternAtom(dpy, "_NET_SHOWING_DESKTOP", False);
162
 
        NET_SUPPORTED           = XInternAtom(dpy, "_NET_SUPPORTED", False);
163
 
        NET_SUPPORTING_WM_CHECK = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
164
 
        NET_VIRTUAL_ROOTS   = XInternAtom(dpy, "_NET_VIRTUAL_ROOTS", False);
165
 
        NET_WM_DESKTOP      = XInternAtom(dpy, "_NET_WM_DESKTOP", False);
166
 
        NET_WM_ICON         = XInternAtom(dpy, "_NET_WM_ICON", False);
167
 
        NET_WM_MOVERESIZE   = XInternAtom(dpy, "_NET_WM_MOVERESIZE", False);
168
 
        NET_WM_NAME         = XInternAtom(dpy, "_NET_WM_NAME", False);
169
 
        NET_WM_STATE        = XInternAtom(dpy, "_NET_WM_STATE", False);
170
 
        NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_VERT",
171
 
                                      False);
172
 
        NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_HORZ",
173
 
                                      False);
174
 
        NET_WM_STATE_FULLSCREEN     = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN",
175
 
                                      False);
176
 
        NET_WM_STRUT        = XInternAtom(dpy, "_NET_WM_STRUT", False);
177
 
        NET_WM_STRUT_PARTIAL = XInternAtom(dpy, "_NET_WM_STRUT_PARTIAL", False);
178
 
        NET_WM_WINDOW_TYPE  = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
179
 
        NET_WM_WINDOW_TYPE_DESKTOP = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP",
180
 
                                     False);
181
 
        NET_WM_WINDOW_TYPE_DOCK = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False);
182
 
        NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_NORMAL",
183
 
                                                False);
184
 
        NET_WORKAREA        = XInternAtom(dpy, "_NET_WORKAREA", False);
185
 
        UTF8_STRING         = XInternAtom(dpy, "UTF8_STRING", False);
 
127
        XInternAtoms(dpy, XEWMHAtomNames, NUM_EWMH_XATOMS, False, XEWMHAtom);
186
128
}
187
129
 
188
130
static int caughtError;
335
277
        GenerateTimestamp(scr);
336
278
 
337
279
        SendPropertyMessage(scr->XineramaRoot, scr->XineramaRoot,
338
 
                            MANAGER, lastTimestamp, wmAtom, scr->icccm_Window, 0, 0,
 
280
                            XA_MANAGER, lastTimestamp, wmAtom, scr->icccm_Window, 0, 0,
339
281
                            StructureNotifyMask);
340
282
 
341
283
        return True;
405
347
        /* Set _NET_SUPPORTING_WM_CHECK on root window */
406
348
        data[0] = scr->icccm_Window;
407
349
        XChangeProperty(dpy, scr->XineramaRoot,
408
 
                        NET_SUPPORTING_WM_CHECK, XA_WINDOW,
 
350
                        XA__NET_SUPPORTING_WM_CHECK, XA_WINDOW,
409
351
                        32, PropModeReplace,
410
352
                        (unsigned char *)data, 1);
411
353
 
414
356
         * this also belongs with _NET_SUPPORTING_WM_CHECK
415
357
         */
416
358
        XChangeProperty(dpy, scr->icccm_Window,
417
 
                        NET_WM_NAME, UTF8_STRING,
 
359
                        XA__NET_WM_NAME, XA_UTF8_STRING,
418
360
                        8, PropModeReplace,
419
361
                        (unsigned char *)"ctwm", 4);
420
362
 
421
363
        data[0] = scr->icccm_Window;
422
364
        XChangeProperty(dpy, scr->icccm_Window,
423
 
                        NET_SUPPORTING_WM_CHECK, XA_WINDOW,
 
365
                        XA__NET_SUPPORTING_WM_CHECK, XA_WINDOW,
424
366
                        32, PropModeReplace,
425
367
                        (unsigned char *)data, 1);
426
368
 
430
372
        data[0] = 0;
431
373
        data[1] = 0;
432
374
        XChangeProperty(dpy, scr->XineramaRoot,
433
 
                        NET_DESKTOP_VIEWPORT, XA_CARDINAL,
 
375
                        XA__NET_DESKTOP_VIEWPORT, XA_CARDINAL,
434
376
                        32, PropModeReplace,
435
377
                        (unsigned char *)data, 2);
436
378
 
437
379
        data[0] = scr->rootw;
438
380
        data[1] = scr->rooth;
439
381
        XChangeProperty(dpy, scr->XineramaRoot,
440
 
                        NET_DESKTOP_GEOMETRY, XA_CARDINAL,
 
382
                        XA__NET_DESKTOP_GEOMETRY, XA_CARDINAL,
441
383
                        32, PropModeReplace,
442
384
                        (unsigned char *)data, 2);
443
385
 
451
393
        }
452
394
 
453
395
        XChangeProperty(dpy, scr->XineramaRoot,
454
 
                        NET_NUMBER_OF_DESKTOPS, XA_CARDINAL,
 
396
                        XA__NET_NUMBER_OF_DESKTOPS, XA_CARDINAL,
455
397
                        32, PropModeReplace,
456
398
                        (unsigned char *)data, 1);
457
399
 
464
406
                data[0] = 0;
465
407
        }
466
408
        XChangeProperty(dpy, scr->XineramaRoot,
467
 
                        NET_CURRENT_DESKTOP, XA_CARDINAL,
 
409
                        XA__NET_CURRENT_DESKTOP, XA_CARDINAL,
468
410
                        32, PropModeReplace,
469
411
                        (unsigned char *)data, 1);
470
412
 
473
415
        long supported[30];
474
416
        int i = 0;
475
417
 
476
 
        supported[i++] = NET_SUPPORTING_WM_CHECK;
477
 
        supported[i++] = NET_DESKTOP_VIEWPORT;
478
 
        supported[i++] = NET_NUMBER_OF_DESKTOPS;
479
 
        supported[i++] = NET_CURRENT_DESKTOP;
480
 
        supported[i++] = NET_DESKTOP_GEOMETRY;
481
 
        supported[i++] = NET_WM_ICON;
482
 
        supported[i++] = NET_WM_DESKTOP;
483
 
        supported[i++] = NET_CLIENT_LIST;
484
 
        supported[i++] = NET_CLIENT_LIST_STACKING;
485
 
        supported[i++] = NET_WM_WINDOW_TYPE;
486
 
        supported[i++] = NET_WM_WINDOW_TYPE_NORMAL;
487
 
        supported[i++] = NET_WM_WINDOW_TYPE_DESKTOP;
488
 
        supported[i++] = NET_WM_WINDOW_TYPE_DOCK;
489
 
        supported[i++] = NET_WM_STRUT;
490
 
        supported[i++] = NET_WM_STRUT_PARTIAL;
491
 
        supported[i++] = NET_SHOWING_DESKTOP;
492
 
        supported[i++] = NET_WM_STATE;
493
 
        supported[i++] = NET_WM_STATE_MAXIMIZED_VERT;
494
 
        supported[i++] = NET_WM_STATE_MAXIMIZED_HORZ;
495
 
        supported[i++] = NET_WM_STATE_FULLSCREEN;
496
 
        supported[i++] = NET_ACTIVE_WINDOW;
497
 
        supported[i++] = NET_WORKAREA;
498
 
        supported[i++] = NET_WM_MOVERESIZE;
 
418
        supported[i++] = XA__NET_SUPPORTING_WM_CHECK;
 
419
        supported[i++] = XA__NET_DESKTOP_VIEWPORT;
 
420
        supported[i++] = XA__NET_NUMBER_OF_DESKTOPS;
 
421
        supported[i++] = XA__NET_CURRENT_DESKTOP;
 
422
        supported[i++] = XA__NET_DESKTOP_GEOMETRY;
 
423
        supported[i++] = XA__NET_WM_ICON;
 
424
        supported[i++] = XA__NET_WM_DESKTOP;
 
425
        supported[i++] = XA__NET_CLIENT_LIST;
 
426
        supported[i++] = XA__NET_CLIENT_LIST_STACKING;
 
427
        supported[i++] = XA__NET_WM_WINDOW_TYPE;
 
428
        supported[i++] = XA__NET_WM_WINDOW_TYPE_NORMAL;
 
429
        supported[i++] = XA__NET_WM_WINDOW_TYPE_DESKTOP;
 
430
        supported[i++] = XA__NET_WM_WINDOW_TYPE_DOCK;
 
431
        supported[i++] = XA__NET_WM_STRUT;
 
432
        supported[i++] = XA__NET_WM_STRUT_PARTIAL;
 
433
        supported[i++] = XA__NET_SHOWING_DESKTOP;
 
434
        supported[i++] = XA__NET_WM_STATE;
 
435
        supported[i++] = XA__NET_WM_STATE_MAXIMIZED_VERT;
 
436
        supported[i++] = XA__NET_WM_STATE_MAXIMIZED_HORZ;
 
437
        supported[i++] = XA__NET_WM_STATE_FULLSCREEN;
 
438
        supported[i++] = XA__NET_ACTIVE_WINDOW;
 
439
        supported[i++] = XA__NET_WORKAREA;
 
440
        supported[i++] = XA__NET_WM_MOVERESIZE;
499
441
 
500
442
        XChangeProperty(dpy, scr->XineramaRoot,
501
 
                        NET_SUPPORTED, XA_ATOM,
 
443
                        XA__NET_SUPPORTED, XA_ATOM,
502
444
                        32, PropModeReplace,
503
445
                        (unsigned char *)supported, i);
504
446
}
537
479
                }
538
480
 
539
481
                XChangeProperty(dpy, scr->XineramaRoot,
540
 
                                NET_VIRTUAL_ROOTS, XA_WINDOW,
 
482
                                XA__NET_VIRTUAL_ROOTS, XA_WINDOW,
541
483
                                32, PropModeReplace,
542
484
                                (unsigned char *)data, numVscreens);
543
485
 
545
487
 
546
488
                free(data);
547
489
 
548
 
                d0 = NET_VIRTUAL_ROOTS;
 
490
                d0 = XA__NET_VIRTUAL_ROOTS;
549
491
                XChangeProperty(dpy, scr->XineramaRoot,
550
 
                                NET_SUPPORTED, XA_ATOM,
 
492
                                XA__NET_SUPPORTED, XA_ATOM,
551
493
                                32, PropModeAppend,
552
494
                                (unsigned char *)&d0, 1);
553
495
        }
555
497
 
556
498
static void EwmhTerminateScreen(ScreenInfo *scr)
557
499
{
558
 
        XDeleteProperty(dpy, scr->XineramaRoot, NET_SUPPORTED);
 
500
        XDeleteProperty(dpy, scr->XineramaRoot, XA__NET_SUPPORTED);
559
501
 
560
502
        /*
561
503
         * Don't delete scr->icccm_Window; let it be deleted automatically
609
551
        }
610
552
 
611
553
        /* Messages regarding any window */
612
 
        if(msg->message_type == NET_WM_DESKTOP) {
 
554
        if(msg->message_type == XA__NET_WM_DESKTOP) {
613
555
                EwmhClientMessage_NET_WM_DESKTOP(msg);
614
556
                return True;
615
557
        }
616
 
        else if(msg->message_type == NET_WM_STATE) {
 
558
        else if(msg->message_type == XA__NET_WM_STATE) {
617
559
                EwmhClientMessage_NET_WM_STATE(msg);
618
560
                return 1;
619
561
        }
620
 
        else if(msg->message_type == NET_ACTIVE_WINDOW) {
 
562
        else if(msg->message_type == XA__NET_ACTIVE_WINDOW) {
621
563
                EwmhClientMessage_NET_ACTIVE_WINDOW(msg);
622
564
                return 1;
623
565
        }
624
 
        else if(msg->message_type == NET_WM_MOVERESIZE) {
 
566
        else if(msg->message_type == XA__NET_WM_MOVERESIZE) {
625
567
                EwmhClientMessage_NET_WM_MOVERESIZE(msg);
626
568
                return 1;
627
569
        }
636
578
                return False;
637
579
        }
638
580
 
639
 
        if(msg->message_type == NET_CURRENT_DESKTOP) {
 
581
        if(msg->message_type == XA__NET_CURRENT_DESKTOP) {
640
582
                GotoWorkSpaceByNumber(Scr->currentvs, msg->data.l[0]);
641
583
                return True;
642
584
        }
643
 
        else if(msg->message_type == NET_SHOWING_DESKTOP) {
 
585
        else if(msg->message_type == XA__NET_SHOWING_DESKTOP) {
644
586
                ShowBackground(Scr->currentvs, msg->data.l[0] ? 1 : 0);
645
587
        }
646
588
        else {
690
632
        int area, width, height;
691
633
 
692
634
        fetch_offset = 0;
693
 
        if(XGetWindowProperty(dpy, twm_win->w, NET_WM_ICON,
 
635
        if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_ICON,
694
636
                              fetch_offset, 8 * 1024, False, XA_CARDINAL,
695
637
                              &actual_type, &actual_format, &nitems,
696
638
                              &bytes_after, (unsigned char **)&prop) != Success || nitems == 0) {
772
714
                                /* we can fetch some more... */
773
715
                                XFree(prop);
774
716
                                fetch_offset += i + size;
775
 
                                if(XGetWindowProperty(dpy, twm_win->w, NET_WM_ICON,
 
717
                                if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_ICON,
776
718
                                                      fetch_offset, 8 * 1024, False, XA_CARDINAL,
777
719
                                                      &actual_type, &actual_format, &nitems,
778
720
                                                      &bytes_after, (unsigned char **)&prop) != Success) {
848
790
#ifdef DEBUG_EWMH
849
791
                fprintf(stderr, "refetching from %d\n", fetch_offset);
850
792
#endif /* DEBUG_EWMH */
851
 
                if(XGetWindowProperty(dpy, twm_win->w, NET_WM_ICON,
 
793
                if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_ICON,
852
794
                                      fetch_offset, 2 + area, False, XA_CARDINAL,
853
795
                                      &actual_type, &actual_format, &nitems,
854
796
                                      &bytes_after, (unsigned char **)&prop) != Success) {
1067
1009
 */
1068
1010
static int atomToFlag(Atom a)
1069
1011
{
1070
 
        if(a == NET_WM_STATE_MAXIMIZED_VERT) {
 
1012
        if(a == XA__NET_WM_STATE_MAXIMIZED_VERT) {
1071
1013
                return EWMH_STATE_MAXIMIZED_VERT;
1072
1014
        }
1073
 
        if(a == NET_WM_STATE_MAXIMIZED_HORZ) {
 
1015
        if(a == XA__NET_WM_STATE_MAXIMIZED_HORZ) {
1074
1016
                return EWMH_STATE_MAXIMIZED_HORZ;
1075
1017
        }
1076
 
        if(a == NET_WM_STATE_FULLSCREEN) {
 
1018
        if(a == XA__NET_WM_STATE_FULLSCREEN) {
1077
1019
                return EWMH_STATE_FULLSCREEN;
1078
1020
        }
1079
1021
        return 0;
1310
1252
 */
1311
1253
int EwmhHandlePropertyNotify(XPropertyEvent *event, TwmWindow *twm_win)
1312
1254
{
1313
 
        if(event->atom == NET_WM_ICON) {
 
1255
        if(event->atom == XA__NET_WM_ICON) {
1314
1256
                EwmhHandle_NET_WM_ICONNotify(event, twm_win);
1315
1257
                return 1;
1316
1258
        }
1317
 
        else if(event->atom == NET_WM_STRUT_PARTIAL ||
1318
 
                        event->atom == NET_WM_STRUT) {
 
1259
        else if(event->atom == XA__NET_WM_STRUT_PARTIAL ||
 
1260
                        event->atom == XA__NET_WM_STRUT) {
1319
1261
                EwmhHandle_NET_WM_STRUTNotify(event, twm_win);
1320
1262
                return 1;
1321
1263
        }
1392
1334
        }
1393
1335
 
1394
1336
        XChangeProperty(dpy, twm_win->w,
1395
 
                        NET_WM_DESKTOP, XA_CARDINAL,
 
1337
                        XA__NET_WM_DESKTOP, XA_CARDINAL,
1396
1338
                        32, PropModeReplace,
1397
1339
                        (unsigned char *)workspaces, n);
1398
1340
}
1431
1373
        unsigned long *prop;
1432
1374
        int occupation;
1433
1375
 
1434
 
        if(XGetWindowProperty(dpy, twm_win->w, NET_WM_DESKTOP,
 
1376
        if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_DESKTOP,
1435
1377
                              0, MAXWORKSPACE, False, XA_CARDINAL,
1436
1378
                              &actual_type, &actual_format, &nitems,
1437
1379
                              &bytes_after, (unsigned char **)&prop) != Success) {
1516
1458
 */
1517
1459
void EwmhUnmapNotify(TwmWindow *twm_win)
1518
1460
{
1519
 
        XDeleteProperty(dpy, twm_win->w, NET_WM_DESKTOP);
 
1461
        XDeleteProperty(dpy, twm_win->w, XA__NET_WM_DESKTOP);
1520
1462
}
1521
1463
 
1522
1464
/*
1548
1490
                        fprintf(stderr, "Unable to allocate memory for EWMH client list.\n");
1549
1491
                        return;
1550
1492
                }
1551
 
                XChangeProperty(dpy, Scr->Root, NET_CLIENT_LIST, XA_WINDOW, 32,
 
1493
                XChangeProperty(dpy, Scr->Root, XA__NET_CLIENT_LIST, XA_WINDOW, 32,
1552
1494
                                PropModeReplace, (unsigned char *)Scr->ewmh_CLIENT_LIST,
1553
1495
                                Scr->ewmh_CLIENT_LIST_used);
1554
1496
        }
1586
1528
        }
1587
1529
        /* If window was not found, there is no need to update the property. */
1588
1530
        if(i >= 0) {
1589
 
                XChangeProperty(dpy, Scr->Root, NET_CLIENT_LIST, XA_WINDOW, 32,
 
1531
                XChangeProperty(dpy, Scr->Root, XA__NET_CLIENT_LIST, XA_WINDOW, 32,
1590
1532
                                PropModeReplace, (unsigned char *)Scr->ewmh_CLIENT_LIST,
1591
1533
                                Scr->ewmh_CLIENT_LIST_used);
1592
1534
        }
1633
1575
                        i, Scr->ewmh_CLIENT_LIST_used);
1634
1576
        }
1635
1577
 
1636
 
        XChangeProperty(dpy, Scr->Root, NET_CLIENT_LIST_STACKING, XA_WINDOW, 32,
 
1578
        XChangeProperty(dpy, Scr->Root, XA__NET_CLIENT_LIST_STACKING, XA_WINDOW, 32,
1637
1579
                        PropModeReplace, (unsigned char *)prop, i);
1638
1580
 
1639
1581
        free(prop);
1645
1587
 
1646
1588
        prop[0] = w;
1647
1589
 
1648
 
        XChangeProperty(dpy, Scr->Root, NET_ACTIVE_WINDOW, XA_WINDOW, 32,
 
1590
        XChangeProperty(dpy, Scr->Root, XA__NET_ACTIVE_WINDOW, XA_WINDOW, 32,
1649
1591
                        PropModeReplace, (unsigned char *)prop, 1);
1650
1592
}
1651
1593
 
1661
1603
{
1662
1604
        twm_win->ewmhFlags = 0;
1663
1605
 
1664
 
        Atom type = EwmhGetWindowProperty(twm_win->w, NET_WM_WINDOW_TYPE, XA_ATOM);
 
1606
        Atom type = EwmhGetWindowProperty(twm_win->w, XA__NET_WM_WINDOW_TYPE, XA_ATOM);
1665
1607
 
1666
 
        if(type == NET_WM_WINDOW_TYPE_DESKTOP) {
 
1608
        if(type == XA__NET_WM_WINDOW_TYPE_DESKTOP) {
1667
1609
                twm_win->ewmhWindowType = wt_Desktop;
1668
1610
        }
1669
 
        else if(type == NET_WM_WINDOW_TYPE_DOCK) {
 
1611
        else if(type == XA__NET_WM_WINDOW_TYPE_DOCK) {
1670
1612
                twm_win->ewmhWindowType = wt_Dock;
1671
1613
        }
1672
1614
        else {
1774
1716
        unsigned long *prop;
1775
1717
        EwmhStrut *strut;
1776
1718
 
1777
 
        if(XGetWindowProperty(dpy, twm_win->w, NET_WM_STRUT_PARTIAL,
 
1719
        if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_STRUT_PARTIAL,
1778
1720
                              0, 4, False, XA_CARDINAL,
1779
1721
                              &actual_type, &actual_format, &nitems,
1780
1722
                              &bytes_after, (unsigned char **)&prop) != Success) {
1781
 
                if(XGetWindowProperty(dpy, twm_win->w, NET_WM_STRUT,
 
1723
                if(XGetWindowProperty(dpy, twm_win->w, XA__NET_WM_STRUT,
1782
1724
                                      0, 4, False, XA_CARDINAL,
1783
1725
                                      &actual_type, &actual_format, &nitems,
1784
1726
                                      &bytes_after, (unsigned char **)&prop) != Success) {
1908
1850
 
1909
1851
        prop[0] = state;
1910
1852
 
1911
 
        XChangeProperty(dpy, Scr->XineramaRoot, NET_SHOWING_DESKTOP, XA_CARDINAL, 32,
 
1853
        XChangeProperty(dpy, Scr->XineramaRoot, XA__NET_SHOWING_DESKTOP, XA_CARDINAL,
 
1854
                        32,
1912
1855
                        PropModeReplace, (unsigned char *)prop, 1);
1913
1856
}
1914
1857
 
1957
1900
        i = 0;
1958
1901
 
1959
1902
        if(flags & EWMH_STATE_MAXIMIZED_VERT) {
1960
 
                prop[i++] = NET_WM_STATE_MAXIMIZED_VERT;
 
1903
                prop[i++] = XA__NET_WM_STATE_MAXIMIZED_VERT;
1961
1904
        }
1962
1905
        if(flags & EWMH_STATE_MAXIMIZED_HORZ) {
1963
 
                prop[i++] = NET_WM_STATE_MAXIMIZED_HORZ;
 
1906
                prop[i++] = XA__NET_WM_STATE_MAXIMIZED_HORZ;
1964
1907
        }
1965
1908
        if(flags & EWMH_STATE_FULLSCREEN) {
1966
 
                prop[i++] = NET_WM_STATE_FULLSCREEN;
 
1909
                prop[i++] = XA__NET_WM_STATE_FULLSCREEN;
1967
1910
        }
1968
1911
 
1969
 
        XChangeProperty(dpy, Scr->XineramaRoot, NET_WM_STATE, XA_CARDINAL, 32,
 
1912
        XChangeProperty(dpy, Scr->XineramaRoot, XA__NET_WM_STATE, XA_CARDINAL, 32,
1970
1913
                        PropModeReplace, (unsigned char *)prop, i);
1971
1914
}
1972
1915
 
1982
1925
        /* w */ prop[2] = scr->rootw - scr->BorderLeft - scr->BorderRight;
1983
1926
        /* h */ prop[3] = scr->rooth - scr->BorderTop - scr->BorderBottom;
1984
1927
 
1985
 
        XChangeProperty(dpy, Scr->XineramaRoot, NET_WORKAREA, XA_CARDINAL, 32,
 
1928
        XChangeProperty(dpy, Scr->XineramaRoot, XA__NET_WORKAREA, XA_CARDINAL, 32,
1986
1929
                        PropModeReplace, (unsigned char *)prop, 4);
1987
1930
}