1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
|
From f4020d3960fa96a101bdb1c3ac1e1a452dbbf48c Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Fri, 19 Apr 2013 13:19:50 -0400
Subject: [PATCH 01/15] Disable XInput on cinnamon startup (for 3.8 compat)
This has no effect on < 1.14 clutter
---
src/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main.c b/src/main.c
index 418fb60..ac90d91 100644
--- a/src/main.c
+++ b/src/main.c
@@ -260,6 +260,7 @@
meta_plugin_type_register (gnome_cinnamon_plugin_get_type ());
/* Prevent meta_init() from causing gtk to load gail and at-bridge */
+ g_setenv ("CLUTTER_DISABLE_XINPUT", "1", TRUE);
g_setenv ("NO_GAIL", "1", TRUE);
g_setenv ("NO_AT_BRIDGE", "1", TRUE);
meta_init ();
--
1.8.1.6
From cc68659ecdd9e43128ec2b4555479f930c0d1ccd Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Fri, 19 Apr 2013 13:21:40 -0400
Subject: [PATCH 02/15] Explain change
---
src/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index ac90d91..9d37975 100644
--- a/src/main.c
+++ b/src/main.c
@@ -257,10 +257,12 @@
g_option_context_free (ctx);
+ /* Disable XInput extension - required for 3.8 compatibility */
+ g_setenv ("CLUTTER_DISABLE_XINPUT", "1", TRUE);
+
meta_plugin_type_register (gnome_cinnamon_plugin_get_type ());
/* Prevent meta_init() from causing gtk to load gail and at-bridge */
- g_setenv ("CLUTTER_DISABLE_XINPUT", "1", TRUE);
g_setenv ("NO_GAIL", "1", TRUE);
g_setenv ("NO_AT_BRIDGE", "1", TRUE);
meta_init ();
--
1.8.1.6
From f3777b3b2733b965bd348c7175ee67ee268aee06 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Tue, 16 Apr 2013 17:01:30 -0400
Subject: [PATCH 03/15] Add backgroundManager - this is needed for gnome 3.8
compatibility, as gnome-settings-daemon no longer handles the desktop
background.
---
configure.ac | 7 +-
data/org.cinnamon.gschema.xml.in | 71 +++-
.../cinnamon-settings/modules/cs_backgrounds.py | 31 +-
js/ui/main.js | 3 +-
src/Makefile.am | 2 +
src/cinnamon-background-manager.c | 411 +++++++++++++++++++++
src/cinnamon-background-manager.h | 57 +++
7 files changed, 562 insertions(+), 20 deletions(-)
create mode 100644 src/cinnamon-background-manager.c
create mode 100644 src/cinnamon-background-manager.h
diff --git a/configure.ac b/configure.ac
index 0aa47c5..a2a9479 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,7 @@ GTK_MIN_VERSION=3.0.0
GIO_MIN_VERSION=2.29.10
POLKIT_MIN_VERSION=0.100
STARTUP_NOTIFICATION_MIN_VERSION=0.11
+GNOME_DESKTOP_MIN_VERSION=3.0.0
# Collect more than 20 libraries for a prize!
PKG_CHECK_MODULES(CINNAMON, gio-2.0 >= $GIO_MIN_VERSION
@@ -82,7 +83,8 @@ PKG_CHECK_MODULES(CINNAMON, gio-2.0 >= $GIO_MIN_VERSION
gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_MIN_VERSION
libcanberra
polkit-agent-1 >= $POLKIT_MIN_VERSION xfixes
- libnm-glib libnm-util gnome-keyring-1)
+ libnm-glib libnm-util gnome-keyring-1
+ gnome-desktop-3.0 >= GNOME_DESKTOP_MIN_VERSION)
PKG_CHECK_MODULES(CINNAMON_PERF_HELPER, gtk+-3.0 gio-2.0)
@@ -106,7 +108,8 @@ AC_CHECK_FUNCS(JS_NewGlobalObject XFixesCreatePointerBarrier)
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
-PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2 gnome-desktop-3.0 >= 2.90.0 x11)
+PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2
+ gnome-desktop-3.0 >= GNOME_DESKTOP_MIN_VERSION x11)
PKG_CHECK_MODULES(GDMUSER, dbus-glib-1 gtk+-3.0)
PKG_CHECK_MODULES(TRAY, gtk+-3.0)
PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0)
diff --git a/data/org.cinnamon.gschema.xml.in b/data/org.cinnamon.gschema.xml.in
index ffbad92..6f55477 100644
--- a/data/org.cinnamon.gschema.xml.in
+++ b/data/org.cinnamon.gschema.xml.in
@@ -720,6 +720,23 @@
</key>
</schema>
+
+ <enum id="bg_style">
+ <value nick="none" value="0"/>
+ <value nick="wallpaper" value="1"/>
+ <value nick="centered" value="2"/>
+ <value nick="scaled" value="3"/>
+ <value nick="stretched" value="4"/>
+ <value nick="zoom" value="5"/>
+ <value nick="spanned" value="6"/>
+ </enum>
+
+ <enum id="bg_shading">
+ <value nick="solid" value="0"/>
+ <value nick="vertical" value="1"/>
+ <value nick="horizontal" value="2"/>
+ </enum>
+
<schema id="org.cinnamon.background" path="/org/cinnamon/background/">
<key name="mode" type="s">
<default>"wallpaper"</default>
@@ -750,8 +767,60 @@
This key defines the delay for the slideshow.
</description>
</key>
+ <key name="draw-background" type="b">
+ <default>true</default>
+ <_summary>Draw Desktop Background</_summary>
+ <_description>Have GNOME draw the desktop background.</_description>
+ </key>
+ <key name="picture-options" enum="bg_style">
+ <default>'zoom'</default>
+ <_summary>Picture Options</_summary>
+ <_description>
+ Determines how the image set by wallpaper_filename is rendered.
+ Possible values are "none", "wallpaper", "centered", "scaled",
+ "stretched", "zoom", "spanned".
+ </_description>
+ </key>
+ <key name="picture-uri" type="s">
+ <default>'file://@datadir@/themes/Adwaita/backgrounds/adwaita-timed.xml'</default>
+ <_summary>Picture URI</_summary>
+ <_description>
+ URI to use for the background image. Not that the backend only supports
+ local (file://) URIs.
+ </_description>
+ </key>
+ <key name="picture-opacity" type="i">
+ <range min="0" max="100"/>
+ <default>100</default>
+ <_summary>Picture Opacity</_summary>
+ <_description>
+ Opacity with which to draw the background picture.
+ </_description>
+ </key>
+ <key name="primary-color" type="s">
+ <default>'#023c88'</default>
+ <_summary>Primary Color</_summary>
+ <_description>
+ Left or Top color when drawing gradients, or the solid color.
+ </_description>
+ </key>
+ <key name="secondary-color" type="s">
+ <default>'#5789ca'</default>
+ <_summary>Secondary Color</_summary>
+ <_description>
+ Right or Bottom color when drawing gradients, not used for solid color.
+ </_description>
+ </key>
+ <key name="color-shading-type" enum="bg_shading">
+ <default>'solid'</default>
+ <_summary>Color Shading Type</_summary>
+ <_description>
+ How to shade the background color. Possible values are "horizontal",
+ "vertical", and "solid".
+ </_description>
+ </key>
</schema>
-
+
<schema id="org.cinnamon.screensaver" path="/org/cinnamon/screensaver/">
<key name="default-message" type="s">
<default>""</default>
diff --git a/files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py b/files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py
index f964aed..4a38c84 100644
--- a/files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py
+++ b/files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py
@@ -232,11 +232,11 @@ def getFirstFileFromBackgroundXml(self, filename):
class BackgroundWallpaperPane (Gtk.VBox):
- def __init__(self, sidepage, gnome_background_schema):
+ def __init__(self, sidepage, cinnamon_background_schema):
Gtk.VBox.__init__(self)
self.set_spacing(5)
- self._gnome_background_schema = gnome_background_schema
+ self._cinnamon_background_schema = cinnamon_background_schema
self._sidepage = sidepage
scw = Gtk.ScrolledWindow()
@@ -263,15 +263,15 @@ def _on_selection_changed(self, iconview):
if wallpaper:
for key in wallpaper:
if key == "filename":
- self._gnome_background_schema.set_string("picture-uri", "file://" + wallpaper[key])
+ self._cinnamon_background_schema.set_string("picture-uri", "file://" + wallpaper[key])
elif key == "pcolor":
- self._gnome_background_schema.set_string("primary-color", wallpaper[key])
+ self._cinnamon_background_schema.set_string("primary-color", wallpaper[key])
elif key == "scolor":
- self._gnome_background_schema.set_string("secondary-color", wallpaper[key])
+ self._cinnamon_background_schema.set_string("secondary-color", wallpaper[key])
elif key == "shade_type":
- self._gnome_background_schema.set_string("color-shading-type", wallpaper[key])
+ self._cinnamon_background_schema.set_string("color-shading-type", wallpaper[key])
elif key == "options":
- self._gnome_background_schema.set_string("picture-options", wallpaper[key])
+ self._cinnamon_background_schema.set_string("picture-options", wallpaper[key])
if (not "metadataFile" in wallpaper) or (wallpaper["metadataFile"] == ""):
self._sidepage.remove_wallpaper_button.set_sensitive(True)
@@ -364,7 +364,7 @@ def run(self):
return res
class BackgroundSlideshowPane(Gtk.Table):
- def __init__(self, sidepage, gnome_background_schema, cinnamon_background_schema):
+ def __init__(self, sidepage, cinnamon_background_schema):
Gtk.Table.__init__(self)
self.set_col_spacings(5)
self.set_row_spacings(5)
@@ -445,12 +445,11 @@ def _do_update_list(self, folder, recursive, delay, transition_duration = 0):
f = open(filename, "w")
f.write(xml_data)
f.close()
- Gio.Settings("org.gnome.desktop.background").set_string("picture-uri", "file://" + filename)
+ Gio.Settings("org.cinnamon.background").set_string("picture-uri", "file://" + filename)
class BackgroundSidePage (SidePage):
def __init__(self, name, icon, keywords, advanced, content_box):
SidePage.__init__(self, name, icon, keywords, advanced, content_box)
- self._gnome_background_schema = Gio.Settings("org.gnome.desktop.background")
self._cinnamon_background_schema = Gio.Settings("org.cinnamon.background")
self._add_wallpapers_dialog = AddWallpapersDialog()
@@ -515,8 +514,8 @@ def build(self, advanced):
self.mainbox.set_visible_window(False)
self.content_box.pack_start(self.mainbox, True, True, 3)
- self.wallpaper_pane = BackgroundWallpaperPane(self, self._gnome_background_schema)
- self.slideshow_pane = BackgroundSlideshowPane(self, self._gnome_background_schema, self._cinnamon_background_schema)
+ self.wallpaper_pane = BackgroundWallpaperPane(self, self._cinnamon_background_schema)
+ self.slideshow_pane = BackgroundSlideshowPane(self, self._cinnamon_background_schema)
if self._cinnamon_background_schema["mode"] == "slideshow":
self.mainbox.add(self.slideshow_pane)
else:
@@ -536,21 +535,21 @@ def build(self, advanced):
l = Gtk.Label(_("Picture aspect"))
l.set_alignment(0, 0.5)
advanced_options_box.pack_start(l, False, False, 0)
- self.picture_options = GSettingsComboBox("", "org.gnome.desktop.background", "picture-options", None, BACKGROUND_PICTURE_OPTIONS)
+ self.picture_options = GSettingsComboBox("", "org.cinnamon.background", "picture-options", None, BACKGROUND_PICTURE_OPTIONS)
advanced_options_box.pack_start(self.picture_options, False, False, 0)
l = Gtk.Label(_("Gradient"))
l.set_alignment(0, 0.5)
advanced_options_box.pack_start(l, False, False, 0)
- self.color_shading_type = GSettingsComboBox("", "org.gnome.desktop.background", "color-shading-type", None, BACKGROUND_COLOR_SHADING_TYPES)
+ self.color_shading_type = GSettingsComboBox("", "org.cinnamon.background", "color-shading-type", None, BACKGROUND_COLOR_SHADING_TYPES)
advanced_options_box.pack_start(self.color_shading_type, False, False, 0)
hbox = Gtk.HBox()
l = Gtk.Label(_("Colors"))
hbox.pack_start(l, False, False, 2)
- self.primary_color = GSettingsColorChooser("org.gnome.desktop.background", "primary-color", None)
+ self.primary_color = GSettingsColorChooser("org.cinnamon.background", "primary-color", None)
hbox.pack_start(self.primary_color, False, False, 2)
- self.secondary_color = GSettingsColorChooser("org.gnome.desktop.background", "secondary-color", None)
+ self.secondary_color = GSettingsColorChooser("org.cinnamon.background", "secondary-color", None)
hbox.pack_start(self.secondary_color, False, False, 2)
advanced_options_box.pack_start(hbox, False, False, 0)
self.content_box.show_all()
diff --git a/js/ui/main.js b/js/ui/main.js
index 11920a4..5cae372 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -86,6 +86,7 @@ let _cssStylesheet = null;
let dynamicWorkspaces = null;
let nWorks = null;
let tracker = null;
+let backgroundManager = null;
let desktopShown;
let workspace_names = [];
@@ -214,7 +215,7 @@ function start() {
// be predictable anyways.
tracker = Cinnamon.WindowTracker.get_default();
Cinnamon.AppUsage.get_default();
-
+ backgroundManager = Cinnamon.BackgroundManager.get_default();
// The stage is always covered so Clutter doesn't need to clear it; however
// the color is used as the default contents for the Muffin root background
// actor so set it anyways.
diff --git a/src/Makefile.am b/src/Makefile.am
index 51413aa..6efce18 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -105,6 +105,7 @@ cinnamon_public_headers_h = \
cinnamon-app-system.h \
cinnamon-app-usage.h \
cinnamon-arrow.h \
+ cinnamon-background-manager.h \
cinnamon-doc-system.h \
cinnamon-embedded-window.h \
cinnamon-generic-container.h \
@@ -142,6 +143,7 @@ libcinnamon_la_SOURCES = \
cinnamon-app-system.c \
cinnamon-app-usage.c \
cinnamon-arrow.c \
+ cinnamon-background-manager.c \
cinnamon-doc-system.c \
cinnamon-embedded-window.c \
cinnamon-generic-container.c \
diff --git a/src/cinnamon-background-manager.c b/src/cinnamon-background-manager.c
new file mode 100644
index 0000000..9d95250
--- /dev/null
+++ b/src/cinnamon-background-manager.c
@@ -0,0 +1,411 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright © 2001 Ximian, Inc.
+ * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
+ * Copyright 2007 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include <locale.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-bg.h>
+#include <X11/Xatom.h>
+
+#include "cinnamon-background-manager.h"
+
+#define CINNAMON_BACKGROUND_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CINNAMON_TYPE_BACKGROUND_MANAGER, CinnamonBackgroundManagerPrivate))
+
+struct CinnamonBackgroundManagerPrivate
+{
+ GSettings *settings;
+ GnomeBG *bg;
+
+ GnomeBGCrossfade *fade;
+
+ GDBusProxy *proxy;
+ guint proxy_signal_id;
+};
+
+static void cinnamon_background_manager_class_init (CinnamonBackgroundManagerClass *klass);
+static void cinnamon_background_manager_init (CinnamonBackgroundManager *background_manager);
+static void cinnamon_background_manager_finalize (GObject *object);
+
+static void setup_bg (CinnamonBackgroundManager *manager);
+static void connect_screen_signals (CinnamonBackgroundManager *manager);
+
+G_DEFINE_TYPE (CinnamonBackgroundManager, cinnamon_background_manager, G_TYPE_OBJECT)
+
+static gpointer manager_object = NULL;
+
+static gboolean
+dont_draw_background (CinnamonBackgroundManager *manager)
+{
+ return !g_settings_get_boolean (manager->priv->settings,
+ "draw-background");
+}
+
+static void
+on_crossfade_finished (CinnamonBackgroundManager *manager)
+{
+ g_object_unref (manager->priv->fade);
+ manager->priv->fade = NULL;
+}
+
+static void
+draw_background (CinnamonBackgroundManager *manager,
+ gboolean use_crossfade)
+{
+ GdkDisplay *display;
+ int n_screens;
+ int i;
+
+ display = gdk_display_get_default ();
+ n_screens = gdk_display_get_n_screens (display);
+
+ for (i = 0; i < n_screens; ++i) {
+ GdkScreen *screen;
+ GdkWindow *root_window;
+ cairo_surface_t *surface;
+
+ screen = gdk_display_get_screen (display, i);
+
+ root_window = gdk_screen_get_root_window (screen);
+
+ surface = gnome_bg_create_surface (manager->priv->bg,
+ root_window,
+ gdk_screen_get_width (screen),
+ gdk_screen_get_height (screen),
+ TRUE);
+
+ if (use_crossfade) {
+
+ if (manager->priv->fade != NULL) {
+ g_object_unref (manager->priv->fade);
+ }
+
+ manager->priv->fade = gnome_bg_set_surface_as_root_with_crossfade (screen, surface);
+ g_signal_connect_swapped (manager->priv->fade, "finished",
+ G_CALLBACK (on_crossfade_finished),
+ manager);
+ } else {
+ gnome_bg_set_surface_as_root (screen, surface);
+ }
+
+ cairo_surface_destroy (surface);
+ }
+}
+
+static void
+on_bg_transitioned (GnomeBG *bg,
+ CinnamonBackgroundManager *manager)
+{
+ draw_background (manager, FALSE);
+}
+
+static gboolean
+settings_change_event_cb (GSettings *settings,
+ gpointer keys,
+ gint n_keys,
+ CinnamonBackgroundManager *manager)
+{
+ gnome_bg_load_from_preferences (manager->priv->bg,
+ manager->priv->settings);
+ return FALSE;
+}
+
+static void
+on_screen_size_changed (GdkScreen *screen,
+ CinnamonBackgroundManager *manager)
+{
+ draw_background (manager, FALSE);
+}
+
+static void
+watch_bg_preferences (CinnamonBackgroundManager *manager)
+{
+ g_signal_connect (manager->priv->settings,
+ "change-event",
+ G_CALLBACK (settings_change_event_cb),
+ manager);
+}
+
+static void
+on_bg_changed (GnomeBG *bg,
+ CinnamonBackgroundManager *manager)
+{
+ draw_background (manager, TRUE);
+}
+
+static void
+setup_bg (CinnamonBackgroundManager *manager)
+{
+ g_return_if_fail (manager->priv->bg == NULL);
+
+ manager->priv->bg = gnome_bg_new ();
+
+ g_signal_connect (manager->priv->bg,
+ "changed",
+ G_CALLBACK (on_bg_changed),
+ manager);
+
+ g_signal_connect (manager->priv->bg,
+ "transitioned",
+ G_CALLBACK (on_bg_transitioned),
+ manager);
+
+ connect_screen_signals (manager);
+ watch_bg_preferences (manager);
+ gnome_bg_load_from_preferences (manager->priv->bg,
+ manager->priv->settings);
+}
+
+static void
+setup_bg_and_draw_background (CinnamonBackgroundManager *manager)
+{
+ setup_bg (manager);
+ draw_background (manager, FALSE);
+}
+
+static void
+disconnect_session_manager_listener (CinnamonBackgroundManager *manager)
+{
+ if (manager->priv->proxy && manager->priv->proxy_signal_id) {
+ g_signal_handler_disconnect (manager->priv->proxy,
+ manager->priv->proxy_signal_id);
+ manager->priv->proxy_signal_id = 0;
+ }
+}
+
+static void
+on_session_manager_signal (GDBusProxy *proxy,
+ const gchar *sender_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ CinnamonBackgroundManager *manager = CINNAMON_BACKGROUND_MANAGER (user_data);
+
+ if (g_strcmp0 (signal_name, "SessionRunning") == 0) {
+ setup_bg_and_draw_background (manager);
+ disconnect_session_manager_listener (manager);
+ }
+}
+
+static void
+draw_background_after_session_loads (CinnamonBackgroundManager *manager)
+{
+ GError *error = NULL;
+ GDBusProxyFlags flags;
+
+ flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
+ manager->priv->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ flags,
+ NULL, /* GDBusInterfaceInfo */
+ "org.gnome.SessionManager",
+ "/org/gnome/SessionManager",
+ "org.gnome.SessionManager",
+ NULL, /* GCancellable */
+ &error);
+ if (manager->priv->proxy == NULL) {
+ g_warning ("Could not listen to session manager: %s",
+ error->message);
+ g_error_free (error);
+ return;
+ }
+
+ manager->priv->proxy_signal_id = g_signal_connect (manager->priv->proxy,
+ "g-signal",
+ G_CALLBACK (on_session_manager_signal),
+ manager);
+}
+
+
+static void
+disconnect_screen_signals (CinnamonBackgroundManager *manager)
+{
+ GdkDisplay *display;
+ int i;
+ int n_screens;
+
+ display = gdk_display_get_default ();
+ n_screens = gdk_display_get_n_screens (display);
+
+ for (i = 0; i < n_screens; ++i) {
+ GdkScreen *screen;
+ screen = gdk_display_get_screen (display, i);
+ g_signal_handlers_disconnect_by_func (screen,
+ G_CALLBACK (on_screen_size_changed),
+ manager);
+ }
+}
+
+static void
+connect_screen_signals (CinnamonBackgroundManager *manager)
+{
+ GdkDisplay *display;
+ int i;
+ int n_screens;
+
+ display = gdk_display_get_default ();
+ n_screens = gdk_display_get_n_screens (display);
+
+ for (i = 0; i < n_screens; ++i) {
+ GdkScreen *screen;
+ screen = gdk_display_get_screen (display, i);
+ g_signal_connect (screen,
+ "monitors-changed",
+ G_CALLBACK (on_screen_size_changed),
+ manager);
+ g_signal_connect (screen,
+ "size-changed",
+ G_CALLBACK (on_screen_size_changed),
+ manager);
+ }
+}
+
+static void
+draw_background_changed (GSettings *settings,
+ const char *key,
+ CinnamonBackgroundManager *manager)
+{
+ if (dont_draw_background (manager) == FALSE)
+ setup_bg_and_draw_background (manager);
+}
+
+gboolean
+cinnamon_background_manager_start (CinnamonBackgroundManager *manager)
+{
+ manager->priv->settings = g_settings_new ("org.cinnamon.background");
+ g_signal_connect (manager->priv->settings, "changed::draw-background",
+ G_CALLBACK (draw_background_changed), manager);
+
+ setup_bg_and_draw_background (manager);
+ //draw_background_after_session_loads (manager);
+
+
+ return TRUE;
+}
+
+void
+cinnamon_background_manager_stop (CinnamonBackgroundManager *manager)
+{
+ CinnamonBackgroundManagerPrivate *p = manager->priv;
+
+ g_debug ("Stopping background manager");
+
+ disconnect_screen_signals (manager);
+
+ if (manager->priv->proxy) {
+ disconnect_session_manager_listener (manager);
+ g_object_unref (manager->priv->proxy);
+ }
+
+ g_signal_handlers_disconnect_by_func (manager->priv->settings,
+ settings_change_event_cb,
+ manager);
+
+ if (p->settings != NULL) {
+ g_object_unref (p->settings);
+ p->settings = NULL;
+ }
+
+ if (p->bg != NULL) {
+ g_object_unref (p->bg);
+ p->bg = NULL;
+ }
+}
+
+/**
+ * cinnamon_background_manager_get_default:
+ *
+ * Return Value: (transfer none): The global #CinnamonBackgroundManager singleton
+ */
+CinnamonBackgroundManager *
+cinnamon_background_manager_get_default ()
+{
+ static CinnamonBackgroundManager *instance = NULL;
+
+ if (instance == NULL)
+ instance = g_object_new (CINNAMON_TYPE_BACKGROUND_MANAGER, NULL);
+
+ return instance;
+}
+
+static GObject *
+cinnamon_background_manager_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ CinnamonBackgroundManager *background_manager;
+
+ background_manager = CINNAMON_BACKGROUND_MANAGER (G_OBJECT_CLASS (cinnamon_background_manager_parent_class)->constructor (type,
+ n_construct_properties,
+ construct_properties));
+
+ return G_OBJECT (background_manager);
+}
+
+static void
+cinnamon_background_manager_class_init (CinnamonBackgroundManagerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->constructor = cinnamon_background_manager_constructor;
+ object_class->finalize = cinnamon_background_manager_finalize;
+
+ g_type_class_add_private (klass, sizeof (CinnamonBackgroundManagerPrivate));
+}
+
+static void
+cinnamon_background_manager_init (CinnamonBackgroundManager *manager)
+{
+ manager->priv = CINNAMON_BACKGROUND_MANAGER_GET_PRIVATE (manager);
+ cinnamon_background_manager_start (manager);
+}
+
+static void
+cinnamon_background_manager_finalize (GObject *object)
+{
+ CinnamonBackgroundManager *background_manager;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (CINNAMON_IS_BACKGROUND_MANAGER (object));
+
+ background_manager = CINNAMON_BACKGROUND_MANAGER (object);
+
+ g_return_if_fail (background_manager->priv != NULL);
+
+ G_OBJECT_CLASS (cinnamon_background_manager_parent_class)->finalize (object);
+}
diff --git a/src/cinnamon-background-manager.h b/src/cinnamon-background-manager.h
new file mode 100644
index 0000000..9a56e32
--- /dev/null
+++ b/src/cinnamon-background-manager.h
@@ -0,0 +1,57 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __CINNAMON_BACKGROUND_MANAGER_H
+#define __CINNAMON_BACKGROUND_MANAGER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define CINNAMON_TYPE_BACKGROUND_MANAGER (cinnamon_background_manager_get_type ())
+#define CINNAMON_BACKGROUND_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CINNAMON_TYPE_BACKGROUND_MANAGER, CinnamonBackgroundManager))
+#define CINNAMON_BACKGROUND_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CINNAMON_TYPE_BACKGROUND_MANAGER, CinnamonBackgroundManagerClass))
+#define CINNAMON_IS_BACKGROUND_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CINNAMON_TYPE_BACKGROUND_MANAGER))
+#define CINNAMON_IS_BACKGROUND_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CINNAMON_TYPE_BACKGROUND_MANAGER))
+#define CINNAMON_BACKGROUND_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CINNAMON_TYPE_BACKGROUND_MANAGER, CinnamonBackgroundManagerClass))
+
+typedef struct CinnamonBackgroundManagerPrivate CinnamonBackgroundManagerPrivate;
+
+typedef struct
+{
+ GObject parent;
+ CinnamonBackgroundManagerPrivate *priv;
+} CinnamonBackgroundManager;
+
+typedef struct
+{
+ GObjectClass parent_class;
+} CinnamonBackgroundManagerClass;
+
+GType cinnamon_background_manager_get_type (void);
+
+CinnamonBackgroundManager *cinnamon_background_manager_get_default (void);
+
+gboolean cinnamon_background_manager_start (CinnamonBackgroundManager *manager);
+void cinnamon_background_manager_stop (CinnamonBackgroundManager *manager);
+
+G_END_DECLS
+
+#endif /* __CINNAMON_BACKGROUND_MANAGER_H */
--
1.8.1.6
From 590a48961f2c7a1b18fb914a1d7212ffcdf03017 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Tue, 16 Apr 2013 18:28:16 -0400
Subject: [PATCH 04/15] Change default background
---
data/org.cinnamon.gschema.xml.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/org.cinnamon.gschema.xml.in b/data/org.cinnamon.gschema.xml.in
index 6f55477..35b0972 100644
--- a/data/org.cinnamon.gschema.xml.in
+++ b/data/org.cinnamon.gschema.xml.in
@@ -782,7 +782,7 @@
</_description>
</key>
<key name="picture-uri" type="s">
- <default>'file://@datadir@/themes/Adwaita/backgrounds/adwaita-timed.xml'</default>
+ <default>'file:///usr/share/backgrounds/linuxmint/default_background.jpg'</default>
<_summary>Picture URI</_summary>
<_description>
URI to use for the background image. Not that the backend only supports
--
1.8.1.6
From ac8b0954c7506ae88059e488539f88d55329f070 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Tue, 16 Apr 2013 18:41:16 -0400
Subject: [PATCH 05/15] Use distro-agnostic background..
---
data/org.cinnamon.gschema.xml.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/org.cinnamon.gschema.xml.in b/data/org.cinnamon.gschema.xml.in
index 35b0972..0d01089 100644
--- a/data/org.cinnamon.gschema.xml.in
+++ b/data/org.cinnamon.gschema.xml.in
@@ -782,7 +782,7 @@
</_description>
</key>
<key name="picture-uri" type="s">
- <default>'file:///usr/share/backgrounds/linuxmint/default_background.jpg'</default>
+ <default>'file:///usr/share/themes/Adwaita/backgrounds/adwaita-timed.xml'</default>
<_summary>Picture URI</_summary>
<_description>
URI to use for the background image. Not that the backend only supports
--
1.8.1.6
From 81dbccb60231744999463a5b84c7c36358570929 Mon Sep 17 00:00:00 2001
From: dalcde <dalcde@yahoo.com.hk>
Date: Mon, 15 Apr 2013 18:34:48 +0800
Subject: [PATCH 06/15] [GDbus] Port DBus to GDBus (AltLinux patch)
---
.../applets/brightness@cinnamon.org/applet.js | 39 ++--
.../cinnamon/applets/power@cinnamon.org/applet.js | 102 +++++----
.../cinnamon/applets/sound@cinnamon.org/applet.js | 244 +++++----------------
.../cinnamon/applets/xrandr@cinnamon.org/applet.js | 19 +-
js/misc/gnomeSession.js | 147 ++++---------
js/misc/modemManager.js | 79 ++++---
js/misc/screenSaver.js | 89 ++++----
js/ui/appletManager.js | 1 -
js/ui/automountManager.js | 106 +++++----
js/ui/autorunManager.js | 27 +--
js/ui/calendar.js | 71 +++---
js/ui/cinnamonDBus.js | 96 ++++----
js/ui/endSessionDialog.js | 79 ++++---
js/ui/keyboard.js | 48 ++--
js/ui/layout.js | 14 +-
js/ui/magnifierDBus.js | 134 +++++++----
js/ui/main.js | 6 -
js/ui/messageTray.js | 13 +-
js/ui/notificationDaemon.js | 193 ++++++++--------
js/ui/scripting.js | 34 ++-
20 files changed, 688 insertions(+), 853 deletions(-)
diff --git a/files/usr/share/cinnamon/applets/brightness@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/brightness@cinnamon.org/applet.js
index 9cbda80..9087b25 100644
--- a/files/usr/share/cinnamon/applets/brightness@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/brightness@cinnamon.org/applet.js
@@ -5,7 +5,6 @@ const St = imports.gi.St;
const PopupMenu = imports.ui.popupMenu;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
-const DBus = imports.dbus;
/* constants */
const DimSettingsSchema = "org.gnome.settings-daemon.plugins.power";
@@ -14,24 +13,25 @@ const DimSettingsBattery = "idle-dim-battery";
const PowerBusName = 'org.gnome.SettingsDaemon';
const PowerObjectPath = '/org/gnome/SettingsDaemon/Power';
-/* DBus interface */
-const PowerManagerInterface = {
- name: 'org.gnome.SettingsDaemon.Power.Screen',
- methods:
- [
- { name: 'GetPercentage', inSignature: '', outSignature: 'u' },
- { name: 'SetPercentage', inSignature: 'u', outSignature: 'u' },
- { name: 'StepUp', inSignature: '', outSignature: 'u' },
- { name: 'StepDown', inSignature: '', outSignature: 'u' },
- ],
- signals:
- [
- { name: 'Changed', inSignature: '', outSignature: '' },
- ]
-};
+const PowerManagerInterface = <interface name="org.gnome.SettingsDaemon.Power.Screen">
+<method name="GetPercentage">
+ <arg type="u" direction="out"/>
+</method>
+<method name="SetPercentage">
+ <arg type="u" direction="in"/>
+ <arg type="u" direction="out"/>
+</method>
+<method name="StepUp">
+ <arg type="u" direction="out"/>
+</method>
+<method name="StepDown">
+ <arg type="u" direction="out"/>
+</method>
+<signal name="Changed" />
+</interface>;
/* DBus magic */
-let PowerManagerProxy = DBus.makeProxyClass(PowerManagerInterface);
+const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface);
/* TextImageMenuItem taken from sound@cinnamon.org applet */
let icon_path = "/usr/share/cinnamon/theme/";
@@ -100,7 +100,7 @@ MyApplet.prototype = {
Applet.IconApplet.prototype._init.call(this, orientation, panel_height);
try {
- this._proxy = new PowerManagerProxy(DBus.session, PowerBusName, PowerObjectPath);
+ this._proxy = new PowerManagerProxy(Gio.DBus.session, PowerBusName, PowerObjectPath);
this.menuManager = new PopupMenu.PopupMenuManager(this);
this.menu = new Applet.AppletPopupMenu(this, orientation);
@@ -137,7 +137,8 @@ MyApplet.prototype = {
this.menu.addMenuItem(this._settingsMenu);
//get notified
- this._proxy.connect('Changed', Lang.bind(this, this._getBrightness));
+ this._proxy.connectSignal('Changed', Lang.bind(this, this._getBrightness));
+
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
} else {
this.set_applet_tooltip(_("Brightness"));
diff --git a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
index c342fe7..b6b2bcd 100644
--- a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
@@ -1,6 +1,5 @@
const Applet = imports.ui.applet;
const Gio = imports.gi.Gio;
-const DBus = imports.dbus;
const Lang = imports.lang;
const St = imports.gi.St;
const PopupMenu = imports.ui.popupMenu;
@@ -42,34 +41,46 @@ const LabelDisplay = {
TIME: 'time'
};
-const PowerManagerInterface = {
- name: 'org.gnome.SettingsDaemon.Power',
- methods: [
- { name: 'GetDevices', inSignature: '', outSignature: 'a(susdut)' },
- { name: 'GetPrimaryDevice', inSignature: '', outSignature: '(susdut)' },
- ],
- signals: [
- { name: 'PropertiesChanged', inSignature: 's,a{sv},a[s]' },
- ],
- properties: [
- { name: 'Icon', signature: 's', access: 'read' },
- ]
-};
-let PowerManagerProxy = DBus.makeProxyClass(PowerManagerInterface);
-
-const SettingsManagerInterface = {
- name: 'org.freedesktop.DBus.Properties',
- methods: [
- { name: 'Get', inSignature: 's,s', outSignature: 'v' },
- { name: 'GetAll', inSignature: 's', outSignature: 'a{sv}' },
- { name: 'Set', inSignature: 's,s,v', outSignature: '' }
- ],
- signals: [
- {name: 'PropertiesChanged', inSignature:'s,a{sv},a[s]', outSignature:''}
- ]
-};
-
-let SettingsManagerProxy = DBus.makeProxyClass(SettingsManagerInterface);
+const PowerManagerInterface = <interface name="org.gnome.SettingsDaemon.Power">
+<method name="GetDevices">
+ <arg type="a(susdut)" direction="out"/>
+</method>
+<method name="GetPrimaryDevice">
+ <arg type="(susdut)" direction="out"/>
+</method>
+<signal name="PropertiesChanged">
+ <arg type="s"/>
+ <arg type="a{sv}"/>
+ <arg type="a[s]"/>
+</signal>
+<property name="Icon" type="s" access="read" />
+</interface>;
+
+const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface);
+
+const SettingsManagerInterface = <interface name="org.freedesktop.DBus.Properties">
+<method name="Get">
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="v" direction="out"/>
+</method>
+<method name="GetAll">
+ <arg type="s" direction="in"/>
+ <arg type="a{sv}" direction="out"/>
+</method>
+<method name="Set">
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="v" direction="in"/>
+</method>
+<signal name="PropertiesChanged">
+ <arg type="s"/>
+ <arg type="a{sv}"/>
+ <arg type="a[s]"/>
+</signal>
+</interface>;
+
+const SettingsManagerProxy = Gio.DBusProxy.makeProxyWrapper(SettingsManagerInterface);
function DeviceItem() {
this._init.apply(this, arguments);
@@ -143,11 +154,11 @@ MyApplet.prototype = {
this.menuManager = new PopupMenu.PopupMenuManager(this);
this.menu = new Applet.AppletPopupMenu(this, orientation);
this.menuManager.addMenu(this.menu);
-
- this.set_applet_icon_symbolic_name('battery-missing');
- this._proxy = new PowerManagerProxy(DBus.session, BUS_NAME, OBJECT_PATH);
- this._smProxy = new SettingsManagerProxy(DBus.session, BUS_NAME, OBJECT_PATH);
-
+
+ //this.set_applet_icon_symbolic_name('battery-missing');
+ this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
+ this._smProxy = new SettingsManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
+
let icon = this.actor.get_children()[0];
this.actor.remove_actor(icon);
let box = new St.BoxLayout({ name: 'batteryBox' });
@@ -306,18 +317,19 @@ MyApplet.prototype = {
this._devicesChanged();
},
- _devicesChanged: function() {
- this.set_applet_icon_symbolic_name('battery-missing');
- this._proxy.GetRemote('Icon', Lang.bind(this, function(icon, error) {
- if (icon) {
- let gicon = Gio.icon_new_for_string(icon);
- this._applet_icon.gicon = gicon;
- this.actor.show();
- } else {
- this.menu.close();
- this.actor.hide();
- }
- }));
+
+ _devicesChanged: function() {
+ this.set_applet_icon_symbolic_name('battery-missing');
+ let icon = this._proxy.Icon;
+ if (icon) {
+ let gicon = Gio.icon_new_for_string(icon);
+ this.setGIcon(gicon);
+ this.actor.show();
+ } else {
+ this.menu.close();
+ this.actor.hide();
+ }
+
this._readPrimaryDevice();
this._readOtherDevices();
this._updateLabel();
diff --git a/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
index 1113b1e..5bfaf26 100644
--- a/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
@@ -1,7 +1,6 @@
const Applet = imports.ui.applet;
const Mainloop = imports.mainloop;
const Gio = imports.gi.Gio;
-const DBus = imports.dbus;
const Lang = imports.lang;
const Cinnamon = imports.gi.Cinnamon;
const Clutter = imports.gi.Clutter;
@@ -12,90 +11,45 @@ const Gvc = imports.gi.Gvc;
const Pango = imports.gi.Pango;
const Tooltips = imports.ui.tooltips;
-const PropIFace = {
- name: 'org.freedesktop.DBus.Properties',
- signals: [{ name: 'PropertiesChanged',
- inSignature: 'a{sv}'}]
-};
-
-const MediaServer2IFace = {
- name: 'org.mpris.MediaPlayer2',
- methods: [{ name: 'Raise',
- inSignature: '',
- outSignature: '' },
- { name: 'Quit',
- inSignature: '',
- outSignature: '' }],
- properties: [{ name: 'CanRaise',
- signature: 'b',
- access: 'read'},
- { name: 'CanQuit',
- signature: 'b',
- access: 'read'}],
-};
-
-const MediaServer2PlayerIFace = {
- name: 'org.mpris.MediaPlayer2.Player',
- methods: [{ name: 'PlayPause',
- inSignature: '',
- outSignature: '' },
- { name: 'Pause',
- inSignature: '',
- outSignature: '' },
- { name: 'Play',
- inSignature: '',
- outSignature: '' },
- { name: 'Stop',
- inSignature: '',
- outSignature: '' },
- { name: 'Next',
- inSignature: '',
- outSignature: '' },
- { name: 'Previous',
- inSignature: '',
- outSignature: '' },
- { name: 'SetPosition',
- inSignature: 'a{ov}',
- outSignature: '' }],
- properties: [{ name: 'Metadata',
- signature: 'a{sv}',
- access: 'read'},
- { name: 'Shuffle',
- signature: 'b',
- access: 'readwrite'},
- { name: 'Rate',
- signature: 'd',
- access: 'readwrite'},
- { name: 'LoopStatus',
- signature: 'b',
- access: 'readwrite'},
- { name: 'Volume',
- signature: 'd',
- access: 'readwrite'},
- { name: 'PlaybackStatus',
- signature: 's',
- access: 'read'},
- { name: 'Position',
- signature: 'x',
- access: 'read'},
- { name: 'CanGoNext',
- signature: 'b',
- access: 'read'},
- { name: 'CanGoPrevious',
- signature: 'b',
- access: 'read'},
- { name: 'CanPlay',
- signature: 'b',
- access: 'read'},
- { name: 'CanPause',
- signature: 'b',
- access: 'read'},
- { name: 'CanSeek',
- signature: 'b',
- access: 'read'}],
- signals: [{ name: 'Seeked',
- inSignature: 'x' }]
-};
+const PropIFace = <interface name="org.freedesktop.DBus.Properties">
+<signal name="PropertiesChanged">
+ <arg type="a{sv}"/>
+</signal>
+</interface>;
+
+const MediaServer2IFace = <interface name="org.mpris.MediaPlayer2">
+<method name="Raise" />
+<method name="Quit" />
+<property name="CanRaise" type="b" access="read" />
+<property name="CanQuit" type="b" access="read" />
+</interface>;
+
+const MediaServer2PlayerIFace = <interface name="org.mpris.MediaPlayer2.Player">
+<method name="PlayPause" />
+<method name="Pause" />
+<method name="Play" />
+<method name="Stop" />
+<method name="Next" />
+<method name="Previous" />
+<method name="SetPosition">
+ <arg type="a{ov}" direction="in"/>
+</method>
+<property name='Metadata' access='read' type='a{sv}' />
+<property name='Shuffle' access='readwrite' type='b' />
+<property name='Rate' access='readwrite' type='d' />
+<property name='LoopStatus' access='readwrite' type='b' />
+<property name='Volume' access='readwrite' type='d' />
+<property name='PlaybackStatus' access='read' type='s' />
+<property name='Position' access='read' type='x' />
+<property name="CanGoNext" type="b" access="read" />
+<property name="CanGoPrevious" type="b" access="read" />
+<property name="CanPlay" type="b" access="read" />
+<property name="CanPause" type="b" access="read" />
+<property name="CanSeek" type="b" access="read" />
+<signal name="Seeked">
+ <arg type="x"/>
+</signal>
+</interface>;
/* global values */
let icon_path = "/usr/share/cinnamon/theme/";
@@ -112,120 +66,20 @@ const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */
const ICON_SIZE = 28;
-function Prop() {
- this._init.apply(this, arguments);
+var PropProxy = Gio.DBusProxy.makeProxyWrapper(PropIFace);
+function Prop(owner, initCallback, cancellable) {
+ return new PropProxy(Gio.DBus.session, owner, '/org/mpris/MediaPlayer2', initCallback, cancellable);
}
-Prop.prototype = {
- _init: function(owner) {
- DBus.session.proxifyObject(this, owner, '/org/mpris/MediaPlayer2', this);
- }
+var MediaServer2Proxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2IFace);
+function MediaServer2(owner, initCallback, cancellable) {
+ return new MediaServer2Proxy(Gio.DBus.session, owner, '/org/mpris/MediaPlayer2', initCallback, cancellable);
}
-DBus.proxifyPrototype(Prop.prototype, PropIFace)
-function MediaServer2() {
- this._init.apply(this, arguments);
-}
-
-MediaServer2.prototype = {
- _init: function(owner) {
- DBus.session.proxifyObject(this, owner, '/org/mpris/MediaPlayer2', this);
- },
- getRaise: function(callback) {
- this.GetRemote('CanRaise', Lang.bind(this,
- function(raise, ex) {
- if (!ex)
- callback(this, raise);
- }));
- },
- getQuit: function(callback) {
- this.GetRemote('CanQuit', Lang.bind(this,
- function(quit, ex) {
- if (!ex)
- callback(this, quit);
- }));
- }
-}
-DBus.proxifyPrototype(MediaServer2.prototype, MediaServer2IFace)
-
-function MediaServer2Player() {
- this._init.apply(this, arguments);
-}
-
-MediaServer2Player.prototype = {
- _init: function(owner) {
- this._owner = owner;
- DBus.session.proxifyObject(this, owner, '/org/mpris/MediaPlayer2', this);
- },
- getMetadata: function(callback) {
- this.GetRemote('Metadata', Lang.bind(this,
- function(metadata, ex) {
- if (!ex)
- callback(this, metadata);
- }));
- },
- getPlaybackStatus: function(callback) {
- this.GetRemote('PlaybackStatus', Lang.bind(this,
- function(status, ex) {
- if (!ex)
- callback(this, status);
- }));
- },
- getRate: function(callback) {
- this.GetRemote('Rate', Lang.bind(this,
- function(rate, ex) {
- if (!ex)
- callback(this, rate);
- }));
- },
- getPosition: function(callback) {
- this.GetRemote('Position', Lang.bind(this,
- function(position, ex) {
- if (!ex)
- callback(this, position);
- }));
- },
- getShuffle: function(callback) {
- this.GetRemote('Shuffle', Lang.bind(this,
- function(shuffle, ex) {
- if (!ex)
- callback(this, shuffle);
- }));
- },
- setShuffle: function(value) {
- this.SetRemote('Shuffle', value);
- },
- getVolume: function(callback) {
- this.GetRemote('Volume', Lang.bind(this,
- function(volume, ex) {
- if (!ex)
- callback(this, volume);
- }));
- },
- setVolume: function(value) {
- this.SetRemote('Volume', parseFloat(value));
- },
- getRepeat: function(callback) {
- this.GetRemote('LoopStatus', Lang.bind(this,
- function(repeat, ex) {
- if (!ex) {
- if (repeat == "None")
- repeat = false
- else
- repeat = true
- callback(this, repeat);
- }
- }));
- },
- setRepeat: function(value) {
- if (value)
- value = "Playlist"
- else
- value = "None"
- this.SetRemote('LoopStatus', value);
- }
+var MediaServer2PlayerProxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2PlayerIFace);
+function MediaServer2Player(owner, initCallback, cancellable) {
+ return new MediaServer2PlayerProxy(Gio.DBus.session, owner, '/org/mpris/MediaPlayer2', initCallback, cancellable);
}
-DBus.proxifyPrototype(MediaServer2Player.prototype, MediaServer2PlayerIFace)
function TrackInfo() {
this._init.apply(this, arguments);
@@ -715,7 +569,7 @@ MyApplet.prototype = {
this._players = {};
// watch players
for (var p=0; p<compatible_players.length; p++) {
- DBus.session.watch_name('org.mpris.MediaPlayer2.'+compatible_players[p], false,
+ Gio.DBus.session.watch_name('org.mpris.MediaPlayer2.'+compatible_players[p], false,
Lang.bind(this, this._addPlayer),
Lang.bind(this, this._removePlayer)
);
diff --git a/files/usr/share/cinnamon/applets/xrandr@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/xrandr@cinnamon.org/applet.js
index 0dcf74d..c2d152a 100644
--- a/files/usr/share/cinnamon/applets/xrandr@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/xrandr@cinnamon.org/applet.js
@@ -1,6 +1,6 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const Gdk = imports.gi.Gdk;
const GLib = imports.gi.GLib;
const GnomeDesktop = imports.gi.GnomeDesktop;
@@ -22,13 +22,14 @@ let rotations = [ [ GnomeDesktop.RRRotation.ROTATION_0, N_("Normal") ],
[ GnomeDesktop.RRRotation.ROTATION_180, N_("Upside-down") ]
];
-const XRandr2Iface = {
- name: 'org.gnome.SettingsDaemon.XRANDR_2',
- methods: [
- { name: 'ApplyConfiguration', inSignature: 'xx', outSignature: '' },
- ]
-};
-let XRandr2 = DBus.makeProxyClass(XRandr2Iface);
+const XRandr2Iface = <interface name="org.gnome.SettingsDaemon.XRANDR_2">
+<method name="ApplyConfiguration">
+ <arg type="x" direction="in"/>
+ <arg type="x" direction="in"/>
+</method>
+</interface>;
+
+const XRandr2 = Gio.DBusProxy.makeProxyWrapper(XRandr2Iface);
function MyApplet(orientation, panel_height) {
this._init(orientation, panel_height);
@@ -48,7 +49,7 @@ MyApplet.prototype = {
this.menu = new Applet.AppletPopupMenu(this, orientation);
this.menuManager.addMenu(this.menu);
- this._proxy = new XRandr2(DBus.session, 'org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/XRANDR');
+ this._proxy = new XRandr2(Gio.DBus.session, 'org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/XRANDR');
try {
this._screen = new GnomeDesktop.RRScreen({ gdk_screen: Gdk.Screen.get_default() });
diff --git a/js/misc/gnomeSession.js b/js/misc/gnomeSession.js
index a2b61fd..e21d3a8 100644
--- a/js/misc/gnomeSession.js
+++ b/js/misc/gnomeSession.js
@@ -1,20 +1,18 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Signals = imports.signals;
-const PresenceIface = {
- name: 'org.gnome.SessionManager.Presence',
- methods: [{ name: 'SetStatus',
- inSignature: 'u',
- outSignature: '' }],
- properties: [{ name: 'status',
- signature: 'u',
- access: 'readwrite' }],
- signals: [{ name: 'StatusChanged',
- inSignature: 'u' }]
-};
+const PresenceIface = <interface name="org.gnome.SessionManager.Presence">
+<method name="SetStatus">
+ <arg type="u" direction="in"/>
+</method>
+<property name="status" type="u" access="readwrite"/>
+<signal name="StatusChanged">
+ <arg type="u" direction="out"/>
+</signal>
+</interface>;
const PresenceStatus = {
AVAILABLE: 0,
@@ -23,104 +21,37 @@ const PresenceStatus = {
IDLE: 3
};
-function Presence() {
- this._init();
+var PresenceProxy = Gio.DBusProxy.makeProxyWrapper(PresenceIface);
+function Presence(initCallback, cancellable) {
+ return new PresenceProxy(Gio.DBus.session, 'org.gnome.SessionManager',
+ '/org/gnome/SessionManager/Presence', initCallback, cancellable);
}
-Presence.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this, 'org.gnome.SessionManager', '/org/gnome/SessionManager/Presence', this);
- },
-
- getStatus: function(callback) {
- this.GetRemote('status', Lang.bind(this,
- function(status, ex) {
- if (!ex)
- callback(this, status);
- }));
- },
-
- setStatus: function(status) {
- this.SetStatusRemote(status);
- }
-};
-DBus.proxifyPrototype(Presence.prototype, PresenceIface);
-
-// Note inhibitors are immutable objects, so they don't
-// change at runtime (changes always come in the form
-// of new inhibitors)
-const InhibitorIface = {
- name: 'org.gnome.SessionManager.Inhibitor',
- properties: [{ name: 'app_id',
- signature: 's',
- access: 'readonly' },
- { name: 'client_id',
- signature: 's',
- access: 'readonly' },
- { name: 'reason',
- signature: 's',
- access: 'readonly' },
- { name: 'flags',
- signature: 'u',
- access: 'readonly' },
- { name: 'toplevel_xid',
- signature: 'u',
- access: 'readonly' },
- { name: 'cookie',
- signature: 'u',
- access: 'readonly' }],
-};
-
-function Inhibitor(objectPath) {
- this._init(objectPath);
+const InhibitorIface = <interface name="org.gnome.SessionManager.Inhibitor">
+<property name="app_id" type="s" access="read" />
+<property name="client_id" type="s" access="read" />
+<property name="reason" type="s" access="read" />
+<property name="flags" type="u" access="read" />
+<property name="toplevel_xid" type="u" access="read" />
+<property name="cookie" type="u" access="read" />
+</interface>;
+
+var InhibitorProxy = Gio.DBusProxy.makeProxyWrapper(InhibitorIface);
+function Inhibitor(objectPath, initCallback, cancellable) {
+ return new InhibitorProxy(Gio.DBus.session, 'org.gnome.SessionManager', objectPath, initCallback, cancellable);
}
-Inhibitor.prototype = {
- _init: function(objectPath) {
- DBus.session.proxifyObject(this,
- 'org.gnome.SessionManager',
- objectPath);
- this.isLoaded = false;
- this._loadingPropertiesCount = InhibitorIface.properties.length;
- for (let i = 0; i < InhibitorIface.properties.length; i++) {
- let propertyName = InhibitorIface.properties[i].name;
- this.GetRemote(propertyName, Lang.bind(this,
- function(value, exception) {
- if (exception)
- return;
-
- this[propertyName] = value;
- this._loadingPropertiesCount--;
-
- if (this._loadingPropertiesCount == 0) {
- this.isLoaded = true;
- this.emit('is-loaded');
- }
- }));
- }
- },
-};
-DBus.proxifyPrototype(Inhibitor.prototype, InhibitorIface);
-Signals.addSignalMethods(Inhibitor.prototype);
-
-
-// Not the full interface, only the methods we use
-const SessionManagerIface = {
- name: 'org.gnome.SessionManager',
- methods: [
- { name: 'Logout', inSignature: 'u', outSignature: '' },
- { name: 'Shutdown', inSignature: '', outSignature: '' },
- { name: 'CanShutdown', inSignature: '', outSignature: 'b' }
- ]
-};
-
-function SessionManager() {
- this._init();
+const SessionManagerIface = <interface name="org.gnome.SessionManager">
+<method name="Logout">
+ <arg type="u" direction="in" />
+</method>
+<method name="Shutdown" />
+<method name="CanShutdown">
+ <arg type="b" direction="out" />
+</method>
+</interface>;
+
+var SessionManagerProxy = Gio.DBusProxy.makeProxyWrapper(SessionManagerIface);
+function SessionManager(initCallback, cancellable) {
+ return new SessionManagerProxy(Gio.DBus.session, 'org.gnome.SessionManager', '/org/gnome/SessionManager', initCallback, cancellable);
}
-
-SessionManager.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this, 'org.gnome.SessionManager', '/org/gnome/SessionManager');
- }
-};
-DBus.proxifyPrototype(SessionManager.prototype, SessionManagerIface);
\ No newline at end of file
diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js
index befd142..f35f925 100644
--- a/js/misc/modemManager.js
+++ b/js/misc/modemManager.js
@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Cinnamon = imports.gi.Cinnamon;
const Signals = imports.signals;
@@ -8,33 +8,43 @@ const Signals = imports.signals;
// The following are not the complete interfaces, just the methods we need
// (or may need in the future)
-const ModemGsmNetworkInterface = {
- name: 'org.freedesktop.ModemManager.Modem.Gsm.Network',
- methods: [
- { name: 'GetRegistrationInfo', inSignature: '', outSignature: 'uss' },
- { name: 'GetSignalQuality', inSignature: '', outSignature: 'u' }
- ],
- properties: [
- { name: 'AccessTechnology', signature: 'u', access: 'read' }
- ],
- signals: [
- { name: 'SignalQuality', inSignature: 'u' },
- { name: 'RegistrationInfo', inSignature: 'uss' }
- ]
-};
-const ModemGsmNetworkProxy = DBus.makeProxyClass(ModemGsmNetworkInterface);
-
-const ModemCdmaInterface = {
- name: 'org.freedesktop.ModemManager.Modem.Cdma',
- methods: [
- { name: 'GetSignalQuality', inSignature: '', outSignature: 'u' },
- { name: 'GetServingSystem', inSignature: '', outSignature: 'usu' }
- ],
- signals: [
- { name: 'SignalQuality', inSignature: 'u' }
- ]
-};
-const ModemCdmaProxy = DBus.makeProxyClass(ModemCdmaInterface);
+const ModemGsmNetworkInterface = <interface name="org.freedesktop.ModemManager.Modem.Gsm.Network">
+<method name="GetRegistrationInfo">
+ <arg type="u" direction="out" />
+ <arg type="s" direction="out" />
+ <arg type="s" direction="out" />
+</method>
+<method name="GetSignalQuality">
+ <arg type="u" direction="out" />
+</method>
+<property name="AccessTechnology" type="u" access="read" />
+<signal name="SignalQuality">
+ <arg type="u" direction="out" />
+</signal>
+<signal name="RegistrationInfo">
+ <arg type="u" direction="out" />
+ <arg type="s" direction="out" />
+ <arg type="s" direction="out" />
+</signal>
+</interface>;
+
+const ModemGsmNetworkProxy = Gio.DBusProxy.makeProxyWrapper(ModemGsmNetworkInterface);
+
+const ModemCdmaInterface = <interface name="org.freedesktop.ModemManager.Modem.Cdma">
+<method name="GetSignalQuality">
+ <arg type="u" direction="out" />
+</method>
+<method name="GetServingSystem">
+ <arg type="u" direction="out" />
+ <arg type="s" direction="out" />
+ <arg type="u" direction="out" />
+</method>
+<signal name="SignalQuality">
+ <arg type="u" direction="out" />
+</signal>
+</interface>;
+
+const ModemCdmaProxy = Gio.DBusProxy.makeProxyWrapper(ModemCdmaInterface);
let _providersTable;
function _getProvidersTable() {
@@ -50,17 +60,17 @@ function ModemGsm() {
ModemGsm.prototype = {
_init: function(path) {
- this._proxy = new ModemGsmNetworkProxy(DBus.system, 'org.freedesktop.ModemManager', path);
+ this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
this.signal_quality = 0;
this.operator_name = null;
// Code is duplicated because the function have different signatures
- this._proxy.connect('SignalQuality', Lang.bind(this, function(proxy, quality) {
+ this._proxy.connectSignal('SignalQuality', Lang.bind(this, function(proxy, sender, [quality]) {
this.signal_quality = quality;
this.emit('notify::signal-quality');
}));
- this._proxy.connect('RegistrationInfo', Lang.bind(this, function(proxy, status, code, name) {
+ this._proxy.connectSignal('RegistrationInfo', Lang.bind(this, function(proxy, sender, [status, code, name]) {
this.operator_name = this._findOperatorName(name, code);
this.emit('notify::operator-name');
}));
@@ -154,12 +164,13 @@ function ModemCdma() {
}
ModemCdma.prototype = {
- _init: function(path) {
- this._proxy = new ModemCdmaProxy(DBus.system, 'org.freedesktop.ModemManager', path);
+ _init: function(path) {
+ this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
this.signal_quality = 0;
this.operator_name = null;
- this._proxy.connect('SignalQuality', Lang.bind(this, function(proxy, quality) {
+ this._proxy.connect('SignalQuality', Lang.bind(this, function(proxy, sender, params) {
+ this.signal_quality = params[0];
this.signal_quality = quality;
this.emit('notify::signal-quality');
diff --git a/js/misc/screenSaver.js b/js/misc/screenSaver.js
index c471856..aec883f 100644
--- a/js/misc/screenSaver.js
+++ b/js/misc/screenSaver.js
@@ -1,53 +1,48 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
const Lang = imports.lang;
-
-const ScreenSaverIface = {
- name: 'org.gnome.ScreenSaver',
- methods: [{ name: 'GetActive',
- inSignature: '',
- outSignature: 'b' },
- { name: 'Lock',
- inSignature: '' },
- { name: 'SetActive',
- inSignature: 'b' }],
- signals: [{ name: 'ActiveChanged',
- inSignature: 'b' }]
-};
+const Gio = imports.gi.Gio;
+
+const ScreenSaverIface = <interface name="org.gnome.ScreenSaver">
+<method name="GetActive">
+ <arg type="b" direction="out" />
+</method>
+<method name="Lock" />
+<method name="SetActive">
+ <arg type="b" direction="in" />
+</method>
+<signal name="ActiveChanged">
+ <arg type="b" direction="out" />
+</signal>
+</interface>;
+
+const ScreenSaverInfo = Gio.DBusInterfaceInfo.new_for_xml(ScreenSaverIface);
function ScreenSaverProxy() {
- this._init();
+ var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
+ g_interface_name: ScreenSaverInfo.name,
+ g_interface_info: ScreenSaverInfo,
+ g_name: 'org.gnome.ScreenSaver',
+ g_object_path: '/org/gnome/ScreenSaver',
+ g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
+ Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
+ self.init(null);
+ self.screenSaverActive = false;
+
+ self.connectSignal('ActiveChanged', function(proxy, senderName, [isActive]) {
+ self.screenSaverActive = isActive;
+ });
+ self.connect('notify::g-name-owner', function() {
+ if (self.g_name_owner) {
+ self.GetActiveRemote(function(result, excp) {
+ if (result) {
+ let [isActive] = result;
+ self.screenSaverActive = isActive;
+ }
+ });
+ } else
+ self.screenSaverActive = false;
+ });
+
+ return self;
}
-
-ScreenSaverProxy.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this,
- 'org.gnome.ScreenSaver',
- '/org/gnome/ScreenSaver');
-
- DBus.session.watch_name('org.gnome.ScreenSaver',
- false, // do not launch a name-owner if none exists
- Lang.bind(this, this._onSSAppeared),
- Lang.bind(this, this._onSSVanished));
-
- this.screenSaverActive = false;
- this.connect('ActiveChanged',
- Lang.bind(this, this._onActiveChanged));
- },
-
- _onSSAppeared: function(owner) {
- this.GetActiveRemote(Lang.bind(this, function(isActive) {
- this.screenSaverActive = isActive;
- }))
- },
-
- _onSSVanished: function(oldOwner) {
- this.screenSaverActive = false;
- },
-
- _onActiveChanged: function(object, isActive) {
- this.screenSaverActive = isActive;
- }
-};
-DBus.proxifyPrototype(ScreenSaverProxy.prototype, ScreenSaverIface);
diff --git a/js/ui/appletManager.js b/js/ui/appletManager.js
index abf8136..830d80d 100644
--- a/js/ui/appletManager.js
+++ b/js/ui/appletManager.js
@@ -7,7 +7,6 @@ const Cinnamon = imports.gi.Cinnamon;
const Main = imports.ui.main;
const Applet = imports.ui.applet;
const Extension = imports.ui.extension;
-const DBus = imports.dbus;
// Maps uuid -> metadata object
var appletMeta;
diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js
index fa73bfe..f29f9f3 100644
--- a/js/ui/automountManager.js
+++ b/js/ui/automountManager.js
@@ -1,7 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Lang = imports.lang;
-const DBus = imports.dbus;
const Mainloop = imports.mainloop;
const Gio = imports.gi.Gio;
const Params = imports.misc.params;
@@ -15,63 +14,57 @@ const SETTING_ENABLE_AUTOMOUNT = 'automount';
const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
-const ConsoleKitSessionIface = {
- name: 'org.freedesktop.ConsoleKit.Session',
- methods: [{ name: 'IsActive',
- inSignature: '',
- outSignature: 'b' }],
- signals: [{ name: 'ActiveChanged',
- inSignature: 'b' }]
-};
+const ConsoleKitSessionIface = <interface name="org.freedesktop.ConsoleKit.Session">
+<method name="isActive">
+ <arg type="b" direction="out" />
+</method>
+<method name="ActiveChanged">
+ <arg type="b" direction="in" />
+</method>
+</interface>;
-const ConsoleKitSessionProxy = DBus.makeProxyClass(ConsoleKitSessionIface);
+const ConsoleKitSessionProxy = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
-const ConsoleKitManagerIface = {
- name: 'org.freedesktop.ConsoleKit.Manager',
- methods: [{ name: 'GetCurrentSession',
- inSignature: '',
- outSignature: 'o' }]
-};
+const ConsoleKitManagerIface = <interface name="org.freedesktop.ConsoleKit.Manager">
+<method name="GetCurrentSession">
+ <arg type="o" direction="out" />
+</method>
+</interface>;
-function ConsoleKitManager() {
- this._init();
-};
-
-ConsoleKitManager.prototype = {
- _init: function() {
- this.sessionActive = true;
-
- DBus.system.proxifyObject(this,
- 'org.freedesktop.ConsoleKit',
- '/org/freedesktop/ConsoleKit/Manager');
+const ConsoleKitManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(ConsoleKitManagerIface);
- DBus.system.watch_name('org.freedesktop.ConsoleKit',
- false, // do not launch a name-owner if none exists
- Lang.bind(this, this._onManagerAppeared),
- Lang.bind(this, this._onManagerVanished));
- },
-
- _onManagerAppeared: function(owner) {
- this.GetCurrentSessionRemote(Lang.bind(this, this._onCurrentSession));
- },
-
- _onManagerVanished: function(oldOwner) {
- this.sessionActive = true;
- },
-
- _onCurrentSession: function(session) {
- this._ckSession = new ConsoleKitSessionProxy(DBus.system, 'org.freedesktop.ConsoleKit', session);
-
- this._ckSession.connect
- ('ActiveChanged', Lang.bind(this, function(object, isActive) {
- this.sessionActive = isActive;
- }));
- this._ckSession.IsActiveRemote(Lang.bind(this, function(isActive) {
- this.sessionActive = isActive;
- }));
+function ConsoleKitManager() {
+ var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system,
+ g_interface_name: ConsoleKitManagerInfo.name,
+ g_interface_info: ConsoleKitManagerInfo,
+ g_name: 'org.freedesktop.ConsoleKit',
+ g_object_path: '/org/freedesktop/ConsoleKit/Manager',
+ g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
+ Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
+
+ self._updateSessionActive = function() {
+ if (self.g_name_owner) {
+ self.GetCurrentSessionRemote(function([session]) {
+ self._ckSession = new ConsoleKitSessionProxy(Gio.DBus.system, 'org.freedesktop.ConsoleKit', session);
+
+ self._ckSession.connectSignal('ActiveChanged', function(object, senderName, [isActive]) {
+ self.sessionActive = isActive;
+ });
+ self._ckSession.IsActiveRemote(function([isActive]) {
+ self.sessionActive = isActive;
+ });
+ });
+ } else {
+ self.sessionActive = true;
+ }
}
-};
-DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface);
+ self.connect('notify::g-name-owner',
+ Lang.bind(self, self._updateSessionActive));
+
+ self._updateSessionActive();
+ self.init(null);
+ return self;
+}
function AutomountManager() {
this._init();
@@ -85,9 +78,8 @@ AutomountManager.prototype = {
this.ckListener = new ConsoleKitManager();
this._ssProxy = new ScreenSaver.ScreenSaverProxy();
- this._ssProxy.connect('ActiveChanged',
- Lang.bind(this,
- this._screenSaverActiveChanged));
+ this._ssProxy.connectSignal('ActiveChanged',
+ Lang.bind(this, this._screenSaverActiveChanged));
this._volumeMonitor = Gio.VolumeMonitor.get();
@@ -110,7 +102,7 @@ AutomountManager.prototype = {
Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
},
- _screenSaverActiveChanged: function(object, isActive) {
+ _screenSaverActiveChanged: function(object, senderName, [isActive]) {
if (!isActive) {
this._volumeQueue.forEach(Lang.bind(this, function(volume) {
this._checkAndMountVolume(volume);
diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js
index 02cd4da..99b6fbe 100644
--- a/js/ui/autorunManager.js
+++ b/js/ui/autorunManager.js
@@ -1,7 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Lang = imports.lang;
-const DBus = imports.dbus;
const Gio = imports.gi.Gio;
const St = imports.gi.St;
@@ -61,25 +60,19 @@ function startAppForMount(app, mount) {
/******************************************/
-const HotplugSnifferIface = {
- name: 'org.Cinnamon.HotplugSniffer',
- methods: [{ name: 'SniffURI',
- inSignature: 's',
- outSignature: 'as' }]
-};
-
-const HotplugSniffer = function() {
- this._init();
-};
+const HotplugSnifferIface = <interface name="org.Cinnamon.HotplugSniffer">
+<method name="SniffURI">
+ <arg type="s" direction="in" />
+ <arg type="as" direction="out" />
+</method>
+</interface>;
-HotplugSniffer.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this,
+const HotplugSnifferProxy = Gio.DBusProxy.makeProxyWrapper(HotplugSnifferIface);
+function HotplugSniffer() {
+ return new HotplugSnifferProxy(Gio.DBus.session,
'org.Cinnamon.HotplugSniffer',
'/org/Cinnamon/HotplugSniffer');
- },
-};
-DBus.proxifyPrototype(HotplugSniffer.prototype, HotplugSnifferIface);
+}
function ContentTypeDiscoverer(callback) {
this._init(callback);
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index ff4777a..a97e2a9 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1,6 +1,5 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
@@ -194,30 +193,34 @@ EmptyEventSource.prototype = {
};
Signals.addSignalMethods(EmptyEventSource.prototype);
-const CalendarServerIface = {
- name: 'org.Cinnamon.CalendarServer',
- methods: [{ name: 'GetEvents',
- inSignature: 'xxb',
- outSignature: 'a(sssbxxa{sv})' }],
- signals: [{ name: 'Changed',
- inSignature: '' }]
-};
-
-const CalendarServer = function () {
- this._init();
-};
-
-CalendarServer.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this, 'org.Cinnamon.CalendarServer', '/org/Cinnamon/CalendarServer');
- }
-};
-
-DBus.proxifyPrototype(CalendarServer.prototype, CalendarServerIface);
+const CalendarServerIface = <interface name="org.Cinnamon.CalendarServer">
+<method name="GetEvents">
+ <arg type="x" direction="in" />
+ <arg type="x" direction="in" />
+ <arg type="b" direction="in" />
+ <arg type="a(sssbxxa{sv})" direction="out" />
+</method>
+<signal name="Changed" />
+</interface>;
+
+const CalendarServerInfo = Gio.DBusInterfaceInfo.new_for_xml(CalendarServerIface);
+
+function CalendarServer() {
+ var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
+ g_interface_name: CalendarServerInfo.name,
+ g_interface_info: CalendarServerInfo,
+ g_name: 'org.Cinnamon.CalendarServer',
+ g_object_path: '/org/Cinnamon/CalendarServer',
+ g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
+ Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
+
+ self.init(null);
+ return self;
+}
// an implementation that reads data from a session bus service
-function DBusEventSource(owner) {
- this._init(owner);
+function DBusEventSource() {
+ this._init();
}
function _datesEqual(a, b) {
@@ -240,16 +243,18 @@ function _dateIntervalsOverlap(a0, a1, b0, b1)
DBusEventSource.prototype = {
- _init: function(owner) {
+ _init: function() {
this._resetCache();
- this._dbusProxy = new CalendarServer(owner);
- this._dbusProxy.connect('Changed', Lang.bind(this, this._onChanged));
+ this._dbusProxy = new CalendarServer();
+ this._dbusProxy.connectSignal('Changed', Lang.bind(this, this._onChanged));
- DBus.session.watch_name('org.Cinnamon.CalendarServer',
- false, // do not launch a name-owner if none exists
- Lang.bind(this, this._onNameAppeared),
- Lang.bind(this, this._onNameVanished));
+ this._dbusProxy.connect('notify::g-name-owner', Lang.bind(this, function() {
+ if (this._dbusProxy.g_name_owner)
+ this._onNameAppeared();
+ else
+ this._onNameVanished();
+ }));
},
_resetCache: function() {
@@ -272,7 +277,7 @@ DBusEventSource.prototype = {
this._loadEvents(false);
},
- _onEventsReceived: function(appointments) {
+ _onEventsReceived: function([appointments]) {
let newEvents = [];
if (appointments != null) {
for (let n = 0; n < appointments.length; n++) {
@@ -295,9 +300,9 @@ DBusEventSource.prototype = {
_loadEvents: function(forceReload) {
if (this._curRequestBegin && this._curRequestEnd){
- let callFlags = 0;
+ let callFlags = Gio.DBusCallFlags.NO_AUTO_START;
if (forceReload)
- callFlags |= DBus.CALL_FLAG_START;
+ callFlags = Gio.DBusCallFlags.NONE;
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
this._curRequestEnd.getTime() / 1000,
forceReload,
diff --git a/js/ui/cinnamonDBus.js b/js/ui/cinnamonDBus.js
index 600e92f..5d4eb1c 100644
--- a/js/ui/cinnamonDBus.js
+++ b/js/ui/cinnamonDBus.js
@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
const Lang = imports.lang;
+const Gio = imports.gi.Gio;
const Config = imports.misc.config;
const Flashspot = imports.ui.flashspot;
@@ -9,48 +9,53 @@ const Main = imports.ui.main;
const AppletManager = imports.ui.appletManager;
const DeskletManager = imports.ui.deskletManager;
-const CinnamonIface = {
- name: 'org.Cinnamon',
- methods: [{ name: 'Eval',
- inSignature: 's',
- outSignature: 'bs'
- },
- { name: 'ScreenshotArea',
- inSignature: 'biiiibs',
- outSignature: ''
- },
- { name: 'ScreenshotWindow',
- inSignature: 'bbbs',
- outSignature: ''
- },
- { name: 'Screenshot',
- inSignature: 'bbs',
- outSignature: ''
- },
- {
- name: 'FlashArea',
- inSignature: 'iiii',
- outSignature: ''
- },
- {
- name: 'highlightApplet',
- inSignature: 'sb',
- outSignature: ''
- },
- {
- name: 'activateCallback',
- inSignature: 'ssb',
- outSignature: ''
- }
- ],
- signals: [],
- properties: [{ name: 'OverviewActive',
- signature: 'b',
- access: 'readwrite' },
- { name: 'CinnamonVersion',
- signature: 's',
- access: 'read' }]
-};
+
+const CinnamonIface = <interface name="org.Cinnamon">
+<method name="Eval">
+ <arg type="s" direction="in" name="script" />
+ <arg type="b" direction="out" name="success" />
+ <arg type="s" direction="out" name="result" />
+</method>
+<method name="ScreenshotArea">
+include_cursor
+ <arg type="b" direction="in" name="include_cursor"/>
+ <arg type="i" direction="in" name="x"/>
+ <arg type="i" direction="in" name="y"/>
+ <arg type="i" direction="in" name="width"/>
+ <arg type="i" direction="in" name="height"/>
+ <arg type="b" direction="in" name="flash"/>
+ <arg type="s" direction="in" name="filename"/>
+</method>
+<method name="ScreenshotWindow">
+ <arg type="b" direction="in" name="include_frame"/>
+ <arg type="b" direction="in" name="include_cursor"/>
+ <arg type="b" direction="in" name="flash"/>
+ <arg type="s" direction="in" name="filename"/>
+</method>
+<method name="Screenshot">
+ <arg type="b" direction="in" name="include_frame"/>
+ <arg type="b" direction="in" name="flash"/>
+ <arg type="s" direction="in" name="filename"/>
+</method>
+<method name="FlashArea">
+include_cursor
+ <arg type="i" direction="in" name="x"/>
+ <arg type="i" direction="in" name="y"/>
+ <arg type="i" direction="in" name="width"/>
+ <arg type="i" direction="in" name="height"/>
+</method>
+<method name="highlightApplet">
+ <arg type="s" direction="in" />
+ <arg type="b" direction="in" />
+</method>
+<method name="activateCallback">
+ <arg type="s" direction="in" />
+ <arg type="s" direction="in" />
+ <arg type="b" direction="in" />
+</method>
+<property name="OverviewActive" type="b" access="readwrite" />
+<property name="CinnamonVersion" type="s" access="read" />
+</interface>;
function Cinnamon() {
this._init();
@@ -58,7 +63,8 @@ function Cinnamon() {
Cinnamon.prototype = {
_init: function() {
- DBus.session.exportObject('/org/Cinnamon', this);
+ this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(CinnamonIface, this);
+ this._dbusImpl.export(Gio.DBus.session, '/org/Cinnamon');
},
/**
@@ -215,5 +221,3 @@ Cinnamon.prototype = {
CinnamonVersion: Config.PACKAGE_VERSION
};
-DBus.conformExport(Cinnamon.prototype, CinnamonIface);
-
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index e909f5f..4f1f7d0 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -18,19 +18,19 @@
* 02110-1335, USA.
*/
-const DBus = imports.dbus;
const Lang = imports.lang;
const Signals = imports.signals;
const AccountsService = imports.gi.AccountsService;
const Clutter = imports.gi.Clutter;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Pango = imports.gi.Pango;
const St = imports.gi.St;
const Cinnamon = imports.gi.Cinnamon;
-const GnomeSession = imports.misc.gnomeSession
+const GnomeSession = imports.misc.gnomeSession;
const ModalDialog = imports.ui.modalDialog;
const Tweener = imports.ui.tweener;
@@ -40,20 +40,20 @@ const _ITEM_ICON_SIZE = 48;
const _DIALOG_ICON_SIZE = 32;
const GSM_SESSION_MANAGER_LOGOUT_FORCE = 2;
-
-const EndSessionDialogIface = {
- name: 'org.gnome.SessionManager.EndSessionDialog',
- methods: [{ name: 'Open',
- inSignature: 'uuuao',
- outSignature: ''
- }
- ],
- signals: [{ name: 'Canceled',
- inSignature: '',
- }],
- properties: []
-};
-
+const EndSessionDialogIface = <interface name="org.gnome.SessionManager.EndSessionDialog">
+<method name="Open">
+ <arg type="u" direction="in" />
+ <arg type="u" direction="in" />
+ <arg type="u" direction="in" />
+ <arg type="ao" direction="in" />
+</method>
+<signal name="ConfirmedLogout" />
+<signal name="ConfirmedReboot" />
+<signal name="ConfirmedShutdown" />
+<signal name="Canceled" />
+<signal name="Closed" />
+</interface>;
+
const logoutDialogContent = {
subjectWithUser: _("Log Out %s"),
subject: _("Log Out"),
@@ -230,8 +230,6 @@ function _setLabelText(label, text) {
function EndSessionDialog() {
if (_endSessionDialog == null) {
this._init();
- DBus.session.exportObject('/org/gnome/SessionManager/EndSessionDialog',
- this);
_endSessionDialog = this;
}
@@ -328,6 +326,9 @@ EndSessionDialog.prototype = {
if (this._applicationList.get_children().length == 0)
scrollView.hide();
}));
+
+ this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(EndSessionDialogIface, this);
+ this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
},
_onDestroy: function() {
@@ -442,25 +443,19 @@ EndSessionDialog.prototype = {
close: function() {
ModalDialog.ModalDialog.prototype.close.call(this);
- DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
- 'org.gnome.SessionManager.EndSessionDialog',
- 'Closed', '', []);
+ this._dbusImpl.emit_signal('Closed', null);
},
cancel: function() {
this._stopTimer();
- DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
- 'org.gnome.SessionManager.EndSessionDialog',
- 'Canceled', '', []);
+ this._dbusImpl.emit_signal('Canceled', null);
this.close(global.get_current_time());
},
_confirm: function(signal) {
this._fadeOutDialog();
this._stopTimer();
- DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
- 'org.gnome.SessionManager.EndSessionDialog',
- signal, '', []);
+ this._dbusImpl.emit_signal(signal, null);
},
_onOpened: function() {
@@ -512,39 +507,41 @@ EndSessionDialog.prototype = {
this._updateContent();
},
- OpenAsync: function(type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths, callback) {
+ OpenAsync: function(parameters, invocation) {
+ let [type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths] = parameters;
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
this._inhibitors = [];
this._applicationList.destroy_children();
this._type = type;
- if (!(this._type in DialogContent))
- throw new DBus.DBusError('org.Cinnamon.ModalDialog.TypeError',
- "Unknown dialog type requested");
+ if (!(this._type in DialogContent)) {
+ invocation.report_dbus_error('org.Cinnamon.ModalDialog.TypeError',
+ "Unknown dialog type requested");
+ return;
+ }
for (let i = 0; i < inhibitorObjectPaths.length; i++) {
- let inhibitor = new GnomeSession.Inhibitor(inhibitorObjectPaths[i]);
+ let inhibitor = new GnomeSession.Inhibitor(inhibitorObjectPaths[i], Lang.bind(this, function(proxy, error) {
+ this._onInhibitorLoaded(proxy);
+ }));
- inhibitor.connect('is-loaded',
- Lang.bind(this, function() {
- this._onInhibitorLoaded(inhibitor);
- }));
this._inhibitors.push(inhibitor);
}
this._updateButtons();
- if (!this.open(timestamp))
- throw new DBus.DBusError('org.Cinnamon.ModalDialog.GrabError',
- "Cannot grab pointer and keyboard");
+ if (!this.open(timestamp)) {
+ invocation.report_dbus_error('org.Cinnamon.ModalDialog.GrabError',
+ "Cannot grab pointer and keyboard");
+ return;
+ }
this._updateContent();
let signalId = this.connect('opened',
Lang.bind(this, function() {
- callback();
+ invocation.return_value(null);
this.disconnect(signalId);
}));
}
};
-DBus.conformExport(EndSessionDialog.prototype, EndSessionDialogIface);
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index f55cf93..69edb51 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -2,7 +2,6 @@
const Caribou = imports.gi.Caribou;
const Clutter = imports.gi.Clutter;
-const DBus = imports.dbus;
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
@@ -38,28 +37,27 @@ const PRETTY_KEYS = {
'Alt_L': 'Alt'
};
-const CaribouKeyboardIface = {
- name: 'org.gnome.Caribou.Keyboard',
- methods: [ { name: 'Show',
- inSignature: 'u',
- outSignature: ''
- },
- { name: 'Hide',
- inSignature: 'u',
- outSignature: ''
- },
- { name: 'SetCursorLocation',
- inSignature: 'iiii',
- outSignature: ''
- },
- { name: 'SetEntryLocation',
- inSignature: 'iiii',
- outSignature: ''
- } ],
- properties: [ { name: 'Name',
- signature: 's',
- access: 'read' } ]
-};
+const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'>
+<method name='Show'>
+ <arg type='u' direction='in' />
+</method>
+<method name='Hide'>
+ <arg type='u' direction='in' />
+</method>
+<method name='SetCursorLocation'>
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+</method>
+<method name='SetEntryLocation'>
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+ <arg type='i' direction='in' />
+</method>
+<property name='Name' access='read' type='s' />
+</interface>;
function Key() {
this._init.apply(this, arguments);
@@ -199,7 +197,8 @@ function Keyboard() {
Keyboard.prototype = {
_init: function () {
- DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this);
+ this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this);
+ this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
this.actor = null;
@@ -541,7 +540,6 @@ Keyboard.prototype = {
return 'cinnamon';
}
};
-DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface);
function KeyboardSource() {
this._init.apply(this, arguments);
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 76303b9..b97459e 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -488,12 +488,14 @@ Chrome.prototype = {
this._screenSaverActive = false;
this._screenSaverProxy = new ScreenSaver.ScreenSaverProxy();
- this._screenSaverProxy.connect('ActiveChanged', Lang.bind(this, this._onScreenSaverActiveChanged));
- this._screenSaverProxy.GetActiveRemote(Lang.bind(this,
- function(result, err) {
- if (!err)
- this._onScreenSaverActiveChanged(this._screenSaverProxy, result);
- }));
+ this._screenSaverProxy.connectSignal('ActiveChanged', Lang.bind(this, function(proxy, senderName, [isActive]) {
+ this._onScreenSaverActiveChanged(isActive);
+ }));
+ this._screenSaverProxy.GetActiveRemote(Lang.bind(this, function(result, err) {
+ if (!err)
+ this._onScreenSaverActiveChanged(result[0]);
+ }));
+
this._relayout();
},
diff --git a/js/ui/magnifierDBus.js b/js/ui/magnifierDBus.js
index 72bba26..4d21797 100644
--- a/js/ui/magnifierDBus.js
+++ b/js/ui/magnifierDBus.js
@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const Main = imports.ui.main;
const MAG_SERVICE_NAME = 'org.gnome.Magnifier';
@@ -10,47 +10,85 @@ const ZOOM_SERVICE_PATH = '/org/gnome/Magnifier/ZoomRegion';
// Subset of gnome-mag's Magnifier dbus interface -- to be expanded. See:
// http://git.gnome.org/browse/gnome-mag/tree/xml/...Magnifier.xml
-const MagnifierIface = {
- name: MAG_SERVICE_NAME,
- methods: [
- { name: 'setActive', inSignature: 'b', outSignature: '' },
- { name: 'isActive', inSignature: '', outSignature: 'b' },
- { name: 'showCursor', inSignature: '', outSignature: '' },
- { name: 'hideCursor', inSignature: '', outSignature: '' },
- { name: 'createZoomRegion', inSignature: 'ddaiai', outSignature: 'o' },
- { name: 'addZoomRegion', inSignature: 'o', outSignature: 'b' },
- { name: 'getZoomRegions', inSignature: '', outSignature: 'ao' },
- { name: 'clearAllZoomRegions', inSignature: '', outSignature: '' },
- { name: 'fullScreenCapable', inSignature: '', outSignature: 'b' },
-
- { name: 'setCrosswireSize', inSignature: 'i', outSignature: '' },
- { name: 'getCrosswireSize', inSignature: '', outSignature: 'i' },
- { name: 'setCrosswireLength', inSignature: 'i', outSignature: '' },
- { name: 'getCrosswireLength', inSignature: '', outSignature: 'i' },
- { name: 'setCrosswireClip', inSignature: 'b', outSignature: '' },
- { name: 'getCrosswireClip', inSignature: '', outSignature: 'b' },
- { name: 'setCrosswireColor', inSignature: 'u', outSignature: '' },
- { name: 'getCrosswireColor', inSignature: '', outSignature: 'u' }
- ],
- signals: [],
- properties: []
-};
+const MagnifierIface = <interface name={MAG_SERVICE_NAME}>
+<method name="setActive">
+ <arg type="b" direction="in" />
+</method>
+<method name="isActive">
+ <arg type="b" direction="out" />
+</method>
+<method name="showCursor" />
+<method name="hideCursor" />
+<method name="createZoomRegion">
+ <arg type="d" direction="in" />
+ <arg type="d" direction="in" />
+ <arg type="ai" direction="in" />
+ <arg type="ai" direction="in" />
+ <arg type="o" direction="out" />
+</method>
+<method name="addZoomRegion">
+ <arg type="o" direction="in" />
+ <arg type="b" direction="out" />
+</method>
+<method name="getZoomRegions">
+ <arg type="ao" direction="out" />
+</method>
+<method name="clearAllZoomRegions" />
+<method name="fullScreenCapable">
+ <arg type="b" direction="out" />
+</method>
+<method name="setCrosswireSize">
+ <arg type="i" direction="in" />
+</method>
+<method name="getCrosswireSize">
+ <arg type="i" direction="out" />
+</method>
+<method name="setCrosswireLength">
+ <arg type="i" direction="in" />
+</method>
+<method name="getCrosswireLength">
+ <arg type="i" direction="out" />
+</method>
+<method name="setCrosswireClip">
+ <arg type="b" direction="in" />
+</method>
+<method name="getCrosswireClip">
+ <arg type="b" direction="out" />
+</method>
+<method name="setCrosswireColor">
+ <arg type="u" direction="in" />
+</method>
+<method name="getCrosswireColor">
+ <arg type="u" direction="out" />
+</method>
+</interface>;
// Subset of gnome-mag's ZoomRegion dbus interface -- to be expanded. See:
// http://git.gnome.org/browse/gnome-mag/tree/xml/...ZoomRegion.xml
-const ZoomRegionIface = {
- name: ZOOM_SERVICE_NAME,
- methods: [
- { name: 'setMagFactor', inSignature: 'dd', outSignature: ''},
- { name: 'getMagFactor', inSignature: '', outSignature: 'dd' },
- { name: 'setRoi', inSignature: 'ai', outSignature: '' },
- { name: 'getRoi', inSignature: '', outSignature: 'ai' },
- { name: 'shiftContentsTo', inSignature: 'ii', outSignature: 'b' },
- { name: 'moveResize', inSignature: 'ai', outSignature: '' }
- ],
- signals: [],
- properties: []
-};
+const ZoomRegionIface = <interface name={ZOOM_SERVICE_NAME}>
+<method name="setMagFactor">
+ <arg type="d" direction="in" />
+ <arg type="d" direction="in" />
+</method>
+<method name="getMagFactor">
+ <arg type="d" direction="out" />
+ <arg type="d" direction="out" />
+</method>
+<method name="setRoi">
+ <arg type="ai" direction="in" />
+</method>
+<method name="getRoi">
+ <arg type="ai" direction="out" />
+</method>
+<method name="shiftContentsTo">
+ <arg type="i" direction="in" />
+ <arg type="i" direction="in" />
+ <arg type="b" direction="out" />
+</method>
+<method name="moveResize">
+ <arg type="ai" direction="in" />
+</method>
+</interface>;
// For making unique ZoomRegion DBus proxy object paths of the form:
// '/org/gnome/Magnifier/ZoomRegion/zoomer0',
@@ -64,7 +102,9 @@ function CinnamonMagnifier() {
CinnamonMagnifier.prototype = {
_init: function() {
this._zoomers = {};
- DBus.session.exportObject(MAG_SERVICE_PATH, this);
+
+ this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(MagnifierIface, this);
+ this._dbusImpl.export(Gio.DBus.session, MAG_SERVICE_PATH);
},
/**
@@ -195,10 +235,10 @@ CinnamonMagnifier.prototype = {
Main.magnifier.clearAllZoomRegions();
for (let objectPath in this._zoomers) {
let proxyAndZoomer = this._zoomers[objectPath];
+ proxyAndZoomer.proxy.destroy();
proxyAndZoomer.proxy = null;
proxyAndZoomer.zoomRegion = null;
delete this._zoomers[objectPath];
- DBus.session.unexportObject(proxyAndZoomer);
}
this._zoomers = {};
},
@@ -300,8 +340,9 @@ function CinnamonMagnifierZoomRegion(zoomerObjectPath, zoomRegion) {
CinnamonMagnifierZoomRegion.prototype = {
_init: function(zoomerObjectPath, zoomRegion) {
this._zoomRegion = zoomRegion;
- DBus.session.proxifyObject(this, ZOOM_SERVICE_NAME, zoomerObjectPath);
- DBus.session.exportObject(zoomerObjectPath, this);
+
+ this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ZoomRegionIface, this);
+ this._dbusImpl.export(Gio.DBus.session, zoomerObjectPath);
},
/**
@@ -376,8 +417,9 @@ CinnamonMagnifierZoomRegion.prototype = {
moveResize: function(viewPort) {
let viewRect = { x: viewPort[0], y: viewPort[1], width: viewPort[2] - viewPort[0], height: viewPort[3] - viewPort[1] };
this._zoomRegion.setViewPort(viewRect);
+ },
+
+ destroy: function() {
+ this._dbusImpl.unexport();
}
};
-
-DBus.conformExport(CinnamonMagnifier.prototype, MagnifierIface);
-DBus.conformExport(CinnamonMagnifierZoomRegion.prototype, ZoomRegionIface);
diff --git a/js/ui/main.js b/js/ui/main.js
index 5cae372..180db5c 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -1,7 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
-const DBus = imports.dbus;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
@@ -199,11 +198,6 @@ function start() {
cinnamonDBusService = new CinnamonDBus.Cinnamon();
lookingGlassDBusService = new LookingGlassDBus.CinnamonLookingGlass();
- // Force a connection now; dbus.js will do this internally
- // if we use its name acquisition stuff but we aren't right
- // now; to do so we'd need to convert from its async calls
- // back into sync ones.
- DBus.session.flush();
// Ensure CinnamonWindowTracker and CinnamonAppUsage are initialized; this will
// also initialize CinnamonAppSystem first. CinnamonAppSystem
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 18d6615..8bed028 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1388,12 +1388,17 @@ function MessageTray() {
MessageTray.prototype = {
_init: function() {
- this._presence = new GnomeSession.Presence();
+ this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
+ this._onStatusChanged(proxy.status);
+ }));
+
this._userStatus = GnomeSession.PresenceStatus.AVAILABLE;
this._busy = false;
this._backFromAway = false;
- this._presence.connect('StatusChanged', Lang.bind(this, this._onStatusChanged));
- this._presence.getStatus(Lang.bind(this, this._onStatusChanged));
+ this._presence.connectSignal('StatusChanged', Lang.bind(this, function(proxy, senderName, [status]) {
+ this._onStatusChanged(status);
+ }));
+
this._notificationBin = new St.Bin();
this._notificationBin.hide();
@@ -1548,7 +1553,7 @@ MessageTray.prototype = {
this._updateState();
},
- _onStatusChanged: function(presence, status) {
+ _onStatusChanged: function(status) {
this._backFromAway = (this._userStatus == GnomeSession.PresenceStatus.IDLE && this._userStatus != status);
this._userStatus = status;
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index bee8ffd..b037e07 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Cinnamon = imports.gi.Cinnamon;
@@ -14,49 +14,52 @@ const Params = imports.misc.params;
let nextNotificationId = 1;
-// Should really be defined in dbus.js
-const BusIface = {
- name: 'org.freedesktop.DBus',
- methods: [{ name: 'GetConnectionUnixProcessID',
- inSignature: 's',
- outSignature: 'i' }]
-};
-
-const Bus = function () {
- this._init();
-};
-
-Bus.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this, 'org.freedesktop.DBus', '/org/freedesktop/DBus');
- }
-};
+// Should really be defined in Gio.js
+const BusIface = <interface name="org.freedesktop.DBus">
+<method name="GetConnectionUnixProcessID">
+ <arg type="s" direction="in" />
+ <arg type="u" direction="out" />
+</method>
+</interface>;
+
+var BusProxy = Gio.DBusProxy.makeProxyWrapper(BusIface);
+function Bus() {
+ return new BusProxy(Gio.DBus.session, 'org.freedesktop.DBus', '/org/freedesktop/DBus');
+}
-DBus.proxifyPrototype(Bus.prototype, BusIface);
-
-const NotificationDaemonIface = {
- name: 'org.freedesktop.Notifications',
- methods: [{ name: 'Notify',
- inSignature: 'susssasa{sv}i',
- outSignature: 'u'
- },
- { name: 'CloseNotification',
- inSignature: 'u',
- outSignature: ''
- },
- { name: 'GetCapabilities',
- inSignature: '',
- outSignature: 'as'
- },
- { name: 'GetServerInformation',
- inSignature: '',
- outSignature: 'ssss'
- }],
- signals: [{ name: 'NotificationClosed',
- inSignature: 'uu' },
- { name: 'ActionInvoked',
- inSignature: 'us' }]
-};
+const NotificationDaemonIface = <interface name="org.freedesktop.Notifications">
+<method name="Notify">
+ <arg type="s" direction="in"/>
+ <arg type="u" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="as" direction="in"/>
+ <arg type="a{sv}" direction="in"/>
+ <arg type="i" direction="in"/>
+ <arg type="u" direction="out"/>
+</method>
+<method name="CloseNotification">
+ <arg type="u" direction="in"/>
+</method>
+<method name="GetCapabilities">
+ <arg type="as" direction="out"/>
+</method>
+<method name="GetServerInformation">
+ <arg type="s" direction="out"/>
+ <arg type="s" direction="out"/>
+ <arg type="s" direction="out"/>
+ <arg type="s" direction="out"/>
+</method>
+<signal name="NotificationClosed">
+ <arg type="u"/>
+ <arg type="u"/>
+</signal>
+<signal name="ActionInvoked">
+ <arg type="u"/>
+ <arg type="s"/>
+</signal>
+</interface>;
const NotificationClosedReason = {
EXPIRED: 1,
@@ -88,7 +91,8 @@ function NotificationDaemon() {
NotificationDaemon.prototype = {
_init: function() {
- DBus.session.exportObject('/org/freedesktop/Notifications', this);
+ this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(NotificationDaemonIface, this);
+ this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
this._sources = [];
this._senderToPid = {};
@@ -213,8 +217,8 @@ NotificationDaemon.prototype = {
return source;
},
- Notify: function(appName, replacesId, icon, summary, body,
- actions, hints, timeout) {
+ NotifyAsync: function(params, invocation) {
+ let [appName, replacesId, icon, summary, body, actions, hints, timeout] = params;
let id;
let rewrites = rewriteRules[appName];
@@ -257,51 +261,55 @@ NotificationDaemon.prototype = {
}
this._notifications[id] = ndata;
- let sender = DBus.getCurrentMessageContext().sender;
+ let sender = invocation.get_sender();
let pid = this._senderToPid[sender];
let source = this._getSource(appName, pid, ndata, sender, null);
if (source) {
this._notifyForSource(source, ndata);
- return id;
+ return invocation.return_value(GLib.Variant.new('(u)', [id]));
}
if (replacesId) {
// There's already a pending call to GetConnectionUnixProcessID,
// which will see the new notification data when it finishes,
// so we don't have to do anything.
- return id;
+ return invocation.return_value(GLib.Variant.new('(u)', [id]));
}
- this._busProxy.GetConnectionUnixProcessIDRemote(sender, Lang.bind(this,
- function (pid, ex) {
- // The app may have updated or removed the notification
- ndata = this._notifications[id];
- if (!ndata)
- return;
-
- source = this._getSource(appName, pid, ndata, sender, null);
-
- // We only store sender-pid entries for persistent sources.
- // Removing the entries once the source is destroyed
- // would result in the entries associated with transient
- // sources removed once the notification is shown anyway.
- // However, keeping these pairs would mean that we would
- // possibly remove an entry associated with a persistent
- // source when a transient source for the same sender is
- // distroyed.
- if (!source.isTransient) {
- this._senderToPid[sender] = pid;
- source.connect('destroy', Lang.bind(this,
- function() {
- delete this._senderToPid[sender];
- }));
- }
- this._notifyForSource(source, ndata);
- }));
+ this._busProxy.GetConnectionUnixProcessIDRemote(sender, Lang.bind(this, function (result, excp) {
+ // The app may have updated or removed the notification
+ ndata = this._notifications[id];
+ if (!ndata)
+ return;
- return id;
+ if (excp) {
+ logError(excp, 'Call to GetConnectionUnixProcessID failed');
+ return;
+ }
+
+ let [pid] = result;
+ source = this._getSource(appName, pid, ndata, sender);
+
+ // We only store sender-pid entries for persistent sources.
+ // Removing the entries once the source is destroyed
+ // would result in the entries associated with transient
+ // sources removed once the notification is shown anyway.
+ // However, keeping these pairs would mean that we would
+ // possibly remove an entry associated with a persistent
+ // source when a transient source for the same sender is
+ // distroyed.
+ if (!source.isTransient) {
+ this._senderToPid[sender] = pid;
+ source.connect('destroy', Lang.bind(this, function() {
+ delete this._senderToPid[sender];
+ }));
+ }
+ this._notifyForSource(source, ndata);
+ }));
+
+ return invocation.return_value(GLib.Variant.new('(u)', [id]));
},
_notifyForSource: function(source, ndata) {
@@ -441,17 +449,13 @@ NotificationDaemon.prototype = {
},
_emitNotificationClosed: function(id, reason) {
- DBus.session.emit_signal('/org/freedesktop/Notifications',
- 'org.freedesktop.Notifications',
- 'NotificationClosed', 'uu',
- [id, reason]);
+ this._dbusImpl.emit_signal('NotificationClosed',
+ GLib.Variant.new('(uu)', [id, reason]));
},
_emitActionInvoked: function(id, action) {
- DBus.session.emit_signal('/org/freedesktop/Notifications',
- 'org.freedesktop.Notifications',
- 'ActionInvoked', 'us',
- [id, action]);
+ this._dbusImpl.emit_signal('ActionInvoked',
+ GLib.Variant.new('(us)', [id, action]));
},
_onTrayIconAdded: function(o, icon) {
@@ -465,8 +469,6 @@ NotificationDaemon.prototype = {
}
};
-DBus.conformExport(NotificationDaemon.prototype, NotificationDaemonIface);
-
function Source(title, pid, sender, trayIcon) {
this._init(title, pid, sender, trayIcon);
}
@@ -481,15 +483,12 @@ Source.prototype = {
this.pid = pid;
if (sender)
- // TODO: dbus-glib implementation of watch_name() doesn’t return an id to be used for
- // unwatch_name() or implement unwatch_name(), however when we move to using GDBus implementation,
- // we should save the id here and call unwatch_name() with it in destroy().
- // Moving to GDBus is the work in progress: https://bugzilla.gnome.org/show_bug.cgi?id=648651
- // and https://bugzilla.gnome.org/show_bug.cgi?id=622921 .
- DBus.session.watch_name(sender,
- false,
- null,
- Lang.bind(this, this._onNameVanished));
+ this._nameWatcherId = Gio.DBus.session.watch_name(sender,
+ Gio.BusNameWatcherFlags.NONE,
+ null,
+ Lang.bind(this, this._onNameVanished));
+ else
+ this._nameWatcherId = 0;
this._setApp();
if (this.app)
@@ -596,6 +595,10 @@ Source.prototype = {
},
destroy: function() {
+ if (this._nameWatcherId) {
+ Gio.DBus.session.unwatch_name(this._nameWatcherId);
+ this._nameWatcherId = 0;
+ }
MessageTray.Source.prototype.destroy.call(this);
}
};
diff --git a/js/ui/scripting.js b/js/ui/scripting.js
index 42c4f6d..9163d29 100644
--- a/js/ui/scripting.js
+++ b/js/ui/scripting.js
@@ -1,6 +1,5 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const DBus = imports.dbus;
const Gio = imports.gi.Gio;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
@@ -70,24 +69,21 @@ function waitLeisure() {
};
}
-const PerfHelperIface = {
- name: 'org.Cinnamon.PerfHelper',
- methods: [{ name: 'CreateWindow', inSignature: 'iibb', outSignature: '' },
- { name: 'WaitWindows', inSignature: '', outSignature: '' },
- { name: 'DestroyWindows', inSignature: '', outSignature: ''}]
-};
-
-const PerfHelper = function () {
- this._init();
-};
-
-PerfHelper.prototype = {
- _init: function() {
- DBus.session.proxifyObject(this, 'org.Cinnamon.PerfHelper', '/org/Cinnamon/PerfHelper');
- }
-};
-
-DBus.proxifyPrototype(PerfHelper.prototype, PerfHelperIface);
+const PerfHelperIface = <interface name="org.gnome.Shell.PerfHelper">
+<method name="CreateWindow">
+ <arg type="i" direction="in" />
+ <arg type="i" direction="in" />
+ <arg type="b" direction="in" />
+ <arg type="b" direction="in" />
+</method>
+<method name="WaitWindows" />
+<method name="DestroyWindows" />
+</interface>;
+
+var PerfHelperProxy = Gio.DBusProxy.makeProxyWrapper(PerfHelperIface);
+function PerfHelper() {
+ return new PerfHelperProxy(Gio.DBus.session, 'org.gnome.Shell.PerfHelper', '/org/gnome/Shell/PerfHelper');
+}
let _perfHelper = null;
function _getPerfHelper() {
--
1.8.1.6
From d85e078c0ed09a8b9f8d3ea2ebec1043b6d150c1 Mon Sep 17 00:00:00 2001
From: dalcde <dalcde@yahoo.com.hk>
Date: Tue, 16 Apr 2013 16:58:30 +0800
Subject: [PATCH 07/15] [GDBus][Sound/Power Applet] Fix dbus port issues
---
.../cinnamon/applets/power@cinnamon.org/applet.js | 2 +-
.../cinnamon/applets/sound@cinnamon.org/applet.js | 83 ++++++++++------------
2 files changed, 37 insertions(+), 48 deletions(-)
diff --git a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
index b6b2bcd..fad39ab 100644
--- a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
@@ -212,7 +212,7 @@ MyApplet.prototype = {
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Power Settings"), 'power');
- this._smProxy.connect('PropertiesChanged', Lang.bind(this, this._devicesChanged));
+ this._smProxy.connectSignal('PropertiesChanged', Lang.bind(this, this._devicesChanged));
this._devicesChanged();
}
catch (e) {
diff --git a/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
index 5bfaf26..52b8cde 100644
--- a/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
@@ -37,7 +37,7 @@ const MediaServer2PlayerIFace = <interface name="org.mpris.MediaPlayer2.Player">
<property name='Metadata' access='read' type='a{sv}' />
<property name='Shuffle' access='readwrite' type='b' />
<property name='Rate' access='readwrite' type='d' />
-<property name='LoopStatus' access='readwrite' type='b' />
+<property name='LoopStatus' access='readwrite' type='s' />
<property name='Volume' access='readwrite' type='d' />
<property name='PlaybackStatus' access='read' type='s' />
<property name='Position' access='read' type='x' />
@@ -256,23 +256,20 @@ Player.prototype = {
this._trackControls.set_child(this.controls);
this.addActor(this._trackControls);
- this._mediaServer.getRaise(Lang.bind(this, function(sender, raise) {
- if (raise) {
- this._raiseButton = new ControlButton('go-up',
- Lang.bind(this, function () { this._mediaServer.RaiseRemote(); this._system_status_button.menu.actor.hide(); }));
- this._raiseButtonTooltip = new Tooltips.Tooltip(this._raiseButton.button, _("Open Player"));
- this.controls.add_actor(this._raiseButton.getActor());
- }
- }));
-
- this._mediaServer.getQuit(Lang.bind(this, function(sender, quit) {
- if (quit) {
- this._quitButton = new ControlButton('window-close',
- Lang.bind(this, function () { this._mediaServer.QuitRemote(); }));
- this.controls.add_actor(this._quitButton.getActor());
- this._quitButtonTooltip = new Tooltips.Tooltip(this._quitButton.button, _("Quit Player"));
- }
- }));
+ let CanRaise = this._mediaServer.CanRaise;
+ let CanQuit = this._mediaServer.CanQuit;
+ if (CanRaise) {
+ this._raiseButton = new ControlButton('go-up',
+ Lang.bind(this, function () { this._mediaServer.RaiseRemote(); this._system_status_button.menu.actor.hide(); }));
+ this._raiseButtonTooltip = new Tooltips.Tooltip(this._raiseButton.button, _("Open Player"));
+ this.controls.add_actor(this._raiseButton.getActor());
+ }
+ if (CanQuit) {
+ this._quitButton = new ControlButton('window-close',
+ Lang.bind(this, function () { this._mediaServer.QuitRemote(); }));
+ this.controls.add_actor(this._quitButton.getActor());
+ this._quitButtonTooltip = new Tooltips.Tooltip(this._quitButton.button, _("Quit Player"));
+ }
/* this players don't support seek */
if (support_seek.indexOf(this._name) == -1)
@@ -283,14 +280,14 @@ Player.prototype = {
this._currentTime = 0;
this._getPosition();
- this._prop.connect('PropertiesChanged', Lang.bind(this, function(sender, iface, value) {
+ this._prop.connectSignal('PropertiesChanged', Lang.bind(this, function(sender, iface, value) {
if (value["PlaybackStatus"])
- this._setStatus(iface, value["PlaybackStatus"]);
+ this._setStatus(value["PlaybackStatus"]);
if (value["Metadata"])
- this._setMetadata(iface, value["Metadata"]);
+ this._setMetadata(value["Metadata"]);
}));
- this._mediaServerPlayer.connect('Seeked', Lang.bind(this, function(sender, value) {
+ this._mediaServerPlayer.connectSignal('Seeked', Lang.bind(this, function(sender, iface, [value]) {
this._setPosition(sender, value);
}));
@@ -315,19 +312,17 @@ Player.prototype = {
},
_getPosition: function() {
- this._mediaServerPlayer.getPosition(Lang.bind(this,
- this._setPosition
- ));
+ this._setPosition(this._mediaServerPlayer.Position);
Mainloop.timeout_add(1000, Lang.bind(this, this._getPosition));
},
- _setMetadata: function(sender, metadata) {
+ _setMetadata: function(metadata) {
if (metadata["mpris:length"]) {
// song length in secs
- this._songLength = metadata["mpris:length"] / 1000000;
+ this._songLength = metadata["mpris:length"].unpack() / 1000000;
// FIXME upstream
if (this._name == "quodlibet")
- this._songLength = metadata["mpris:length"] / 1000;
+ this._songLength = metadata["mpris:length"].unpack() / 1000;
// reset timer
this._stopTimer();
if (this._playerStatus == "Playing")
@@ -338,15 +333,15 @@ Player.prototype = {
this._stopTimer();
}
if (metadata["xesam:artist"])
- this._artist.setLabel(metadata["xesam:artist"].toString());
+ this._artist.setLabel(metadata["xesam:artist"].unpack());
else
this._artist.setLabel(_("Unknown Artist"));
if (metadata["xesam:album"])
- this._album.setLabel(metadata["xesam:album"].toString());
+ this._album.setLabel(metadata["xesam:album"].unpack());
else
this._album.setLabel(_("Unknown Album"));
if (metadata["xesam:title"])
- this._title.setLabel(metadata["xesam:title"].toString());
+ this._title.setLabel(metadata["xesam:title"].unpack());
else
this._title.setLabel(_("Unknown Title"));
/*if (metadata["mpris:trackid"]) {
@@ -359,8 +354,8 @@ Player.prototype = {
let change = false;
if (metadata["mpris:artUrl"]) {
- if (this._trackCoverFile != metadata["mpris:artUrl"].toString()) {
- this._trackCoverFile = metadata["mpris:artUrl"].toString();
+ if (this._trackCoverFile != metadata["mpris:artUrl"].unpack()) {
+ this._trackCoverFile = metadata["mpris:artUrl"].unpack();
change = true;
}
}
@@ -392,12 +387,10 @@ Player.prototype = {
},
_getMetadata: function() {
- this._mediaServerPlayer.getMetadata(Lang.bind(this,
- this._setMetadata
- ));
+ this._setMetadata(this._mediaServerPlayer.Metadata);
},
- _setStatus: function(sender, status) {
+ _setStatus: function(status) {
this._playerStatus = status;
if (status == "Playing") {
this._playButton.setIcon("media-playback-pause");
@@ -416,15 +409,11 @@ Player.prototype = {
},
_getStatus: function() {
- this._mediaServerPlayer.getPlaybackStatus(Lang.bind(this,
- this._setStatus
- ));
+ this._setStatus(this._mediaServerPlayer.PlaybackStatus);
},
_updateRate: function() {
- this._mediaServerPlayer.getRate(Lang.bind(this, function(sender, rate) {
- this._rate = rate;
- }));
+ this._rate = this._mediaServerPlayer.Rate;
},
_updateTimer: function() {
@@ -569,7 +558,7 @@ MyApplet.prototype = {
this._players = {};
// watch players
for (var p=0; p<compatible_players.length; p++) {
- Gio.DBus.session.watch_name('org.mpris.MediaPlayer2.'+compatible_players[p], false,
+ Gio.DBus.session.watch_name('org.mpris.MediaPlayer2.'+compatible_players[p], Gio.BusNameWatcherFlags.NONE,
Lang.bind(this, this._addPlayer),
Lang.bind(this, this._removePlayer)
);
@@ -700,7 +689,7 @@ MyApplet.prototype = {
return Object.keys(this._players).length;
},
- _addPlayer: function(owner) {
+ _addPlayer: function(connection, owner) {
// ensure menu is empty
this._cleanup();
this._volumeControlShown = false;
@@ -715,12 +704,12 @@ MyApplet.prototype = {
this._readOutput();
},
- _removePlayer: function(owner) {
+ _removePlayer: function(connection, owner) {
delete this._players[owner];
this._cleanup();
this._volumeControlShown = false;
for (owner in this._players) {
- this._addPlayer(owner);
+ this._addPlayer(connection, owner);
}
this.menu.emit('players-loaded', true);
--
1.8.1.6
From 02da490ff9d33b050e7a10171b5795aee67d1645 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Fri, 19 Apr 2013 19:09:18 -0400
Subject: [PATCH 08/15] Fix gicon error - power applet
---
files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
index fad39ab..3a13eab 100644
--- a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
@@ -323,7 +323,7 @@ MyApplet.prototype = {
let icon = this._proxy.Icon;
if (icon) {
let gicon = Gio.icon_new_for_string(icon);
- this.setGIcon(gicon);
+ this._applet_icon.gicon = gicon
this.actor.show();
} else {
this.menu.close();
--
1.8.1.6
From 3d78b5c929e7e3b0ee24d4b537492740e7bebf2f Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Fri, 19 Apr 2013 19:44:33 -0400
Subject: [PATCH 09/15] Remove unused
---
src/cinnamon-background-manager.c | 34 ----------------------------------
1 file changed, 34 deletions(-)
diff --git a/src/cinnamon-background-manager.c b/src/cinnamon-background-manager.c
index 9d95250..67427ed 100644
--- a/src/cinnamon-background-manager.c
+++ b/src/cinnamon-background-manager.c
@@ -66,8 +66,6 @@ struct CinnamonBackgroundManagerPrivate
G_DEFINE_TYPE (CinnamonBackgroundManager, cinnamon_background_manager, G_TYPE_OBJECT)
-static gpointer manager_object = NULL;
-
static gboolean
dont_draw_background (CinnamonBackgroundManager *manager)
{
@@ -223,36 +221,6 @@ struct CinnamonBackgroundManagerPrivate
}
static void
-draw_background_after_session_loads (CinnamonBackgroundManager *manager)
-{
- GError *error = NULL;
- GDBusProxyFlags flags;
-
- flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
- manager->priv->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- flags,
- NULL, /* GDBusInterfaceInfo */
- "org.gnome.SessionManager",
- "/org/gnome/SessionManager",
- "org.gnome.SessionManager",
- NULL, /* GCancellable */
- &error);
- if (manager->priv->proxy == NULL) {
- g_warning ("Could not listen to session manager: %s",
- error->message);
- g_error_free (error);
- return;
- }
-
- manager->priv->proxy_signal_id = g_signal_connect (manager->priv->proxy,
- "g-signal",
- G_CALLBACK (on_session_manager_signal),
- manager);
-}
-
-
-static void
disconnect_screen_signals (CinnamonBackgroundManager *manager)
{
GdkDisplay *display;
@@ -312,8 +280,6 @@ struct CinnamonBackgroundManagerPrivate
G_CALLBACK (draw_background_changed), manager);
setup_bg_and_draw_background (manager);
- //draw_background_after_session_loads (manager);
-
return TRUE;
}
--
1.8.1.6
From d08b882470b135591fb99bd9ff7c63619fcaea82 Mon Sep 17 00:00:00 2001
From: dalcde <dalcde@yahoo.com.hk>
Date: Sat, 20 Apr 2013 15:42:13 +0800
Subject: [PATCH 10/15] [GDBus][Power applet] Some fixes and cleanup
---
.../cinnamon/applets/power@cinnamon.org/applet.js | 52 ++++++----------------
1 file changed, 14 insertions(+), 38 deletions(-)
diff --git a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
index 3a13eab..5f81d91 100644
--- a/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
+++ b/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
@@ -48,40 +48,11 @@ const PowerManagerInterface = <interface name="org.gnome.SettingsDaemon.Power">
<method name="GetPrimaryDevice">
<arg type="(susdut)" direction="out"/>
</method>
-<signal name="PropertiesChanged">
- <arg type="s"/>
- <arg type="a{sv}"/>
- <arg type="a[s]"/>
-</signal>
<property name="Icon" type="s" access="read" />
</interface>;
const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface);
-const SettingsManagerInterface = <interface name="org.freedesktop.DBus.Properties">
-<method name="Get">
- <arg type="s" direction="in"/>
- <arg type="s" direction="in"/>
- <arg type="v" direction="out"/>
-</method>
-<method name="GetAll">
- <arg type="s" direction="in"/>
- <arg type="a{sv}" direction="out"/>
-</method>
-<method name="Set">
- <arg type="s" direction="in"/>
- <arg type="s" direction="in"/>
- <arg type="v" direction="in"/>
-</method>
-<signal name="PropertiesChanged">
- <arg type="s"/>
- <arg type="a{sv}"/>
- <arg type="a[s]"/>
-</signal>
-</interface>;
-
-const SettingsManagerProxy = Gio.DBusProxy.makeProxyWrapper(SettingsManagerInterface);
-
function DeviceItem() {
this._init.apply(this, arguments);
}
@@ -156,8 +127,16 @@ MyApplet.prototype = {
this.menuManager.addMenu(this.menu);
//this.set_applet_icon_symbolic_name('battery-missing');
- this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
- this._smProxy = new SettingsManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
+ this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
+ Lang.bind(this, function(proxy, error) {
+ if (error) {
+ global.log(error.message);
+
+ return;
+ }
+ this._proxy.connect('g-properties-changed', Lang.bind(this, this._devicesChanged));
+ this._devicesChanged();
+ }));
let icon = this.actor.get_children()[0];
this.actor.remove_actor(icon);
@@ -211,9 +190,6 @@ MyApplet.prototype = {
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Power Settings"), 'power');
-
- this._smProxy.connectSignal('PropertiesChanged', Lang.bind(this, this._devicesChanged));
- this._devicesChanged();
}
catch (e) {
global.logError(e);
@@ -245,14 +221,14 @@ MyApplet.prototype = {
},
_readPrimaryDevice: function() {
- this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(device, error) {
+ this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(result, error) {
if (error) {
this._hasPrimary = false;
this._primaryDeviceId = null;
this._batteryItem.actor.hide();
return;
}
- let [device_id, device_type, icon, percentage, state, seconds] = device;
+ let [[device_id, device_type, icon, percentage, state, seconds]] = result;
if (device_type == UPDeviceType.BATTERY) {
this._hasPrimary = true;
let time = Math.round(seconds / 60);
@@ -290,7 +266,7 @@ MyApplet.prototype = {
},
_readOtherDevices: function() {
- this._proxy.GetDevicesRemote(Lang.bind(this, function(devices, error) {
+ this._proxy.GetDevicesRemote(Lang.bind(this, function([devices], error) {
this._deviceItems.forEach(function(i) { i.destroy(); });
this._deviceItems = [];
@@ -336,7 +312,7 @@ MyApplet.prototype = {
},
_updateLabel: function() {
- this._proxy.GetDevicesRemote(Lang.bind(this, function(devices, error) {
+ this._proxy.GetDevicesRemote(Lang.bind(this, function([devices], error) {
if (error) {
this._mainLabel.set_text("");
return;
--
1.8.1.6
From c93e9746b321ad6d0aa38ec28c15fe7b3f18f8f7 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Sat, 20 Apr 2013 10:59:54 -0400
Subject: [PATCH 11/15] Move CLUTTER_DISABLE_XINPUT to session startup file
---
files/usr/bin/gnome-session-cinnamon | 2 +-
src/main.c | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/files/usr/bin/gnome-session-cinnamon b/files/usr/bin/gnome-session-cinnamon
index 315f135..56c37f5 100755
--- a/files/usr/bin/gnome-session-cinnamon
+++ b/files/usr/bin/gnome-session-cinnamon
@@ -1,3 +1,3 @@
#! /bin/sh
-exec gnome-session --session cinnamon "$@"
+exec CLUTTER_DISABLE_XINPUT=1 gnome-session --session cinnamon "$@"
diff --git a/src/main.c b/src/main.c
index 9d37975..418fb60 100644
--- a/src/main.c
+++ b/src/main.c
@@ -257,9 +257,6 @@
g_option_context_free (ctx);
- /* Disable XInput extension - required for 3.8 compatibility */
- g_setenv ("CLUTTER_DISABLE_XINPUT", "1", TRUE);
-
meta_plugin_type_register (gnome_cinnamon_plugin_get_type ());
/* Prevent meta_init() from causing gtk to load gail and at-bridge */
--
1.8.1.6
From de1719e63518884cad6c9d63d508f737eab35d49 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Sat, 20 Apr 2013 12:23:29 -0400
Subject: [PATCH 12/15] Add Xinput disable to cinnamon2d
---
files/usr/bin/cinnamon2d | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/files/usr/bin/cinnamon2d b/files/usr/bin/cinnamon2d
index 1eced99..7f42517 100755
--- a/files/usr/bin/cinnamon2d
+++ b/files/usr/bin/cinnamon2d
@@ -1,2 +1,2 @@
#!/bin/bash
-CLUTTER_PAINT=disable-clipped-redraws:disable-culling LIBGL_ALWAYS_SOFTWARE=1 CINNAMON_SOFTWARE_RENDERING=1 CINNAMON_SLOWDOWN_FACTOR=0.0001 MUFFIN_NO_SHADOWS=1 CLUTTER_DEFAULT_FPS=15 cinnamon $@
+CLUTTER_DISABLE_XINPUT=1 CLUTTER_PAINT=disable-clipped-redraws:disable-culling LIBGL_ALWAYS_SOFTWARE=1 CINNAMON_SOFTWARE_RENDERING=1 CINNAMON_SLOWDOWN_FACTOR=0.0001 MUFFIN_NO_SHADOWS=1 CLUTTER_DEFAULT_FPS=15 cinnamon $@
--
1.8.1.6
From 15d57d1c15f34d44b23f74b21929d996d4465afb Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Sat, 20 Apr 2013 12:29:43 -0400
Subject: [PATCH 13/15] Fix session file
---
files/usr/bin/gnome-session-cinnamon | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/files/usr/bin/gnome-session-cinnamon b/files/usr/bin/gnome-session-cinnamon
index 56c37f5..31c9eff 100755
--- a/files/usr/bin/gnome-session-cinnamon
+++ b/files/usr/bin/gnome-session-cinnamon
@@ -1,3 +1,3 @@
#! /bin/sh
-exec CLUTTER_DISABLE_XINPUT=1 gnome-session --session cinnamon "$@"
+CLUTTER_DISABLE_XINPUT=1 exec gnome-session --session cinnamon "$@"
--
1.8.1.6
From 03436393c322fd97d8216c3481d28cd34833c656 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Sat, 20 Apr 2013 12:36:45 -0400
Subject: [PATCH 14/15] Add cinnamon3d command
---
files/usr/bin/cinnamon3d | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 files/usr/bin/cinnamon3d
diff --git a/files/usr/bin/cinnamon3d b/files/usr/bin/cinnamon3d
new file mode 100644
index 0000000..4891783
--- /dev/null
+++ b/files/usr/bin/cinnamon3d
@@ -0,0 +1,2 @@
+#!/bin/bash
+CLUTTER_DISABLE_XINPUT=1 cinnamon $@
--
1.8.1.6
From 850da270967622b95be9e0c5edd8e230eb4be5a1 Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Sat, 20 Apr 2013 12:37:26 -0400
Subject: [PATCH 15/15] Fix perms
---
files/usr/bin/cinnamon3d | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 files/usr/bin/cinnamon3d
diff --git a/files/usr/bin/cinnamon3d b/files/usr/bin/cinnamon3d
old mode 100644
new mode 100755
--
1.8.1.6
|