-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: fix potentially unsafe screensaver inhibitor #2986
Conversation
|
e7f681a
to
021b31f
Compare
cd36154
to
7a133cc
Compare
Even if the cookie becomes invalid due to success in inhibition, but too late of a response, having the function consistently fail is better than having the potential of inflating the daemon with inhibitors, imo. |
I have an improvement on my mind, a couple of hours until I return home. |
7a133cc
to
9c7111d
Compare
Partially addressed. |
I think this is mergeable currently, doing more would overcomplicate it for a "problem" that's just a red herring. |
9c7111d
to
b73a418
Compare
42c1128
to
eaadb0a
Compare
eaadb0a
to
4acf6a2
Compare
4acf6a2
to
1026be2
Compare
commit 0798292 Merge: f8f395c de505c9 Author: Connor McLaughlin <[email protected]> Date: Wed Aug 9 22:35:10 2023 +1000 Merge pull request stenzek#2991 from andercard0/master Atualização Português do Brasil commit f8f395c Merge: 5d750a8 657d4f3 Author: Connor McLaughlin <[email protected]> Date: Wed Aug 9 22:34:52 2023 +1000 Merge pull request stenzek#2992 from IlDucci/es_ES_update_20230806 Spanish (Spain) translation update 2023-08-06 commit 5d750a8 Author: Stenzek <[email protected]> Date: Wed Aug 9 19:39:42 2023 +1000 dep: Bump rcheevos to 3af1e2fc5188d6e932ee379942f4049ea877e648 commit 657d4f3 Author: IlDucci <[email protected]> Date: Sun Aug 6 21:18:48 2023 +0200 Spanish (Spain) translation update 2023-08-06 Spanish (Spain) translation update 2023-08-06 + Unifying the translation for the "Display" setting section. commit 56ac3d6 Author: Stenzek <[email protected]> Date: Fri Aug 4 21:39:33 2023 +1000 HostDisplay: Fix incorrectly positioned screenshots commit de505c9 Author: Anderson Cardoso <[email protected]> Date: Sun Jul 30 12:30:09 2023 -0300 Atualização Português do Brasil Atualizado para a última versão - Opções relacionadas ao modo controle OSD: - Correção de quebra de linha; - Correção de pluralização; Qt UI: - Conforme pedido, removido termo mais objetivo no modo dificílimo para hardcore. (Se é que alguém realmente se importa com estrangeirismos bobos) enfim, deixado para trás. Nota mental (para mim mesmo): Remover os obsoletos assim que mudado para PNT. como sou eu quem mantenho essa parte ficará assim e fim de papo! commit 0575588 Merge: 0dee77a 1026be2 Author: Connor McLaughlin <[email protected]> Date: Sun Jul 30 19:29:02 2023 +1000 Merge pull request stenzek#2986 from charlesthobe/screensaver-fix Linux: fix potentially unsafe screensaver inhibitor commit 0dee77a Merge: 2e8b637 bbf0346 Author: Connor McLaughlin <[email protected]> Date: Sun Jul 30 19:28:20 2023 +1000 Merge pull request stenzek#2990 from CookiePLMonster/multiple-leaderboards-fix Achievements: Fix Leaderboard submission UI when multiple leaderboards update at once commit bbf0346 Author: Silent <[email protected]> Date: Sat Jul 29 18:56:38 2023 +0200 Achievements: Fix Leaderboard submission UI when multiple leaderboards update at once commit 1026be2 Author: charlesthobe <[email protected]> Date: Sat Jul 8 21:47:13 2023 +0300 Linux: fix potentially unsafe screensaver inhibitor commit 2e8b637 Author: Stenzek <[email protected]> Date: Mon Jul 24 19:27:31 2023 +1000 scmversion: Exclude previous-latest commit 944bf5d Author: Stenzek <[email protected]> Date: Mon Jul 24 19:24:27 2023 +1000 RegTest: Fix build commit 6fbdb6d Author: Stenzek <[email protected]> Date: Mon Jul 24 19:23:58 2023 +1000 GPU: Enable GPUSTAT.28 in read mode Fixes Celeste Classic. commit 72f7225 Author: Stenzek <[email protected]> Date: Thu Jun 1 23:18:35 2023 +1000 Qt: Fix ClearBindStateFromSource() executing on wrong thread commit af5f1c7 Merge: 2d78b3f 3ea0715 Author: Connor McLaughlin <[email protected]> Date: Fri Jun 30 23:07:28 2023 +1000 Merge pull request stenzek#2984 from Mateos81/french_translation Update French translation commit 3ea0715 Author: Christophe Mateos <[email protected]> Date: Sun Jun 11 14:34:00 2023 +0200 Update French translation commit 2d78b3f Merge: 671f856 8c6850a Author: Connor McLaughlin <[email protected]> Date: Fri Jun 9 01:20:26 2023 +1000 Merge pull request stenzek#2983 from Mateos81/french_translation Update French translation commit 8c6850a Author: Christophe Mateos <[email protected]> Date: Sun Jun 4 19:19:11 2023 +0200 Update French translation commit 671f856 Merge: ffb832e 36c4345 Author: Connor McLaughlin <[email protected]> Date: Wed May 24 20:34:13 2023 +1000 Merge pull request stenzek#2981 from HeatXD/patch-1 core / system: Disc-Region Fix For Netplay commit 36c4345 Author: Jamie Meyer <[email protected]> Date: Wed May 24 12:33:24 2023 +0200 core / system: Disc-Region Fix For Netplay Fixes an issue which is only really valid for netplay since can start from an non-auto region sinc eit pulls it from the host. commit ffb832e Merge: fd6184b dfc0494 Author: Connor McLaughlin <[email protected]> Date: Wed May 24 20:27:16 2023 +1000 Merge pull request stenzek#2972 from andercard0/master Atualização Português do Brasil commit fd6184b Merge: 49848c8 488920a Author: Connor McLaughlin <[email protected]> Date: Wed May 24 20:27:04 2023 +1000 Merge pull request stenzek#2977 from zkdpower/master update Simple-Chinese translation to latest. commit 49848c8 Merge: d8e9808 7dca70b Author: Connor McLaughlin <[email protected]> Date: Wed May 24 20:26:48 2023 +1000 Merge pull request stenzek#2980 from Hipnosis183/master Updated Spanish (Latin America) translation commit 7dca70b Author: Renzo Pigliacampo <[email protected]> Date: Fri May 19 23:42:44 2023 -0300 Updated Spanish (Latin America) translation commit d8e9808 Author: Stenzek <[email protected]> Date: Mon May 15 23:47:22 2023 +1000 GameList: Add GetEntryBySerialAndHash() commit 1b29212 Author: Stenzek <[email protected]> Date: Thu May 11 00:52:06 2023 +1000 Qt: Fix geometry not saving on shutdown commit 9059346 Author: Stenzek <[email protected]> Date: Mon May 15 23:38:53 2023 +1000 GameDB: Remove some unused/duplicate entries commit 9aa6c24 Author: Stenzek <[email protected]> Date: Mon May 15 23:38:37 2023 +1000 System: Store game hash as well as serial commit 488920a Author: zkdpower <[email protected]> Date: Sat May 13 17:34:08 2023 +0800 update Simple-Chinese translation to latest. commit 7681551 Author: Stenzek <[email protected]> Date: Mon May 8 13:07:19 2023 +1000 System: Don't auto enable analog on unknown games commit eb77894 Author: Connor McLaughlin <[email protected]> Date: Fri May 5 18:40:04 2023 +1000 Update README.md commit dfc0494 Author: Anderson Cardoso <[email protected]> Date: Wed May 3 16:36:05 2023 -0300 Atualização Português do Brasil Confirmação de novos textos Tipos de controle: Não conectado commit 4811742 Merge: c6dc217 6b366af Author: Connor McLaughlin <[email protected]> Date: Thu May 4 01:00:46 2023 +1000 Merge pull request stenzek#2965 from stenzek/resize HostDisplay: Treat internal res screenshots as a screenshot commit c6dc217 Merge: b790592 4ea57da Author: Connor McLaughlin <[email protected]> Date: Thu May 4 01:00:22 2023 +1000 Merge pull request stenzek#2970 from CharlesThobe/patch-1 CMake: display warning when building without Wayland on systems that support Wayland commit b790592 Merge: 4cbb6e2 6afb267 Author: Connor McLaughlin <[email protected]> Date: Thu May 4 00:59:49 2023 +1000 Merge pull request stenzek#2971 from HeatXD/fix-comment core: fix-comment commit 6afb267 Author: Jamie Meyer <[email protected]> Date: Wed May 3 16:44:48 2023 +0200 core: fix-comment commit 4ea57da Author: Charles the Thobe <[email protected]> Date: Tue May 2 09:41:04 2023 +0300 CMake: display warning when building without Wayland on systems that support Wayland commit 4cbb6e2 Merge: 9526e15 17f2711 Author: Connor McLaughlin <[email protected]> Date: Tue May 2 21:46:32 2023 +1000 Merge pull request stenzek#2964 from andercard0/master Atualização Português do Brasil commit 9526e15 Author: Dolphin <[email protected]> Date: Tue May 2 20:46:06 2023 +0900 Update japanese translation (stenzek#2969) * update base duckstation-qt_ja.ts * update Japanese translation * translate controller name on controllersettingsdialog commit d4769e1 Merge: 4f6712e 53de37e Author: Connor McLaughlin <[email protected]> Date: Tue May 2 21:45:48 2023 +1000 Merge pull request stenzek#2967 from CharlesThobe/pr Linux: implement DBus screensaver inhibitor commit 4f6712e Merge: a003832 4143742 Author: Connor McLaughlin <[email protected]> Date: Tue May 2 21:45:05 2023 +1000 Merge pull request stenzek#2966 from IlDucci/Spanish_update_20230501 Spanish (Spain) translation update - 2023/05/01 commit 6b366af Author: Stenzek <[email protected]> Date: Mon May 1 15:12:30 2023 +1000 HostDisplay: Treat internal res screenshots as a screenshot commit 53de37e Author: CharlesThobe <[email protected]> Date: Mon May 1 15:17:08 2023 +0300 Linux: implement DBus screensaver inhibitor commit b65f189 Author: CharlesThobe <[email protected]> Date: Mon May 1 14:21:16 2023 +0300 Add vscode preferences folder to .gitignore commit 8483738 Author: CharlesThobe <[email protected]> Date: Mon May 1 13:29:30 2023 +0300 Fix order of macros commit 4143742 Author: IlDucci <[email protected]> Date: Mon May 1 11:34:28 2023 +0200 Spanish (Spain) translation update - 2023/05/01 Updating Spanish (Spain) translation with the latest changes. commit 17f2711 Author: Anderson Cardoso <[email protected]> Date: Sat Apr 29 20:24:23 2023 -0300 Atualização Português do Brasil Configurações avançadas Confirmação de strings: -Diretório de pastas -Diretório PCDrv -Ativação PCDrv
The dbus behavior according to their documentation is as follows:
1- Calling
dbus_bus_get()
gets you a public connection, there can only be one of those.2- This connection should remain open for the rest of the life of the program and is unclosable.
3- Calling
dbus_connection_unref(ReferenceToThePublicConnection)
can result in UB.4- If the connection is severed in case of dbus daemon crash for example, the dbus lib automatically closes the program (duckstation closes) unless
dbus_connection_set_exit_on_disconnect(ReferenceToThePublicConnection, false)
is called.All of that means that the connection will always be alive and therefor the inhibitor cookie will always be valid until used, meaning that the cookie shouldn't be discarded until it's used successfully in removing the screensaver inhibitor (reasons for failure of doing so are things like the CPU being under a too heavy load that it takes more time than
DBUS_TIMEOUT_USE_DEFAULT
for duckstation to receive a requested message from dbus), so even then the cookie should be kept for reuse and duckstation should be prevented from requesting another inhibitor, until the current inhibitor is gone.The PR addresses all of that.