New upstream version 3.8.0
Fabio Fantoni
6 years ago
0 | version: 2.0 | |
1 | ||
2 | shared: &shared | |
3 | ||
4 | steps: | |
5 | ||
6 | - checkout | |
7 | ||
8 | - run: | |
9 | name: Prepare environment | |
10 | command: apt-get update | |
11 | ||
12 | - run: | |
13 | name: Install dependencies | |
14 | command: | | |
15 | wget https://github.com/linuxmint/cinnamon-desktop/releases/download/master.${CIRCLE_JOB}/packages.tar.gz -O cinnamon-desktop.tar.gz | |
16 | ls *.tar.gz | xargs -i tar zxvf {} | |
17 | apt install --yes --allow-downgrades ./packages/*.deb | |
18 | rm -rf packages | |
19 | ||
20 | - run: | |
21 | name: Build project | |
22 | command: mint-build -i | |
23 | ||
24 | - run: | |
25 | name: Prepare packages | |
26 | command: | | |
27 | if [ -z $CI_PULL_REQUEST ]; then | |
28 | mkdir /packages | |
29 | mv /root/*.deb /packages/ | |
30 | git log > /packages/git.log | |
31 | cd / | |
32 | tar zcvf packages.tar.gz packages | |
33 | fi | |
34 | ||
35 | - run: | |
36 | name: Deploy packages to Github | |
37 | command: | | |
38 | if [ -z $CI_PULL_REQUEST ]; then | |
39 | wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip | |
40 | apt-get install --yes unzip | |
41 | unzip ghr_v0.5.4_linux_amd64.zip | |
42 | TAG="master".$CIRCLE_JOB | |
43 | ./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -replace $TAG /packages.tar.gz | |
44 | ./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -recreate -b "Latest unstable packages" $TAG /packages.tar.gz | |
45 | fi | |
46 | ||
47 | jobs: | |
48 | "mint18": | |
49 | <<: *shared | |
50 | docker: | |
51 | - image: linuxmintd/mint18-amd64 | |
52 | ||
53 | "mint19": | |
54 | <<: *shared | |
55 | docker: | |
56 | - image: linuxmintd/mint19-amd64 | |
57 | ||
58 | "lmde3": | |
59 | <<: *shared | |
60 | docker: | |
61 | - image: linuxmintd/lmde3-amd64 | |
62 | ||
63 | workflows: | |
64 | version: 2 | |
65 | build: | |
66 | jobs: | |
67 | - "mint18" | |
68 | - "mint19" | |
69 | - "lmde3" |
0 | TODO: | |
1 | ||
2 | - Remove custom keybinding code (we handle that in Cinnamon now) - do we want to handle media keys in cinnamon also? Would get around the 'no meda keys while a menu is open' issue. | |
3 | - Switch to Gnome's keyboard layout (gsettings) handler - basically reverting Ubuntu's patch for this. This will allow us to implement ibus popups directly in Cinnamon | |
4 | - Look into backgrounds - we should be able to eliminate the background manager in the cinnamon gnome 3.8 compat rollup, and continue to handle backgrounds as we currently do | |
5 | - Investigate: How to keep gnome-settings-daemon from autostarting. It checks for environment=GNOME... which means Cinnamon also - is it time to have our own freedesktop.org name? | |
6 | ||
7 | -- Update on this: Setting session name to Cinnamon works - then add to main.c in cinnamon, to set XDG_CURRENT_DESKTOP=GNOME makes sure apps keep showing up | |
8 | ||
9 | - Multiple backgrounds on multiple monitors | |
10 | ||
11 | - /etc/acpi/powerbtn.sh - add cinnamon-settings-daemon to script - how? postinst? |
0 | cinnamon-settings-daemon is a collection of plugins. | |
1 | ||
2 | These plugins are started by cinnamon-session when you log in. | |
3 | ||
4 | The plugins run in the background, each with their own process. | |
5 | ||
6 | Plugins: | |
7 | ======== | |
8 | ||
9 | Here's a description of each plugin. | |
10 | ||
11 | a11y-keyboard | |
12 | ------------- | |
13 | ||
14 | a11y-settings | |
15 | ------------- | |
16 | ||
17 | automount | |
18 | --------- | |
19 | ||
20 | background | |
21 | ---------- | |
22 | ||
23 | clipboard | |
24 | --------- | |
25 | ||
26 | Xorg features two ways of copying and pasting content. The first one is ``X-clipboard``, which is commonly used in edit menus and using ``Ctrl+C`` and ``Ctrl+V``. The second one is ``X-selection`` which is used by selecting content with the mouse and pasting it with a middle-click. | |
27 | ||
28 | When you copy content from a window, that content is available either in ``X-clipboard`` or ``X-selection`` until the application which owns that window is terminated. | |
29 | ||
30 | This plugin keeps the content of ``X-clipboard`` in memory, so that even if the owner application exits the content continues to be available. | |
31 | ||
32 | color | |
33 | ----- | |
34 | ||
35 | common | |
36 | ------ | |
37 | ||
38 | cursor | |
39 | ------ | |
40 | ||
41 | datetime | |
42 | -------- | |
43 | ||
44 | dummy | |
45 | ----- | |
46 | ||
47 | This is a dummy plugin. It doesn't do anything. | |
48 | ||
49 | housekeeping | |
50 | ------------ | |
51 | ||
52 | **thumbnail cache** | |
53 | ||
54 | The thumbnail cache is cleaned up according to the settings stored in ``org.cinnamon.desktop.thumbnail-cache``. | |
55 | ||
56 | This is done 2 minutes after login and then once a day. | |
57 | ||
58 | **low disk space** | |
59 | ||
60 | Every minute, the plugin checks the mounted volume to see if they have low disk space, according to the settings stored in ``org.cinnamon.settings-daemon.plugins.housekeeping``. | |
61 | ||
62 | The plugin shows a notification when a volume is full. | |
63 | ||
64 | keyboard | |
65 | -------- | |
66 | ||
67 | This plugin handles the keyboard. | |
68 | ||
69 | **keyboard settings** | |
70 | ||
71 | It reads and listens to the ``org.cinnamon.settings-daemon.peripherals.keyboard`` settings and applies the configuration. | |
72 | ||
73 | **numlock state** | |
74 | ||
75 | It also listens to the state of the numlock key and saves it in the settings to ensure the state is remembered and preserved for the next session. | |
76 | ||
77 | **keyboard layout** | |
78 | ||
79 | The layout selection is done in cinnamon-control-center's region plugin (which is presented to the user in cinnamon-settings' keyboard module). That configuration is set directly via gkbd (libgnomekbd) and xkl (libxklavier). This plugin reads and listens to that configuration and assigns to the keyboard. | |
80 | ||
81 | **hotplug command** | |
82 | ||
83 | Although it isn't configured by default or used by cinnamon-settings, when a keyboard is plugged in, or removed, the plugin executes the command specified in ``org.cinnamon.settings-daemon.peripherals.input-devices hotplug-command`` with a series of argument to specify the event type, the device etc.. | |
84 | ||
85 | An example script which can be used for such a command is available in ``plugins/common/input-device-example.sh``. | |
86 | ||
87 | media-keys | |
88 | ---------- | |
89 | ||
90 | mouse | |
91 | ----- | |
92 | ||
93 | This plugin handles mice and touchpads. | |
94 | ||
95 | It reads and listens to the ``org.cinnamon.settings-daemon.peripherals.mouse`` and ``org.cinnamon.settings-daemon.peripherals.touchpad`` settings and applies the configuration in X11. | |
96 | ||
97 | This plugin supports synaptics and libinput devices. | |
98 | ||
99 | orientation | |
100 | ----------- | |
101 | ||
102 | power | |
103 | ----- | |
104 | ||
105 | print-notifications | |
106 | ------------------- | |
107 | ||
108 | This plugin shows printer notifications. | |
109 | ||
110 | On DBUS, it listens to events on ``org.cups.cupsd.Notifier``. | |
111 | ||
112 | Libnotify is used to show the notifications. | |
113 | ||
114 | screensaver-proxy | |
115 | ----------------- | |
116 | ||
117 | smartcard | |
118 | --------- | |
119 | ||
120 | sound | |
121 | ----- | |
122 | ||
123 | This plugin is use to play sound files or theme sounds via PulseAudio. | |
124 | ||
125 | It's available via dbus at ``org.cinnamon.SettingsDaemon.Sound``. | |
126 | ||
127 | Its configuration is ``org.cinnamon.desktop.sound``. | |
128 | ||
129 | wacom | |
130 | ----- | |
131 | ||
132 | This plugin handles wacom tablets. | |
133 | ||
134 | It reads and listens to the ``org.cinnamon.settings-daemon.peripherals.wacom`` and applies the configuration in X11. | |
135 | ||
136 | xrandr | |
137 | ------ | |
138 | ||
139 | xsettings | |
140 | --------- | |
141 | ||
142 | This plugin sets the settings for GTK and Xft. | |
143 | ||
144 | TESTING | |
145 | ======= | |
146 | ||
147 | To test a plugin: | |
148 | ||
149 | 1. Kill the running CSD plugin | |
150 | 2. Build the project | |
151 | 3. Run the built plugin in verbose mode | |
152 | ||
153 | For instance: | |
154 | ||
155 | * ``killall csd-sound`` (you might have to kill it twice, if CSM tries to restart it) | |
156 | * ``dpkg-buildpackage`` | |
157 | * ``plugins/sound/csd-sound --verbose`` | |
158 | ||
159 | ||
160 | TODO: | |
161 | ===== | |
162 | ||
163 | - Remove custom keybinding code (we handle that in Cinnamon now) - do we want to handle media keys in cinnamon also? Would get around the 'no meda keys while a menu is open' issue. | |
164 | - Switch to Gnome's keyboard layout (gsettings) handler - basically reverting Ubuntu's patch for this. This will allow us to implement ibus popups directly in Cinnamon | |
165 | - Look into backgrounds - we should be able to eliminate the background manager in the cinnamon gnome 3.8 compat rollup, and continue to handle backgrounds as we currently do | |
166 | - Investigate: How to keep gnome-settings-daemon from autostarting. It checks for environment=GNOME... which means Cinnamon also - is it time to have our own freedesktop.org name? | |
167 | ||
168 | -- Update on this: Setting session name to Cinnamon works - then add to main.c in cinnamon, to set XDG_CURRENT_DESKTOP=GNOME makes sure apps keep showing up | |
169 | ||
170 | - Multiple backgrounds on multiple monitors | |
171 | ||
172 | - /etc/acpi/powerbtn.sh - add cinnamon-settings-daemon to script - how? postinst? | |
173 |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2017-10-23 13:57+0100\n" | |
10 | "POT-Creation-Date: 2018-04-17 13:13+0100\n" | |
11 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
41 | 41 | |
42 | 42 | #: plugins/a11y-keyboard/csd-a11y-keyboard-manager.c:521 |
43 | 43 | #: plugins/a11y-keyboard/csd-a11y-keyboard-manager.c:656 |
44 | #: plugins/mouse/csd-mouse-manager.c:1333 | |
45 | 44 | msgid "Universal Access" |
46 | 45 | msgstr "" |
47 | 46 | |
401 | 400 | msgid "Region and Language Settings" |
402 | 401 | msgstr "" |
403 | 402 | |
404 | #: plugins/mouse/csd-mouse-manager.c:1329 | |
405 | msgid "Could not enable mouse accessibility features" | |
406 | msgstr "" | |
407 | ||
408 | #: plugins/mouse/csd-mouse-manager.c:1331 | |
409 | msgid "" | |
410 | "Mouse accessibility requires Mousetweaks to be installed on your system." | |
411 | msgstr "" | |
412 | ||
413 | #: plugins/power/csd-power-manager.c:1149 | |
403 | #: plugins/power/csd-power-manager.c:1150 | |
414 | 404 | msgid "UPS Discharging" |
415 | 405 | msgstr "" |
416 | 406 | |
417 | #: plugins/power/csd-power-manager.c:1154 | |
407 | #: plugins/power/csd-power-manager.c:1155 | |
418 | 408 | #, c-format |
419 | 409 | msgid "%s of UPS backup power remaining" |
420 | 410 | msgstr "" |
421 | 411 | |
422 | #: plugins/power/csd-power-manager.c:1175 | |
423 | #: plugins/power/csd-power-manager.c:1395 | |
424 | #: plugins/power/csd-power-manager.c:1575 | |
425 | #: plugins/power/csd-power-manager.c:1724 | |
412 | #: plugins/power/csd-power-manager.c:1176 | |
413 | #: plugins/power/csd-power-manager.c:1396 | |
414 | #: plugins/power/csd-power-manager.c:1576 | |
415 | #: plugins/power/csd-power-manager.c:1725 | |
426 | 416 | msgid "Power" |
427 | 417 | msgstr "" |
428 | 418 | |
429 | #: plugins/power/csd-power-manager.c:1307 | |
419 | #: plugins/power/csd-power-manager.c:1308 | |
430 | 420 | msgid "Battery low" |
431 | 421 | msgstr "" |
432 | 422 | |
433 | #: plugins/power/csd-power-manager.c:1310 | |
423 | #: plugins/power/csd-power-manager.c:1311 | |
434 | 424 | msgid "Laptop battery low" |
435 | 425 | msgstr "" |
436 | 426 | |
437 | #: plugins/power/csd-power-manager.c:1317 | |
427 | #: plugins/power/csd-power-manager.c:1318 | |
438 | 428 | #, c-format |
439 | 429 | msgid "Approximately %s remaining (%.0f%%)" |
440 | 430 | msgstr "" |
441 | 431 | |
442 | #: plugins/power/csd-power-manager.c:1322 | |
432 | #: plugins/power/csd-power-manager.c:1323 | |
443 | 433 | msgid "UPS low" |
444 | 434 | msgstr "" |
445 | 435 | |
446 | #: plugins/power/csd-power-manager.c:1328 | |
436 | #: plugins/power/csd-power-manager.c:1329 | |
447 | 437 | #, c-format |
448 | 438 | msgid "Approximately %s of remaining UPS backup power (%.0f%%)" |
449 | 439 | msgstr "" |
450 | 440 | |
451 | #: plugins/power/csd-power-manager.c:1333 | |
452 | #: plugins/power/csd-power-manager.c:1498 | |
441 | #: plugins/power/csd-power-manager.c:1334 | |
442 | #: plugins/power/csd-power-manager.c:1499 | |
453 | 443 | msgid "Mouse battery low" |
454 | 444 | msgstr "" |
455 | 445 | |
456 | #: plugins/power/csd-power-manager.c:1336 | |
446 | #: plugins/power/csd-power-manager.c:1337 | |
457 | 447 | #, c-format |
458 | 448 | msgid "Wireless mouse is low in power (%.0f%%)" |
459 | 449 | msgstr "" |
460 | 450 | |
461 | #: plugins/power/csd-power-manager.c:1340 | |
462 | #: plugins/power/csd-power-manager.c:1506 | |
451 | #: plugins/power/csd-power-manager.c:1341 | |
452 | #: plugins/power/csd-power-manager.c:1507 | |
463 | 453 | msgid "Keyboard battery low" |
464 | 454 | msgstr "" |
465 | 455 | |
466 | #: plugins/power/csd-power-manager.c:1343 | |
456 | #: plugins/power/csd-power-manager.c:1344 | |
467 | 457 | #, c-format |
468 | 458 | msgid "Wireless keyboard is low in power (%.0f%%)" |
469 | 459 | msgstr "" |
470 | 460 | |
471 | #: plugins/power/csd-power-manager.c:1347 | |
472 | #: plugins/power/csd-power-manager.c:1515 | |
461 | #: plugins/power/csd-power-manager.c:1348 | |
462 | #: plugins/power/csd-power-manager.c:1516 | |
473 | 463 | msgid "PDA battery low" |
474 | 464 | msgstr "" |
475 | 465 | |
476 | #: plugins/power/csd-power-manager.c:1350 | |
466 | #: plugins/power/csd-power-manager.c:1351 | |
477 | 467 | #, c-format |
478 | 468 | msgid "PDA is low in power (%.0f%%)" |
479 | 469 | msgstr "" |
480 | 470 | |
481 | #: plugins/power/csd-power-manager.c:1354 | |
482 | #: plugins/power/csd-power-manager.c:1525 | |
483 | #: plugins/power/csd-power-manager.c:1535 | |
471 | #: plugins/power/csd-power-manager.c:1355 | |
472 | #: plugins/power/csd-power-manager.c:1526 | |
473 | #: plugins/power/csd-power-manager.c:1536 | |
484 | 474 | msgid "Cell phone battery low" |
485 | 475 | msgstr "" |
486 | 476 | |
487 | #: plugins/power/csd-power-manager.c:1357 | |
477 | #: plugins/power/csd-power-manager.c:1358 | |
488 | 478 | #, c-format |
489 | 479 | msgid "Cell phone is low in power (%.0f%%)" |
490 | 480 | msgstr "" |
491 | 481 | |
492 | #: plugins/power/csd-power-manager.c:1361 | |
482 | #: plugins/power/csd-power-manager.c:1362 | |
493 | 483 | msgid "Media player battery low" |
494 | 484 | msgstr "" |
495 | 485 | |
496 | #: plugins/power/csd-power-manager.c:1364 | |
486 | #: plugins/power/csd-power-manager.c:1365 | |
497 | 487 | #, c-format |
498 | 488 | msgid "Media player is low in power (%.0f%%)" |
499 | 489 | msgstr "" |
500 | 490 | |
501 | #: plugins/power/csd-power-manager.c:1368 | |
502 | #: plugins/power/csd-power-manager.c:1544 | |
491 | #: plugins/power/csd-power-manager.c:1369 | |
492 | #: plugins/power/csd-power-manager.c:1545 | |
503 | 493 | msgid "Tablet battery low" |
504 | 494 | msgstr "" |
505 | 495 | |
506 | #: plugins/power/csd-power-manager.c:1371 | |
496 | #: plugins/power/csd-power-manager.c:1372 | |
507 | 497 | #, c-format |
508 | 498 | msgid "Tablet is low in power (%.0f%%)" |
509 | 499 | msgstr "" |
510 | 500 | |
511 | #: plugins/power/csd-power-manager.c:1375 | |
512 | #: plugins/power/csd-power-manager.c:1553 | |
501 | #: plugins/power/csd-power-manager.c:1376 | |
502 | #: plugins/power/csd-power-manager.c:1554 | |
513 | 503 | msgid "Attached computer battery low" |
514 | 504 | msgstr "" |
515 | 505 | |
516 | #: plugins/power/csd-power-manager.c:1378 | |
506 | #: plugins/power/csd-power-manager.c:1379 | |
517 | 507 | #, c-format |
518 | 508 | msgid "Attached computer is low in power (%.0f%%)" |
519 | 509 | msgstr "" |
520 | 510 | |
521 | #: plugins/power/csd-power-manager.c:1412 | |
511 | #: plugins/power/csd-power-manager.c:1413 | |
522 | 512 | msgid "Battery is low" |
523 | 513 | msgstr "" |
524 | 514 | |
525 | #: plugins/power/csd-power-manager.c:1454 | |
515 | #: plugins/power/csd-power-manager.c:1455 | |
526 | 516 | msgid "Battery critically low" |
527 | 517 | msgstr "" |
528 | 518 | |
529 | #: plugins/power/csd-power-manager.c:1457 | |
530 | #: plugins/power/csd-power-manager.c:1640 | |
519 | #: plugins/power/csd-power-manager.c:1458 | |
520 | #: plugins/power/csd-power-manager.c:1641 | |
531 | 521 | msgid "Laptop battery critically low" |
532 | 522 | msgstr "" |
533 | 523 | |
534 | #: plugins/power/csd-power-manager.c:1466 | |
524 | #: plugins/power/csd-power-manager.c:1467 | |
535 | 525 | msgid "Plug in your AC adapter to avoid losing data." |
536 | 526 | msgstr "" |
537 | 527 | |
538 | #: plugins/power/csd-power-manager.c:1470 | |
528 | #: plugins/power/csd-power-manager.c:1471 | |
539 | 529 | msgid "Computer will suspend very soon unless it is plugged in." |
540 | 530 | msgstr "" |
541 | 531 | |
542 | #: plugins/power/csd-power-manager.c:1474 | |
532 | #: plugins/power/csd-power-manager.c:1475 | |
543 | 533 | msgid "Computer will hibernate very soon unless it is plugged in." |
544 | 534 | msgstr "" |
545 | 535 | |
546 | #: plugins/power/csd-power-manager.c:1478 | |
536 | #: plugins/power/csd-power-manager.c:1479 | |
547 | 537 | msgid "Computer will shutdown very soon unless it is plugged in." |
548 | 538 | msgstr "" |
549 | 539 | |
550 | #: plugins/power/csd-power-manager.c:1486 | |
551 | #: plugins/power/csd-power-manager.c:1676 | |
540 | #: plugins/power/csd-power-manager.c:1487 | |
541 | #: plugins/power/csd-power-manager.c:1677 | |
552 | 542 | msgid "UPS critically low" |
553 | 543 | msgstr "" |
554 | 544 | |
555 | #: plugins/power/csd-power-manager.c:1492 | |
545 | #: plugins/power/csd-power-manager.c:1493 | |
556 | 546 | #, c-format |
557 | 547 | msgid "" |
558 | 548 | "Approximately %s of remaining UPS power (%.0f%%). Restore AC power to your " |
559 | 549 | "computer to avoid losing data." |
560 | 550 | msgstr "" |
561 | 551 | |
562 | #: plugins/power/csd-power-manager.c:1501 | |
552 | #: plugins/power/csd-power-manager.c:1502 | |
563 | 553 | #, c-format |
564 | 554 | msgid "" |
565 | 555 | "Wireless mouse is very low in power (%.0f%%). This device will soon stop " |
566 | 556 | "functioning if not charged." |
567 | 557 | msgstr "" |
568 | 558 | |
569 | #: plugins/power/csd-power-manager.c:1509 | |
559 | #: plugins/power/csd-power-manager.c:1510 | |
570 | 560 | #, c-format |
571 | 561 | msgid "" |
572 | 562 | "Wireless keyboard is very low in power (%.0f%%). This device will soon stop " |
573 | 563 | "functioning if not charged." |
574 | 564 | msgstr "" |
575 | 565 | |
576 | #: plugins/power/csd-power-manager.c:1518 | |
566 | #: plugins/power/csd-power-manager.c:1519 | |
577 | 567 | #, c-format |
578 | 568 | msgid "" |
579 | 569 | "PDA is very low in power (%.0f%%). This device will soon stop functioning if " |
580 | 570 | "not charged." |
581 | 571 | msgstr "" |
582 | 572 | |
583 | #: plugins/power/csd-power-manager.c:1528 | |
573 | #: plugins/power/csd-power-manager.c:1529 | |
584 | 574 | #, c-format |
585 | 575 | msgid "" |
586 | 576 | "Cell phone is very low in power (%.0f%%). This device will soon stop " |
587 | 577 | "functioning if not charged." |
588 | 578 | msgstr "" |
589 | 579 | |
590 | #: plugins/power/csd-power-manager.c:1538 | |
580 | #: plugins/power/csd-power-manager.c:1539 | |
591 | 581 | #, c-format |
592 | 582 | msgid "" |
593 | 583 | "Media player is very low in power (%.0f%%). This device will soon stop " |
594 | 584 | "functioning if not charged." |
595 | 585 | msgstr "" |
596 | 586 | |
597 | #: plugins/power/csd-power-manager.c:1547 | |
587 | #: plugins/power/csd-power-manager.c:1548 | |
598 | 588 | #, c-format |
599 | 589 | msgid "" |
600 | 590 | "Tablet is very low in power (%.0f%%). This device will soon stop functioning " |
601 | 591 | "if not charged." |
602 | 592 | msgstr "" |
603 | 593 | |
604 | #: plugins/power/csd-power-manager.c:1556 | |
594 | #: plugins/power/csd-power-manager.c:1557 | |
605 | 595 | #, c-format |
606 | 596 | msgid "" |
607 | 597 | "Attached computer is very low in power (%.0f%%). The device will soon " |
608 | 598 | "shutdown if not charged." |
609 | 599 | msgstr "" |
610 | 600 | |
611 | #: plugins/power/csd-power-manager.c:1593 | |
612 | #: plugins/power/csd-power-manager.c:1603 | |
613 | #: plugins/power/csd-power-manager.c:1739 | |
601 | #: plugins/power/csd-power-manager.c:1594 | |
602 | #: plugins/power/csd-power-manager.c:1604 | |
603 | #: plugins/power/csd-power-manager.c:1740 | |
614 | 604 | msgid "Battery is critically low" |
615 | 605 | msgstr "" |
616 | 606 | |
617 | #: plugins/power/csd-power-manager.c:1648 | |
607 | #: plugins/power/csd-power-manager.c:1649 | |
618 | 608 | msgid "" |
619 | 609 | "The battery is below the critical level and this computer will <b>power-off</" |
620 | 610 | "b> when the battery becomes completely empty." |
621 | 611 | msgstr "" |
622 | 612 | |
623 | #: plugins/power/csd-power-manager.c:1654 | |
613 | #: plugins/power/csd-power-manager.c:1655 | |
624 | 614 | msgid "" |
625 | 615 | "The battery is below the critical level and this computer is about to " |
626 | 616 | "suspend.\n" |
628 | 618 | "suspended state." |
629 | 619 | msgstr "" |
630 | 620 | |
631 | #: plugins/power/csd-power-manager.c:1661 | |
621 | #: plugins/power/csd-power-manager.c:1662 | |
632 | 622 | msgid "" |
633 | 623 | "The battery is below the critical level and this computer is about to " |
634 | 624 | "hibernate." |
635 | 625 | msgstr "" |
636 | 626 | |
637 | #: plugins/power/csd-power-manager.c:1666 | |
627 | #: plugins/power/csd-power-manager.c:1667 | |
638 | 628 | msgid "" |
639 | 629 | "The battery is below the critical level and this computer is about to " |
640 | 630 | "shutdown." |
641 | 631 | msgstr "" |
642 | 632 | |
643 | #: plugins/power/csd-power-manager.c:1684 | |
633 | #: plugins/power/csd-power-manager.c:1685 | |
644 | 634 | msgid "" |
645 | 635 | "UPS is below the critical level and this computer will <b>power-off</b> when " |
646 | 636 | "the UPS becomes completely empty." |
647 | 637 | msgstr "" |
648 | 638 | |
649 | #: plugins/power/csd-power-manager.c:1690 | |
639 | #: plugins/power/csd-power-manager.c:1691 | |
650 | 640 | msgid "" |
651 | 641 | "UPS is below the critical level and this computer is about to hibernate." |
652 | 642 | msgstr "" |
653 | 643 | |
654 | #: plugins/power/csd-power-manager.c:1695 | |
644 | #: plugins/power/csd-power-manager.c:1696 | |
655 | 645 | msgid "UPS is below the critical level and this computer is about to shutdown." |
656 | 646 | msgstr "" |
657 | 647 | |
658 | #: plugins/power/csd-power-manager.c:2260 | |
648 | #: plugins/power/csd-power-manager.c:2261 | |
659 | 649 | msgid "Lid has been opened" |
660 | 650 | msgstr "" |
661 | 651 | |
662 | #: plugins/power/csd-power-manager.c:2420 | |
652 | #: plugins/power/csd-power-manager.c:2421 | |
663 | 653 | msgid "Lid has been closed" |
664 | 654 | msgstr "" |
665 | 655 | |
666 | #: plugins/power/csd-power-manager.c:4227 | |
656 | #: plugins/power/csd-power-manager.c:4201 | |
667 | 657 | msgid "Power Manager" |
668 | 658 | msgstr "" |
669 | 659 |
0 | 0 | AC_PREREQ([2.60]) |
1 | 1 | |
2 | 2 | AC_INIT([cinnamon-settings-daemon], |
3 | [3.6.2], | |
3 | [3.8.0], | |
4 | 4 | [https://github.com/linuxmint/cinnamon-settings-daemon/issues]) |
5 | 5 | |
6 | 6 | AC_CONFIG_MACRO_DIR([m4]) |
182 | 182 | dnl --------------------------------------------------------------------------- |
183 | 183 | |
184 | 184 | PKG_CHECK_MODULES(BACKGROUND, x11 cinnamon-desktop >= $CINNAMON_DESKTOP_REQUIRED_VERSION) |
185 | AC_SEARCH_LIBS(gnome_bg_set_accountsservice_background, cinnamon-desktop, AC_DEFINE([ACCOUNTSERVICE_BG],1, [Build with accountsservice background support])) | |
186 | 185 | |
187 | 186 | dnl --------------------------------------------------------------------------- |
188 | 187 | dnl - mouse |
145 | 145 | This can be useful for working around systems with broken default backlight control behavior which provide |
146 | 146 | multiple interfaces. If you are having problems, try setting 'raw' to a higher priority.</_description> |
147 | 147 | </key> |
148 | <key name="inhibit-lid-switch" type="b"> | |
149 | <default>true</default> | |
150 | <_summary>Whether or not cinnamon-settings-daemon inhibits logind's handling of lid switch</_summary> | |
151 | <_description>This setting should be true in all distributions and for all users. Only set it to false, if you want to prevent Cinnamon from handling lid switch events. In this case, you should not rely on Cinnamon's lid actions and use the logind ones instead.</_description> | |
152 | </key> | |
148 | 153 | </schema> |
149 | 154 | </schemalist> |
134 | 134 | { |
135 | 135 | gnome_bg_load_from_preferences (manager->priv->bg, |
136 | 136 | manager->priv->settings); |
137 | #if ACCOUNTSERVICE_BG | |
138 | gnome_bg_set_accountsservice_background(gnome_bg_get_filename(manager->priv->bg)); | |
139 | #endif | |
137 | ||
138 | gnome_bg_set_accountsservice_background (gnome_bg_get_filename (manager->priv->bg)); | |
139 | ||
140 | 140 | return FALSE; |
141 | 141 | } |
142 | 142 | |
185 | 185 | watch_bg_preferences (manager); |
186 | 186 | gnome_bg_load_from_preferences (manager->priv->bg, |
187 | 187 | manager->priv->settings); |
188 | ||
189 | gnome_bg_set_accountsservice_background (gnome_bg_get_filename (manager->priv->bg)); | |
188 | 190 | } |
189 | 191 | |
190 | 192 | static void |
179 | 179 | gdk_error_trap_pop_ignored (); |
180 | 180 | } |
181 | 181 | |
182 | static int | |
182 | static gsize | |
183 | 183 | clipboard_bytes_per_item (int format) |
184 | 184 | { |
185 | 185 | switch (format) { |
190 | 190 | } |
191 | 191 | |
192 | 192 | return 0; |
193 | } | |
194 | ||
195 | static void | |
196 | free_contents (CsdClipboardManager *manager) | |
197 | { | |
198 | list_foreach (manager->priv->contents, (Callback)target_data_unref, NULL); | |
199 | list_free (manager->priv->contents); | |
200 | manager->priv->contents = NULL; | |
193 | 201 | } |
194 | 202 | |
195 | 203 | static void |
365 | 373 | unsigned long length; |
366 | 374 | unsigned long items; |
367 | 375 | unsigned char *data; |
376 | gsize bytes_per_item; | |
368 | 377 | |
369 | 378 | list = list_find (manager->priv->conversions, |
370 | 379 | (ListFindFunc) find_conversion_requestor, xev); |
373 | 382 | |
374 | 383 | rdata = (IncrConversion *) list->data; |
375 | 384 | |
385 | bytes_per_item = clipboard_bytes_per_item (rdata->data->format); | |
386 | if (bytes_per_item == 0) | |
387 | return False; | |
388 | ||
376 | 389 | data = rdata->data->data + rdata->offset; |
377 | 390 | length = rdata->data->length - rdata->offset; |
378 | 391 | if (length > SELECTION_MAX_SIZE) |
380 | 393 | |
381 | 394 | rdata->offset += length; |
382 | 395 | |
383 | items = length / clipboard_bytes_per_item (rdata->data->format); | |
396 | items = length / bytes_per_item; | |
384 | 397 | XChangeProperty (manager->priv->display, rdata->requestor, |
385 | 398 | rdata->property, rdata->data->type, |
386 | 399 | rdata->data->format, PropModeAppend, |
519 | 532 | (unsigned char *) targets, n_targets); |
520 | 533 | free (targets); |
521 | 534 | } else { |
535 | gsize bytes_per_item; | |
536 | ||
522 | 537 | /* Convert from stored CLIPBOARD data */ |
523 | 538 | list = list_find (manager->priv->contents, |
524 | 539 | (ListFindFunc) find_content_target, (void *) rdata->target); |
534 | 549 | return; |
535 | 550 | } |
536 | 551 | |
552 | bytes_per_item = clipboard_bytes_per_item (tdata->format); | |
553 | if (bytes_per_item == 0) | |
554 | return; | |
555 | ||
537 | 556 | rdata->data = target_data_ref (tdata); |
538 | items = tdata->length / clipboard_bytes_per_item (tdata->format); | |
557 | items = tdata->length / bytes_per_item; | |
539 | 558 | if (tdata->length <= SELECTION_MAX_SIZE) |
540 | 559 | XChangeProperty (manager->priv->display, rdata->requestor, |
541 | 560 | rdata->property, |
680 | 699 | switch (xev->xany.type) { |
681 | 700 | case DestroyNotify: |
682 | 701 | if (xev->xdestroywindow.window == manager->priv->requestor) { |
683 | list_foreach (manager->priv->contents, (Callback)target_data_unref, NULL); | |
684 | list_free (manager->priv->contents); | |
685 | manager->priv->contents = NULL; | |
702 | free_contents (manager); | |
686 | 703 | |
687 | 704 | clipboard_manager_watch_cb (manager, |
688 | 705 | manager->priv->requestor, |
706 | 723 | if (xev->xselectionclear.selection == XA_CLIPBOARD_MANAGER) { |
707 | 724 | /* We lost the manager selection */ |
708 | 725 | if (manager->priv->contents) { |
709 | list_foreach (manager->priv->contents, (Callback)target_data_unref, NULL); | |
710 | list_free (manager->priv->contents); | |
711 | manager->priv->contents = NULL; | |
726 | free_contents(manager); | |
712 | 727 | |
713 | 728 | XSetSelectionOwner (manager->priv->display, |
714 | 729 | XA_CLIPBOARD, |
719 | 734 | } |
720 | 735 | if (xev->xselectionclear.selection == XA_CLIPBOARD) { |
721 | 736 | /* We lost the clipboard selection */ |
722 | list_foreach (manager->priv->contents, (Callback)target_data_unref, NULL); | |
723 | list_free (manager->priv->contents); | |
724 | manager->priv->contents = NULL; | |
737 | free_contents(manager); | |
725 | 738 | clipboard_manager_watch_cb (manager, |
726 | 739 | manager->priv->requestor, |
727 | 740 | False, |
780 | 793 | } |
781 | 794 | else if (xev->xselection.property == None) { |
782 | 795 | send_selection_notify (manager, False); |
796 | free_contents (manager); | |
783 | 797 | clipboard_manager_watch_cb (manager, |
784 | 798 | manager->priv->requestor, |
785 | 799 | False, |
970 | 984 | } |
971 | 985 | |
972 | 986 | if (manager->priv->contents != NULL) { |
973 | list_foreach (manager->priv->contents, (Callback) target_data_unref, NULL); | |
974 | list_free (manager->priv->contents); | |
975 | manager->priv->contents = NULL; | |
976 | } | |
977 | } | |
978 | ||
979 | static GObject * | |
980 | csd_clipboard_manager_constructor (GType type, | |
981 | guint n_construct_properties, | |
982 | GObjectConstructParam *construct_properties) | |
983 | { | |
984 | CsdClipboardManager *clipboard_manager; | |
985 | ||
986 | clipboard_manager = CSD_CLIPBOARD_MANAGER (G_OBJECT_CLASS (csd_clipboard_manager_parent_class)->constructor (type, | |
987 | n_construct_properties, | |
988 | construct_properties)); | |
989 | ||
990 | return G_OBJECT (clipboard_manager); | |
987 | free_contents (manager); | |
988 | } | |
991 | 989 | } |
992 | 990 | |
993 | 991 | static void |
995 | 993 | { |
996 | 994 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
997 | 995 | |
998 | object_class->constructor = csd_clipboard_manager_constructor; | |
999 | 996 | object_class->finalize = csd_clipboard_manager_finalize; |
1000 | 997 | |
1001 | 998 | g_type_class_add_private (klass, sizeof (CsdClipboardManagerPrivate)); |
1021 | 1018 | clipboard_manager = CSD_CLIPBOARD_MANAGER (object); |
1022 | 1019 | |
1023 | 1020 | g_return_if_fail (clipboard_manager->priv != NULL); |
1021 | ||
1022 | csd_clipboard_manager_stop(clipboard_manager); | |
1024 | 1023 | |
1025 | 1024 | if (clipboard_manager->priv->start_idle_id !=0) { |
1026 | 1025 | g_source_remove (clipboard_manager->priv->start_idle_id); |
168 | 168 | !IN_RANGE(key->keysym, FKEYS_RANGE_MIN, FKEYS_RANGE_MAX) && |
169 | 169 | key->keysym != GDK_KEY_Pause && |
170 | 170 | key->keysym != GDK_KEY_Print && |
171 | key->keysym != GDK_KEY_Scroll_Lock && | |
172 | key->keysym != GDK_KEY_Break && | |
171 | 173 | key->keysym != GDK_KEY_Menu) { |
172 | 174 | GString *keycodes; |
173 | 175 |
444 | 444 | /* enough free space, nothing to do */ |
445 | 445 | if (free_space > free_percent_notify) |
446 | 446 | return TRUE; |
447 | ||
447 | ||
448 | 448 | if (((gint64) mount->buf.f_frsize * (gint64) mount->buf.f_bavail) > ((gint64) free_size_gb_no_notify * GIGABYTE)) |
449 | 449 | return TRUE; |
450 | 450 | |
477 | 477 | return TRUE; |
478 | 478 | else |
479 | 479 | return FALSE; |
480 | } | |
480 | } | |
481 | 481 | |
482 | 482 | |
483 | 483 | static void |
599 | 599 | continue; |
600 | 600 | } |
601 | 601 | |
602 | if (ldsm_mount_is_user_ignore (g_unix_mount_get_mount_path (mount))) { | |
602 | if (ldsm_mount_is_user_ignore (path)) { | |
603 | 603 | ldsm_free_mount_info (mount_info); |
604 | 604 | continue; |
605 | 605 | } |
728 | 728 | |
729 | 729 | if (ignore_paths != NULL) { |
730 | 730 | g_slist_foreach (ignore_paths, (GFunc) g_free, NULL); |
731 | g_slist_free (ignore_paths); | |
732 | ignore_paths = NULL; | |
731 | g_clear_pointer (&ignore_paths, g_slist_free); | |
733 | 732 | } |
734 | 733 | |
735 | 734 | settings_list = g_settings_get_strv (settings, SETTINGS_IGNORE_PATHS); |
736 | 735 | if (settings_list != NULL) { |
737 | gint i; | |
738 | ||
739 | for (i = 0; i < G_N_ELEMENTS (settings_list); i++) { | |
740 | if (settings_list[i] != NULL) | |
741 | ignore_paths = g_slist_append (ignore_paths, g_strdup (settings_list[i])); | |
742 | } | |
736 | guint i; | |
737 | ||
738 | for (i = 0; settings_list[i] != NULL; i++) | |
739 | ignore_paths = g_slist_prepend (ignore_paths, | |
740 | g_strdup (settings_list[i])); | |
743 | 741 | |
744 | 742 | /* Make sure we don't leave stale entries in ldsm_notified_hash */ |
745 | 743 | g_hash_table_foreach_remove (ldsm_notified_hash, |
774 | 772 | g_signal_connect (G_OBJECT (settings), "changed", |
775 | 773 | G_CALLBACK (csd_ldsm_update_config), NULL); |
776 | 774 | |
777 | ldsm_monitor = g_unix_mount_monitor_new (); | |
778 | g_unix_mount_monitor_set_rate_limit (ldsm_monitor, 1000); | |
775 | ldsm_monitor = g_unix_mount_monitor_get (); | |
779 | 776 | g_signal_connect (ldsm_monitor, "mounts-changed", |
780 | 777 | G_CALLBACK (ldsm_mounts_changed), NULL); |
781 | 778 | |
792 | 789 | if (ldsm_timeout_id) { |
793 | 790 | g_source_remove (ldsm_timeout_id); |
794 | 791 | ldsm_timeout_id = 0; |
795 | } | |
796 | ||
797 | if (ldsm_notified_hash) | |
798 | g_hash_table_destroy (ldsm_notified_hash); | |
799 | ldsm_notified_hash = NULL; | |
800 | ||
801 | if (ldsm_monitor) | |
802 | g_object_unref (ldsm_monitor); | |
803 | ldsm_monitor = NULL; | |
804 | ||
805 | if (settings != NULL) { | |
806 | g_object_unref (settings); | |
807 | } | |
808 | ||
809 | if (dialog) { | |
810 | gtk_widget_destroy (GTK_WIDGET (dialog)); | |
811 | dialog = NULL; | |
812 | } | |
813 | ||
814 | if (notification != NULL) { | |
815 | notify_notification_close (notification, NULL); | |
816 | notification = NULL; | |
817 | } | |
818 | ||
819 | if (ignore_paths) { | |
820 | g_slist_foreach (ignore_paths, (GFunc) g_free, NULL); | |
821 | g_slist_free (ignore_paths); | |
822 | } | |
823 | } | |
824 | ||
792 | } | |
793 | ||
794 | g_clear_pointer (&ldsm_notified_hash, g_hash_table_destroy); | |
795 | g_clear_object (&ldsm_monitor); | |
796 | g_clear_object (&settings); | |
797 | g_clear_object (&dialog); | |
798 | g_clear_pointer (¬ification, notify_notification_close); | |
799 | g_slist_free_full (ignore_paths, g_free); | |
800 | ignore_paths = NULL; | |
801 | } | |
802 |
321 | 321 | do_cleanup (manager); |
322 | 322 | } |
323 | 323 | |
324 | g_object_unref (p->settings); | |
325 | p->settings = NULL; | |
324 | g_clear_object (&p->settings); | |
326 | 325 | } |
327 | 326 | |
328 | 327 | csd_ldsm_clean (); |
57 | 57 | csd_ldsm_dialog_get_checkbutton_text (CsdLdsmDialog *dialog) |
58 | 58 | { |
59 | 59 | g_return_val_if_fail (CSD_IS_LDSM_DIALOG (dialog), NULL); |
60 | ||
60 | ||
61 | 61 | if (dialog->priv->other_partitions) |
62 | 62 | return _("Don't show any warnings again for this file system"); |
63 | 63 | else |
68 | 68 | csd_ldsm_dialog_get_primary_text (CsdLdsmDialog *dialog) |
69 | 69 | { |
70 | 70 | gchar *primary_text, *free_space; |
71 | ||
71 | ||
72 | 72 | g_return_val_if_fail (CSD_IS_LDSM_DIALOG (dialog), NULL); |
73 | ||
73 | ||
74 | 74 | free_space = g_format_size (dialog->priv->space_remaining); |
75 | ||
75 | ||
76 | 76 | if (dialog->priv->other_partitions) { |
77 | 77 | primary_text = g_strdup_printf (_("The volume \"%s\" has only %s disk space remaining."), |
78 | 78 | dialog->priv->partition_name, free_space); |
80 | 80 | primary_text = g_strdup_printf (_("This computer has only %s disk space remaining."), |
81 | 81 | free_space); |
82 | 82 | } |
83 | ||
83 | ||
84 | 84 | g_free (free_space); |
85 | ||
86 | return primary_text; | |
85 | ||
86 | return primary_text; | |
87 | 87 | } |
88 | 88 | |
89 | 89 | static const gchar* |
90 | 90 | csd_ldsm_dialog_get_secondary_text (CsdLdsmDialog *dialog) |
91 | 91 | { |
92 | 92 | g_return_val_if_fail (CSD_IS_LDSM_DIALOG (dialog), NULL); |
93 | ||
93 | ||
94 | 94 | if (dialog->priv->other_usable_partitions) { |
95 | 95 | if (dialog->priv->has_trash) { |
96 | 96 | return _("You can free up disk space by emptying the Trash, removing " \ |
124 | 124 | { |
125 | 125 | GSList *found; |
126 | 126 | gchar *path_to_remove; |
127 | ||
127 | ||
128 | 128 | found = g_slist_find_custom (*ignore_paths, mount_path, (GCompareFunc) ignore_path_compare); |
129 | ||
129 | ||
130 | 130 | if (ignore && (found == NULL)) { |
131 | 131 | *ignore_paths = g_slist_prepend (*ignore_paths, g_strdup (mount_path)); |
132 | 132 | return TRUE; |
133 | 133 | } |
134 | ||
134 | ||
135 | 135 | if (!ignore && (found != NULL)) { |
136 | 136 | path_to_remove = found->data; |
137 | 137 | *ignore_paths = g_slist_remove (*ignore_paths, path_to_remove); |
138 | 138 | g_free (path_to_remove); |
139 | 139 | return TRUE; |
140 | 140 | } |
141 | ||
141 | ||
142 | 142 | return FALSE; |
143 | 143 | } |
144 | 144 | |
192 | 192 | { |
193 | 193 | GtkWidget *main_vbox, *text_vbox, *hbox; |
194 | 194 | GtkWidget *image; |
195 | ||
195 | ||
196 | 196 | dialog->priv = CSD_LDSM_DIALOG_GET_PRIVATE (dialog); |
197 | ||
197 | ||
198 | 198 | main_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); |
199 | 199 | |
200 | 200 | /* Set up all the window stuff here */ |
201 | 201 | gtk_window_set_title (GTK_WINDOW (dialog), _("Low Disk Space")); |
202 | gtk_window_set_icon_name (GTK_WINDOW (dialog), | |
203 | GTK_STOCK_DIALOG_WARNING); | |
202 | gtk_window_set_icon_name (GTK_WINDOW (dialog), | |
203 | "dialog-warning"); | |
204 | 204 | gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); |
205 | 205 | gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); |
206 | 206 | gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE); |
208 | 208 | gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); |
209 | 209 | |
210 | 210 | /* Create the image */ |
211 | image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); | |
211 | image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG); | |
212 | 212 | gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); |
213 | 213 | |
214 | 214 | /* Create the labels */ |
215 | dialog->priv->primary_label = gtk_label_new (NULL); | |
215 | dialog->priv->primary_label = gtk_label_new (NULL); | |
216 | 216 | gtk_label_set_line_wrap (GTK_LABEL (dialog->priv->primary_label), TRUE); |
217 | 217 | gtk_label_set_single_line_mode (GTK_LABEL (dialog->priv->primary_label), FALSE); |
218 | 218 | gtk_misc_set_alignment (GTK_MISC (dialog->priv->primary_label), 0.0, 0.0); |
219 | ||
219 | ||
220 | 220 | dialog->priv->secondary_label = gtk_label_new (NULL); |
221 | 221 | gtk_label_set_line_wrap (GTK_LABEL (dialog->priv->secondary_label), TRUE); |
222 | 222 | gtk_label_set_single_line_mode (GTK_LABEL (dialog->priv->secondary_label), FALSE); |
231 | 231 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->ignore_check_button), FALSE); |
232 | 232 | g_signal_connect (dialog->priv->ignore_check_button, "toggled", |
233 | 233 | G_CALLBACK (ignore_check_button_toggled_cb), dialog); |
234 | ||
234 | ||
235 | 235 | /* Now set up the dialog's GtkBox's' */ |
236 | 236 | gtk_box_set_spacing (GTK_BOX (main_vbox), 14); |
237 | ||
238 | hbox = gtk_hbox_new (FALSE, 12); | |
237 | ||
238 | hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); | |
239 | 239 | gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); |
240 | ||
241 | text_vbox = gtk_vbox_new (FALSE, 12); | |
242 | ||
240 | ||
241 | text_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); | |
242 | ||
243 | 243 | gtk_box_pack_start (GTK_BOX (text_vbox), dialog->priv->primary_label, FALSE, FALSE, 0); |
244 | 244 | gtk_box_pack_start (GTK_BOX (text_vbox), dialog->priv->secondary_label, TRUE, TRUE, 0); |
245 | 245 | gtk_box_pack_start (GTK_BOX (text_vbox), dialog->priv->ignore_check_button, FALSE, FALSE, 0); |
246 | 246 | gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); |
247 | gtk_box_pack_start (GTK_BOX (hbox), text_vbox, TRUE, TRUE, 0); | |
247 | gtk_box_pack_start (GTK_BOX (hbox), text_vbox, TRUE, TRUE, 0); | |
248 | 248 | gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); |
249 | ||
249 | ||
250 | 250 | /* Set up the action area */ |
251 | 251 | gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 6); |
252 | 252 | gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 5); |
253 | ||
253 | ||
254 | 254 | gtk_widget_show_all (hbox); |
255 | 255 | } |
256 | 256 | |
258 | 258 | csd_ldsm_dialog_finalize (GObject *object) |
259 | 259 | { |
260 | 260 | CsdLdsmDialog *self; |
261 | ||
261 | ||
262 | 262 | g_return_if_fail (object != NULL); |
263 | 263 | g_return_if_fail (CSD_IS_LDSM_DIALOG (object)); |
264 | 264 | |
265 | 265 | self = CSD_LDSM_DIALOG (object); |
266 | ||
266 | ||
267 | 267 | if (self->priv->partition_name) |
268 | 268 | g_free (self->priv->partition_name); |
269 | ||
269 | ||
270 | 270 | if (self->priv->mount_path) |
271 | 271 | g_free (self->priv->mount_path); |
272 | ||
272 | ||
273 | 273 | G_OBJECT_CLASS (csd_ldsm_dialog_parent_class)->finalize (object); |
274 | 274 | } |
275 | 275 | |
277 | 277 | csd_ldsm_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
278 | 278 | { |
279 | 279 | CsdLdsmDialog *self; |
280 | ||
280 | ||
281 | 281 | g_return_if_fail (CSD_IS_LDSM_DIALOG (object)); |
282 | ||
282 | ||
283 | 283 | self = CSD_LDSM_DIALOG (object); |
284 | 284 | |
285 | 285 | switch (prop_id) |
312 | 312 | csd_ldsm_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
313 | 313 | { |
314 | 314 | CsdLdsmDialog *self; |
315 | ||
315 | ||
316 | 316 | g_return_if_fail (CSD_IS_LDSM_DIALOG (object)); |
317 | ||
317 | ||
318 | 318 | self = CSD_LDSM_DIALOG (object); |
319 | 319 | |
320 | 320 | switch (prop_id) |
375 | 375 | "Set to TRUE if the partition has files in it's trash folder that can be deleted", |
376 | 376 | FALSE, |
377 | 377 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
378 | ||
378 | ||
379 | 379 | g_object_class_install_property (object_class, |
380 | 380 | PROP_SPACE_REMAINING, |
381 | 381 | g_param_spec_int64 ("space-remaining", |
383 | 383 | "Specify how much space is remaining in bytes", |
384 | 384 | G_MININT64, G_MAXINT64, 0, |
385 | 385 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
386 | ||
386 | ||
387 | 387 | g_object_class_install_property (object_class, |
388 | 388 | PROP_PARTITION_NAME, |
389 | 389 | g_param_spec_string ("partition-name", |
391 | 391 | "Specify the name of the partition", |
392 | 392 | "Unknown", |
393 | 393 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
394 | ||
394 | ||
395 | 395 | g_object_class_install_property (object_class, |
396 | 396 | PROP_MOUNT_PATH, |
397 | 397 | g_param_spec_string ("mount-path", |
417 | 417 | GtkWidget *empty_trash_image, *analyze_image, *ignore_image; |
418 | 418 | gchar *primary_text, *primary_text_markup; |
419 | 419 | const gchar *secondary_text, *checkbutton_text; |
420 | ||
420 | ||
421 | 421 | dialog = CSD_LDSM_DIALOG (g_object_new (CSD_TYPE_LDSM_DIALOG, |
422 | 422 | "other-usable-partitions", other_usable_partitions, |
423 | 423 | "other-partitions", other_partitions, |
426 | 426 | "partition-name", partition_name, |
427 | 427 | "mount-path", mount_path, |
428 | 428 | NULL)); |
429 | ||
429 | ||
430 | 430 | /* Add some buttons */ |
431 | 431 | if (dialog->priv->has_trash) { |
432 | 432 | button_empty_trash = gtk_dialog_add_button (GTK_DIALOG (dialog), |
433 | 433 | _("Empty Trash"), |
434 | 434 | CSD_LDSM_DIALOG_RESPONSE_EMPTY_TRASH); |
435 | empty_trash_image = gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON); | |
435 | empty_trash_image = gtk_image_new_from_icon_name ("edit-clear", GTK_ICON_SIZE_BUTTON); | |
436 | 436 | gtk_button_set_image (GTK_BUTTON (button_empty_trash), empty_trash_image); |
437 | 437 | } |
438 | ||
438 | ||
439 | 439 | if (display_baobab) { |
440 | 440 | button_analyze = gtk_dialog_add_button (GTK_DIALOG (dialog), |
441 | 441 | _("Examine..."), |
443 | 443 | analyze_image = gtk_image_new_from_icon_name ("baobab", GTK_ICON_SIZE_BUTTON); |
444 | 444 | gtk_button_set_image (GTK_BUTTON (button_analyze), analyze_image); |
445 | 445 | } |
446 | ||
447 | button_ignore = gtk_dialog_add_button (GTK_DIALOG (dialog), | |
448 | _("Ignore"), | |
446 | ||
447 | button_ignore = gtk_dialog_add_button (GTK_DIALOG (dialog), | |
448 | _("Ignore"), | |
449 | 449 | GTK_RESPONSE_CANCEL); |
450 | 450 | ignore_image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON); |
451 | 451 | gtk_button_set_image (GTK_BUTTON (button_ignore), ignore_image); |
452 | ||
452 | ||
453 | 453 | gtk_widget_grab_default (button_ignore); |
454 | ||
455 | /* Set the label text */ | |
454 | ||
455 | /* Set the label text */ | |
456 | 456 | primary_text = csd_ldsm_dialog_get_primary_text (dialog); |
457 | 457 | primary_text_markup = g_markup_printf_escaped ("<big><b>%s</b></big>", primary_text); |
458 | 458 | gtk_label_set_markup (GTK_LABEL (dialog->priv->primary_label), primary_text_markup); |
459 | 459 | |
460 | 460 | secondary_text = csd_ldsm_dialog_get_secondary_text (dialog); |
461 | 461 | gtk_label_set_text (GTK_LABEL (dialog->priv->secondary_label), secondary_text); |
462 | ||
462 | ||
463 | 463 | checkbutton_text = csd_ldsm_dialog_get_checkbutton_text (dialog); |
464 | 464 | gtk_button_set_label (GTK_BUTTON (dialog->priv->ignore_check_button), checkbutton_text); |
465 | ||
465 | ||
466 | 466 | g_free (primary_text); |
467 | 467 | g_free (primary_text_markup); |
468 | ||
468 | ||
469 | 469 | return dialog; |
470 | } | |
470 | } |
115 | 115 | #define HIGH_CONTRAST "HighContrast" |
116 | 116 | |
117 | 117 | #define VOLUME_STEP 5 /* percents for one volume button press */ |
118 | #define MAX_VOLUME 65536.0 | |
119 | 118 | |
120 | 119 | #define LOGIND_DBUS_NAME "org.freedesktop.login1" |
121 | 120 | #define LOGIND_DBUS_PATH "/org/freedesktop/login1" |
692 | 691 | } |
693 | 692 | |
694 | 693 | static void |
695 | update_dialog (CsdMediaKeysManager *manager, | |
694 | show_sound_osd (CsdMediaKeysManager *manager, | |
696 | 695 | GvcMixerStream *stream, |
697 | 696 | gboolean is_mic, |
698 | 697 | gint vol, |
698 | gint max_vol, | |
699 | 699 | gboolean muted, |
700 | 700 | gboolean sound_changed, |
701 | 701 | gboolean quiet) |
702 | 702 | { |
703 | 703 | const char *icon; |
704 | vol = CLAMP (vol, 0, 100); | |
704 | vol = CLAMP (vol, 0, max_vol); | |
705 | 705 | icon = get_icon_name_for_volume (muted, vol, is_mic); |
706 | 706 | show_osd (manager, icon, vol, OSD_ALL_OUTPUTS); |
707 | 707 | if (quiet == FALSE && sound_changed != FALSE && muted == FALSE) { |
833 | 833 | { |
834 | 834 | GvcMixerStream *stream; |
835 | 835 | gboolean old_muted, new_muted; |
836 | guint old_vol, new_vol, norm_vol_step, osd_vol; | |
836 | guint old_vol, new_vol, norm_vol_step, osd_vol, osd_max_vol; | |
837 | 837 | gboolean sound_changed; |
838 | GSettings *settings; | |
838 | 839 | |
839 | 840 | /* Find the stream that corresponds to the device, if any */ |
840 | 841 | gboolean is_source_stream = |
855 | 856 | |
856 | 857 | norm_vol_step = PA_VOLUME_NORM * VOLUME_STEP / 100; |
857 | 858 | |
859 | settings = g_settings_new ("org.cinnamon.desktop.sound"); | |
860 | osd_max_vol = PA_VOLUME_NORM * g_settings_get_int (settings, "maximum-volume") / 100; | |
861 | g_object_unref (settings); | |
862 | ||
858 | 863 | /* FIXME: this is racy */ |
859 | 864 | new_vol = old_vol = gvc_mixer_stream_get_volume (stream); |
860 | 865 | new_muted = old_muted = gvc_mixer_stream_get_is_muted (stream); |
877 | 882 | new_muted = FALSE; |
878 | 883 | /* When coming out of mute only increase the volume if it was 0 */ |
879 | 884 | if (!old_muted || old_vol == 0) |
880 | new_vol = MIN (old_vol + norm_vol_step, MAX_VOLUME); | |
885 | new_vol = MIN (old_vol + norm_vol_step, osd_max_vol); | |
881 | 886 | break; |
882 | 887 | } |
883 | 888 | |
895 | 900 | |
896 | 901 | if (type == C_DESKTOP_MEDIA_KEY_VOLUME_DOWN && old_vol == 0 && old_muted) |
897 | 902 | osd_vol = -1; |
898 | else if (type == C_DESKTOP_MEDIA_KEY_VOLUME_UP && old_vol == PA_VOLUME_NORM && !old_muted) | |
903 | else if (type == C_DESKTOP_MEDIA_KEY_VOLUME_UP && old_vol == osd_max_vol && !old_muted) | |
899 | 904 | osd_vol = 101; |
900 | 905 | else if (!new_muted) |
901 | osd_vol = (int) (100 * (double) new_vol / PA_VOLUME_NORM); | |
906 | osd_vol = (int) (100 * (double) new_vol / osd_max_vol); | |
902 | 907 | else |
903 | 908 | osd_vol = 0; |
904 | update_dialog (manager, stream, is_source_stream, osd_vol, new_muted, sound_changed, quiet); | |
909 | show_sound_osd (manager, stream, is_source_stream, osd_vol, osd_max_vol, new_muted, sound_changed, quiet); | |
905 | 910 | } |
906 | 911 | |
907 | 912 | static void |
1777 | 1782 | do_keyboard_brightness_action (manager, type); |
1778 | 1783 | break; |
1779 | 1784 | case C_DESKTOP_MEDIA_KEY_BATTERY: |
1780 | do_execute_desktop (manager, "gnome-power-statistics.desktop", timestamp); | |
1785 | do_execute_desktop (manager, "org.gnome.PowerStats.desktop", timestamp); | |
1781 | 1786 | break; |
1782 | 1787 | /* Note, no default so compiler catches missing keys */ |
1783 | 1788 | case C_DESKTOP_MEDIA_KEY_SEPARATOR: |
41 | 41 | struct CsdLocatePointerData |
42 | 42 | { |
43 | 43 | CsdTimeline *timeline; |
44 | GtkWidget *widget; | |
44 | GtkWidget *widget; | |
45 | 45 | GdkWindow *window; |
46 | 46 | |
47 | 47 | gdouble progress; |
159 | 159 | { |
160 | 160 | CsdLocatePointerData *data = (CsdLocatePointerData *) user_data; |
161 | 161 | GdkScreen *screen; |
162 | GdkDeviceManager *device_manager; | |
162 | 163 | gint cursor_x, cursor_y; |
163 | 164 | |
164 | 165 | if (gtk_widget_is_composited (data->widget)) |
175 | 176 | } |
176 | 177 | |
177 | 178 | screen = gdk_window_get_screen (data->window); |
178 | gdk_window_get_pointer (gdk_screen_get_root_window (screen), | |
179 | &cursor_x, &cursor_y, NULL); | |
179 | device_manager = gdk_display_get_device_manager (gdk_window_get_display (data->window)); | |
180 | gdk_window_get_device_position (gdk_screen_get_root_window (screen), | |
181 | gdk_device_manager_get_client_pointer (device_manager), | |
182 | &cursor_x, &cursor_y, NULL); | |
180 | 183 | gdk_window_move (data->window, |
181 | 184 | cursor_x - WINDOW_SIZE / 2, |
182 | 185 | cursor_y - WINDOW_SIZE / 2); |
286 | 289 | move_locate_pointer_window (CsdLocatePointerData *data, |
287 | 290 | GdkScreen *screen) |
288 | 291 | { |
292 | GdkDeviceManager *device_manager; | |
289 | 293 | cairo_region_t *region; |
290 | 294 | gint cursor_x, cursor_y; |
291 | 295 | |
292 | gdk_window_get_pointer (gdk_screen_get_root_window (screen), &cursor_x, &cursor_y, NULL); | |
296 | device_manager = gdk_display_get_device_manager (gdk_window_get_display (data->window)); | |
297 | gdk_window_get_device_position (gdk_screen_get_root_window (screen), | |
298 | gdk_device_manager_get_client_pointer (device_manager), | |
299 | &cursor_x, &cursor_y, NULL); | |
293 | 300 | |
294 | 301 | gdk_window_move_resize (data->window, |
295 | 302 | cursor_x - WINDOW_SIZE / 2, |
424 | 431 | { |
425 | 432 | GdkKeymapKey *keys; |
426 | 433 | GdkDisplay *display; |
427 | int n_screens; | |
434 | GdkScreen *screen; | |
435 | Window xroot; | |
428 | 436 | int n_keys; |
429 | 437 | gboolean has_entries; |
430 | 438 | static const guint keyvals[] = { GDK_KEY_Control_L, GDK_KEY_Control_R }; |
431 | unsigned j; | |
439 | unsigned i,j; | |
432 | 440 | |
433 | 441 | display = gdk_display_get_default (); |
434 | n_screens = gdk_display_get_n_screens (display); | |
442 | screen = gdk_screen_get_default (); | |
443 | xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen)); | |
435 | 444 | |
436 | 445 | for (j = 0 ; j < G_N_ELEMENTS (keyvals) ; j++) |
437 | 446 | { |
441 | 450 | &n_keys); |
442 | 451 | if (has_entries) |
443 | 452 | { |
444 | gint i, k; | |
445 | 453 | for (i = 0; i < n_keys; i++) |
446 | 454 | { |
447 | for (k = 0; k < n_screens; k++) | |
448 | { | |
449 | GdkScreen *screen; | |
450 | Window xroot; | |
451 | ||
452 | screen = gdk_display_get_screen (display, k); | |
453 | xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen)); | |
454 | ||
455 | gdk_x11_display_error_trap_push (display); | |
456 | ||
457 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
458 | keys[i].keycode, | |
459 | 0, | |
460 | xroot, | |
461 | False, | |
462 | GrabModeAsync, | |
463 | GrabModeSync); | |
464 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
465 | keys[i].keycode, | |
466 | LockMask, | |
467 | xroot, | |
468 | False, | |
469 | GrabModeAsync, | |
470 | GrabModeSync); | |
471 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
472 | keys[i].keycode, | |
473 | Mod2Mask, | |
474 | xroot, | |
475 | False, | |
476 | GrabModeAsync, | |
477 | GrabModeSync); | |
478 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
479 | keys[i].keycode, | |
480 | Mod4Mask, | |
481 | xroot, | |
482 | False, | |
483 | GrabModeAsync, | |
484 | GrabModeSync); | |
485 | ||
486 | gdk_x11_display_error_trap_pop_ignored (display); | |
487 | } | |
455 | gdk_x11_display_error_trap_push (display); | |
456 | ||
457 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
458 | keys[i].keycode, | |
459 | 0, | |
460 | xroot, | |
461 | False, | |
462 | GrabModeAsync, | |
463 | GrabModeSync); | |
464 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
465 | keys[i].keycode, | |
466 | LockMask, | |
467 | xroot, | |
468 | False, | |
469 | GrabModeAsync, | |
470 | GrabModeSync); | |
471 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
472 | keys[i].keycode, | |
473 | Mod2Mask, | |
474 | xroot, | |
475 | False, | |
476 | GrabModeAsync, | |
477 | GrabModeSync); | |
478 | XGrabKey (GDK_DISPLAY_XDISPLAY (display), | |
479 | keys[i].keycode, | |
480 | Mod4Mask, | |
481 | xroot, | |
482 | False, | |
483 | GrabModeAsync, | |
484 | GrabModeSync); | |
485 | ||
486 | gdk_x11_display_error_trap_pop_ignored (display); | |
488 | 487 | } |
489 | 488 | |
490 | 489 | g_free (keys); |
491 | 490 | |
492 | for (i = 0; i < n_screens; i++) | |
493 | { | |
494 | GdkScreen *screen; | |
495 | ||
496 | screen = gdk_display_get_screen (display, i); | |
497 | gdk_window_add_filter (gdk_screen_get_root_window (screen), | |
498 | filter, | |
499 | screen); | |
500 | } | |
491 | gdk_window_add_filter (gdk_screen_get_root_window (screen), | |
492 | filter, | |
493 | screen); | |
501 | 494 | } |
502 | 495 | } |
503 | 496 | } |
113 | 113 | |
114 | 114 | static gpointer manager_object = NULL; |
115 | 115 | |
116 | ||
117 | static GObject * | |
118 | csd_mouse_manager_constructor (GType type, | |
119 | guint n_construct_properties, | |
120 | GObjectConstructParam *construct_properties) | |
121 | { | |
122 | CsdMouseManager *mouse_manager; | |
123 | ||
124 | mouse_manager = CSD_MOUSE_MANAGER (G_OBJECT_CLASS (csd_mouse_manager_parent_class)->constructor (type, | |
125 | n_construct_properties, | |
126 | construct_properties)); | |
127 | ||
128 | return G_OBJECT (mouse_manager); | |
129 | } | |
130 | ||
131 | static void | |
132 | csd_mouse_manager_dispose (GObject *object) | |
133 | { | |
134 | G_OBJECT_CLASS (csd_mouse_manager_parent_class)->dispose (object); | |
135 | } | |
136 | ||
137 | 116 | static void |
138 | 117 | csd_mouse_manager_class_init (CsdMouseManagerClass *klass) |
139 | 118 | { |
140 | 119 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
141 | 120 | |
142 | object_class->constructor = csd_mouse_manager_constructor; | |
143 | object_class->dispose = csd_mouse_manager_dispose; | |
144 | 121 | object_class->finalize = csd_mouse_manager_finalize; |
145 | 122 | |
146 | 123 | g_type_class_add_private (klass, sizeof (CsdMouseManagerPrivate)); |
479 | 456 | left_handed = mouse_left_handed; |
480 | 457 | } |
481 | 458 | |
459 | gdk_error_trap_push (); | |
482 | 460 | n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, |
483 | 461 | buttons, |
484 | 462 | buttons_capacity); |
495 | 473 | |
496 | 474 | configure_button_layout (buttons, n_buttons, left_handed); |
497 | 475 | |
498 | gdk_error_trap_push (); | |
499 | 476 | XSetDeviceButtonMapping (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, buttons, n_buttons); |
500 | 477 | gdk_error_trap_pop_ignored (); |
501 | 478 | |
605 | 582 | motion_threshold = -1; |
606 | 583 | } |
607 | 584 | |
585 | gdk_error_trap_push (); | |
586 | ||
608 | 587 | /* Get the list of feedbacks for the device */ |
609 | 588 | states = XGetFeedbackControl (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, &num_feedbacks); |
610 | 589 | if (states == NULL) |
633 | 612 | state = (XFeedbackState *) ((char *) state + state->length); |
634 | 613 | } |
635 | 614 | |
615 | if (gdk_error_trap_pop ()) | |
616 | g_warning ("Error setting acceleration on \"%s\"", | |
617 | gdk_device_get_name (device)); | |
618 | ||
636 | 619 | XFreeFeedbackList (states); |
637 | 620 | |
638 | 621 | out: |
1312 | 1295 | |
1313 | 1296 | if (! g_spawn_command_line_async (comm, &error)) { |
1314 | 1297 | if (error->code == G_SPAWN_ERROR_NOENT && run_daemon) { |
1315 | GtkWidget *dialog; | |
1316 | ||
1317 | 1298 | if (dwell_click_enabled) { |
1318 | 1299 | g_settings_set_boolean (manager->priv->mouse_a11y_settings, |
1319 | 1300 | KEY_DWELL_CLICK_ENABLED, FALSE); |
1321 | 1302 | g_settings_set_boolean (manager->priv->mouse_a11y_settings, |
1322 | 1303 | KEY_SECONDARY_CLICK_ENABLED, FALSE); |
1323 | 1304 | } |
1324 | ||
1325 | dialog = gtk_message_dialog_new (NULL, 0, | |
1326 | GTK_MESSAGE_WARNING, | |
1327 | GTK_BUTTONS_OK, | |
1328 | _("Could not enable mouse accessibility features")); | |
1329 | gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), | |
1330 | _("Mouse accessibility requires Mousetweaks " | |
1331 | "to be installed on your system.")); | |
1332 | gtk_window_set_title (GTK_WINDOW (dialog), _("Universal Access")); | |
1333 | gtk_window_set_icon_name (GTK_WINDOW (dialog), | |
1334 | "preferences-desktop-accessibility"); | |
1335 | gtk_dialog_run (GTK_DIALOG (dialog)); | |
1336 | gtk_widget_destroy (dialog); | |
1305 | g_warning("Error enabling mouse accessibility features (mousetweaks is not installed)"); | |
1337 | 1306 | } |
1338 | 1307 | g_error_free (error); |
1339 | 1308 | } |
1501 | 1470 | } |
1502 | 1471 | } |
1503 | 1472 | g_list_free (devices); |
1473 | } | |
1474 | ||
1475 | /* Re-enable touchpad when any other pointing device isn't present. */ | |
1476 | static void | |
1477 | ensure_touchpad_active (CsdMouseManager *manager) | |
1478 | { | |
1479 | if (mouse_is_present () == FALSE && touchscreen_is_present () == FALSE && touchpad_is_present ()) | |
1480 | g_settings_set_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED, TRUE); | |
1504 | 1481 | } |
1505 | 1482 | |
1506 | 1483 | static void |
1607 | 1584 | |
1608 | 1585 | /* If a touchpad was to disappear... */ |
1609 | 1586 | set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_DISABLE_W_TYPING)); |
1587 | ensure_touchpad_active (manager); | |
1610 | 1588 | } |
1611 | 1589 | } |
1612 | 1590 | |
1678 | 1656 | } |
1679 | 1657 | g_list_free (devices); |
1680 | 1658 | |
1659 | ensure_touchpad_active (manager); | |
1660 | ||
1681 | 1661 | if (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED)) { |
1682 | 1662 | devices = get_disabled_devices (manager->priv->device_manager); |
1683 | for (l = devices; l != NULL; l = l->next) { | |
1663 | for (l = devices; l != NULL; l = l->next) { | |
1684 | 1664 | int device_id; |
1685 | 1665 | |
1686 | 1666 | device_id = GPOINTER_TO_INT (l->data); |
1721 | 1701 | |
1722 | 1702 | g_debug ("Stopping mouse manager"); |
1723 | 1703 | |
1704 | if (manager->priv->start_idle_id != 0) { | |
1705 | g_source_remove (manager->priv->start_idle_id); | |
1706 | manager->priv->start_idle_id = 0; | |
1707 | } | |
1708 | ||
1724 | 1709 | if (p->device_manager != NULL) { |
1725 | 1710 | g_signal_handler_disconnect (p->device_manager, p->device_added_id); |
1726 | 1711 | g_signal_handler_disconnect (p->device_manager, p->device_removed_id); |
1727 | 1712 | p->device_manager = NULL; |
1728 | 1713 | } |
1729 | 1714 | |
1730 | if (p->mouse_a11y_settings != NULL) { | |
1731 | g_object_unref (p->mouse_a11y_settings); | |
1732 | p->mouse_a11y_settings = NULL; | |
1733 | } | |
1734 | ||
1735 | if (p->mouse_settings != NULL) { | |
1736 | g_object_unref (p->mouse_settings); | |
1737 | p->mouse_settings = NULL; | |
1738 | } | |
1739 | ||
1740 | if (p->touchpad_settings != NULL) { | |
1741 | g_object_unref (p->touchpad_settings); | |
1742 | p->touchpad_settings = NULL; | |
1743 | } | |
1715 | g_clear_object (&p->mouse_a11y_settings); | |
1716 | g_clear_object (&p->mouse_settings); | |
1717 | g_clear_object (&p->touchpad_settings); | |
1744 | 1718 | |
1745 | 1719 | set_locate_pointer (manager, FALSE); |
1746 | 1720 | } |
1757 | 1731 | |
1758 | 1732 | g_return_if_fail (mouse_manager->priv != NULL); |
1759 | 1733 | |
1760 | if (mouse_manager->priv->blacklist != NULL) | |
1761 | g_hash_table_destroy (mouse_manager->priv->blacklist); | |
1762 | ||
1763 | if (mouse_manager->priv->start_idle_id != 0) { | |
1764 | g_source_remove (mouse_manager->priv->start_idle_id); | |
1765 | mouse_manager->priv->start_idle_id = 0; | |
1766 | } | |
1767 | ||
1768 | if (mouse_manager->priv->device_manager != NULL) { | |
1769 | g_signal_handler_disconnect (mouse_manager->priv->device_manager, mouse_manager->priv->device_added_id); | |
1770 | g_signal_handler_disconnect (mouse_manager->priv->device_manager, mouse_manager->priv->device_removed_id); | |
1771 | } | |
1772 | ||
1773 | if (mouse_manager->priv->mouse_settings != NULL) | |
1774 | g_object_unref (mouse_manager->priv->mouse_settings); | |
1775 | ||
1776 | if (mouse_manager->priv->mouse_a11y_settings != NULL) | |
1777 | g_object_unref (mouse_manager->priv->mouse_a11y_settings); | |
1778 | ||
1779 | if (mouse_manager->priv->touchpad_settings != NULL) | |
1780 | g_object_unref (mouse_manager->priv->touchpad_settings); | |
1734 | csd_mouse_manager_stop (mouse_manager); | |
1781 | 1735 | |
1782 | 1736 | G_OBJECT_CLASS (csd_mouse_manager_parent_class)->finalize (object); |
1783 | 1737 | } |
228 | 228 | |
229 | 229 | /* logind stuff */ |
230 | 230 | GDBusProxy *logind_proxy; |
231 | gboolean inhibit_lid_switch_enabled; | |
231 | 232 | gint inhibit_lid_switch_fd; |
232 | 233 | gboolean inhibit_lid_switch_taken; |
233 | 234 | gint inhibit_suspend_fd; |
3515 | 3516 | } |
3516 | 3517 | |
3517 | 3518 | static void |
3518 | sleep_cb_screensaver_proxy_ready_cb (GObject *source_object, | |
3519 | GAsyncResult *res, | |
3520 | gpointer user_data) | |
3521 | { | |
3522 | GError *error = NULL; | |
3523 | CsdPowerManager *manager = CSD_POWER_MANAGER (user_data); | |
3524 | ||
3525 | manager->priv->screensaver_proxy = g_dbus_proxy_new_for_bus_finish (res, &error); | |
3526 | if (manager->priv->screensaver_proxy == NULL) { | |
3527 | g_warning ("Could not connect to cinnamon-screensaver: %s", | |
3528 | error->message); | |
3529 | g_error_free (error); | |
3530 | return; | |
3531 | } | |
3532 | ||
3533 | /* Finish the upower_notify_sleep_cb() call by locking the screen */ | |
3534 | g_debug ("cinnamon-screensaver activated, doing cinnamon-screensaver lock"); | |
3535 | g_dbus_proxy_call (manager->priv->screensaver_proxy, | |
3536 | "Lock", | |
3537 | g_variant_new("(s)", ""), | |
3538 | G_DBUS_CALL_FLAGS_NONE, -1, | |
3539 | NULL, NULL, NULL); | |
3540 | ||
3519 | lock_screensaver (CsdPowerManager *manager) | |
3520 | { | |
3521 | GError *error; | |
3522 | gboolean ret; | |
3523 | ||
3524 | g_debug ("Locking screen before sleep/hibernate"); | |
3525 | ||
3526 | /* do this sync to ensure it's on the screen when we start suspending */ | |
3527 | error = NULL; | |
3528 | ret = g_spawn_command_line_sync ("cinnamon-screensaver-command --lock", NULL, NULL, NULL, &error); | |
3529 | ||
3530 | if (!ret) { | |
3531 | g_warning ("Couldn't lock screen: %s", error->message); | |
3532 | g_error_free (error); | |
3533 | } | |
3541 | 3534 | } |
3542 | 3535 | |
3543 | 3536 | static void |
3696 | 3689 | } |
3697 | 3690 | |
3698 | 3691 | static void |
3699 | lock_screensaver (CsdPowerManager *manager) | |
3700 | { | |
3701 | gboolean do_lock; | |
3702 | ||
3703 | do_lock = g_settings_get_boolean (manager->priv->settings_screensaver, | |
3704 | "lock-enabled"); | |
3705 | if (!do_lock) | |
3706 | return; | |
3707 | ||
3708 | /* connect to the screensaver first */ | |
3709 | g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, | |
3710 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | |
3711 | NULL, | |
3712 | GS_DBUS_NAME, | |
3713 | GS_DBUS_PATH, | |
3714 | GS_DBUS_INTERFACE, | |
3715 | NULL, | |
3716 | sleep_cb_screensaver_proxy_ready_cb, | |
3717 | manager); | |
3718 | } | |
3719 | ||
3720 | static void | |
3721 | 3692 | idle_idletime_alarm_expired_cb (GpmIdletime *idletime, |
3722 | 3693 | guint alarm_id, |
3723 | 3694 | CsdPowerManager *manager) |
3887 | 3858 | static void |
3888 | 3859 | inhibit_lid_switch (CsdPowerManager *manager) |
3889 | 3860 | { |
3861 | if (!manager->priv->inhibit_lid_switch_enabled) { | |
3862 | // The users asks us not to interfere with what logind does | |
3863 | // w.r.t. handling the lid switch | |
3864 | g_debug ("inhibiting lid-switch disabled"); | |
3865 | return; | |
3866 | } | |
3867 | ||
3890 | 3868 | GVariant *params; |
3891 | 3869 | |
3892 | 3870 | if (manager->priv->inhibit_lid_switch_taken) { |
4003 | 3981 | |
4004 | 3982 | do_lock = g_settings_get_boolean (manager->priv->settings, |
4005 | 3983 | "lock-on-suspend"); |
4006 | if (do_lock) | |
4007 | g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, | |
4008 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | |
4009 | NULL, | |
4010 | GS_DBUS_NAME, | |
4011 | GS_DBUS_PATH, | |
4012 | GS_DBUS_INTERFACE, | |
4013 | NULL, | |
4014 | sleep_cb_screensaver_proxy_ready_cb, | |
4015 | manager); | |
3984 | ||
3985 | if (do_lock) { | |
3986 | lock_screensaver (manager); | |
3987 | } | |
4016 | 3988 | |
4017 | 3989 | /* lift the delay inhibit, so logind can proceed */ |
4018 | 3990 | uninhibit_suspend (manager); |
4193 | 4165 | manager->priv->settings_xrandr = g_settings_new (CSD_XRANDR_SETTINGS_SCHEMA); |
4194 | 4166 | manager->priv->settings_session = g_settings_new (CSD_SESSION_SETTINGS_SCHEMA); |
4195 | 4167 | manager->priv->use_logind = g_settings_get_boolean (manager->priv->settings_session, "settings-daemon-uses-logind"); |
4168 | manager->priv->inhibit_lid_switch_enabled = | |
4169 | g_settings_get_boolean (manager->priv->settings, "inhibit-lid-switch"); | |
4196 | 4170 | |
4197 | 4171 | manager->priv->up_client = up_client_new (); |
4198 | 4172 | #if ! UP_CHECK_VERSION(0,99,0) |
30 | 30 | |
31 | 31 | #include <locale.h> |
32 | 32 | |
33 | #include <glib.h> | |
34 | 33 | #include <glib/gi18n.h> |
35 | #include <gtk/gtk.h> | |
34 | #include <gio/gio.h> | |
36 | 35 | #include <pulse/pulseaudio.h> |
37 | 36 | #include <canberra.h> |
38 | 37 | |
575 | 574 | } |
576 | 575 | } |
577 | 576 | |
578 | static GObject * | |
579 | csd_sound_manager_constructor ( | |
580 | GType type, | |
581 | guint n_construct_properties, | |
582 | GObjectConstructParam *construct_properties) | |
583 | { | |
584 | CsdSoundManager *m; | |
585 | ||
586 | m = CSD_SOUND_MANAGER (G_OBJECT_CLASS (csd_sound_manager_parent_class)->constructor ( | |
587 | type, | |
588 | n_construct_properties, | |
589 | construct_properties)); | |
590 | ||
591 | return G_OBJECT (m); | |
592 | } | |
593 | ||
594 | 577 | static void |
595 | 578 | csd_sound_manager_dispose (GObject *object) |
596 | 579 | { |
608 | 591 | { |
609 | 592 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
610 | 593 | |
611 | object_class->constructor = csd_sound_manager_constructor; | |
612 | 594 | object_class->dispose = csd_sound_manager_dispose; |
613 | 595 | object_class->finalize = csd_sound_manager_finalize; |
614 | 596 |
48 | 48 | |
49 | 49 | #define MOUSE_SETTINGS_SCHEMA "org.cinnamon.settings-daemon.peripherals.mouse" |
50 | 50 | #define INTERFACE_SETTINGS_SCHEMA "org.cinnamon.desktop.interface" |
51 | #define INTERFACE_WM_SETTINGS_SCHEMA "org.cinnamon.desktop.wm.preferences" | |
51 | 52 | #define SOUND_SETTINGS_SCHEMA "org.cinnamon.desktop.sound" |
52 | 53 | #define PRIVACY_SETTINGS_SCHEMA "org.cinnamon.desktop.privacy" |
53 | 54 | |
352 | 353 | { "org.cinnamon.desktop.interface", "gtk-timeout-initial", "Gtk/TimeoutInitial", translate_int_int }, |
353 | 354 | { "org.cinnamon.desktop.interface", "gtk-timeout-repeat", "Gtk/TimeoutRepeat", translate_int_int }, |
354 | 355 | { "org.cinnamon.desktop.interface", "gtk-color-scheme", "Gtk/ColorScheme", translate_string_string }, |
355 | { "org.cinnamon.desktop.interface", "gtk-decoration-layout", "Gtk/DecorationLayout", translate_string_string }, | |
356 | 356 | { "org.cinnamon.desktop.interface", "gtk-im-preedit-style", "Gtk/IMPreeditStyle", translate_string_string }, |
357 | 357 | { "org.cinnamon.desktop.interface", "gtk-im-status-style", "Gtk/IMStatusStyle", translate_string_string }, |
358 | 358 | { "org.cinnamon.desktop.interface", "gtk-im-module", "Gtk/IMModule", translate_string_string }, |
362 | 362 | { "org.cinnamon.desktop.interface", "menubar-accel", "Gtk/MenuBarAccel", translate_string_string }, |
363 | 363 | { "org.cinnamon.desktop.interface", "enable-animations", "Gtk/EnableAnimations", translate_bool_int }, |
364 | 364 | { "org.cinnamon.desktop.interface", "cursor-theme", "Gtk/CursorThemeName", translate_string_string }, |
365 | ||
365 | { "org.cinnamon.desktop.wm.preferences", "button-layout", "Gtk/DecorationLayout", translate_string_string }, | |
366 | { "org.cinnamon.desktop.wm.preferences", "action-double-click-titlebar", "Gtk/TitlebarDoubleClick", translate_string_string }, | |
367 | { "org.cinnamon.desktop.wm.preferences", "action-middle-click-titlebar", "Gtk/TitlebarMiddleClick", translate_string_string }, | |
368 | { "org.cinnamon.desktop.wm.preferences", "action-right-click-titlebar", "Gtk/TitlebarRightClick", translate_string_string }, | |
366 | 369 | { "org.cinnamon.settings-daemon.plugins.xsettings", "show-input-method-menu", "Gtk/ShowInputMethodMenu", translate_bool_int }, |
367 | 370 | { "org.cinnamon.settings-daemon.plugins.xsettings", "show-unicode-menu", "Gtk/ShowUnicodeMenu", translate_bool_int }, |
368 | 371 | { "org.cinnamon.settings-daemon.plugins.xsettings", "automatic-mnemonics", "Gtk/AutoMnemonics", translate_bool_int }, |
932 | 935 | g_hash_table_insert (manager->priv->settings, |
933 | 936 | INTERFACE_SETTINGS_SCHEMA, g_settings_new (INTERFACE_SETTINGS_SCHEMA)); |
934 | 937 | g_hash_table_insert (manager->priv->settings, |
938 | INTERFACE_WM_SETTINGS_SCHEMA, g_settings_new (INTERFACE_WM_SETTINGS_SCHEMA)); | |
939 | g_hash_table_insert (manager->priv->settings, | |
935 | 940 | SOUND_SETTINGS_SCHEMA, g_settings_new (SOUND_SETTINGS_SCHEMA)); |
936 | 941 | g_hash_table_insert (manager->priv->settings, |
937 | 942 | XSETTINGS_PLUGIN_SCHEMA, g_settings_new (XSETTINGS_PLUGIN_SCHEMA)); |