Compare commits

...
Author SHA1 Message Date
The412Banner 1f55688c37 fix(frontend): keep a frontend file only for an added game on an unmounted folder
While an added games folder is unreadable, the sync kept the file of every
vanished shortcut-id game, including games removed in the app, removed Epic
or Battle.net games, and old-card games already added again from a new card.
It now keeps only added games whose folder lies on an unreadable bind, is
not removed, and has no listed added game with the same folder name.
2026-11-27 20:16:53 +00:00
The412Banner c74c20b880 fix(frontend): keep only added-game files while an added games folder is unreadable 2026-11-26 08:54:27 +00:00
The412Banner bbdec91c43 fix(frontend): game file sync keeps running when an added games folder is gone 2026-11-26 08:48:42 +00:00
Kurt Himebauch d788afc126 fix(gamescope): enter Steam at the corner it is reset to (#3253)
* fix(gamescope): enter Steam at the corner it is reset to

* docs(gamescope): explain the corner entry patch
2026-11-26 02:28:42 -05:00
Kurt Himebauch 50a7b1b9f5 fix(compositor): report a client's first hidden cursor (#3245) 2026-11-25 23:23:38 -05:00
41 changed files with 154 additions and 38 deletions

No files matched your search

@@ -620,7 +620,8 @@ static void cursor_publish_shown(void) {
static void cursor_publish_hidden(void) {
pthread_mutex_lock(&g_cursor_lock);
if (!g_cursor_hidden) { g_cursor_hidden = 1; g_cursor_serial++; }
// A client that hides the cursor before ever showing one (gamescope drawing its own) must still be reported.
if (!g_cursor_hidden || g_cursor_serial == 0) { g_cursor_hidden = 1; g_cursor_serial++; }
pthread_mutex_unlock(&g_cursor_lock);
}
@@ -403,6 +403,18 @@ object AddedGames {
Log.i(TAG, "games: bound $dir at $guest")
}
fun unmountedShortcuts(context: Context, listed: List<Library.SteamGame>): Set<String> {
val gone = roots(context).filter { it.host.listFiles() == null }.map { it.host.path }
if (gone.isEmpty()) return emptySet()
val removed = SessionPrefs.removedAddedGames(context).toSet()
val present = listed.filter { it.library == Library.ADDED }.mapNotNull { it.gameFiles?.name?.lowercase() }.toSet()
return AddedExes.list(context).map { File(it.folder) }
.filter { f -> f.path !in removed && gone.any { f.path == it || inside(f.path, it) } && !f.isDirectory && f.name.lowercase() !in present }
.mapNotNull { SessionPrefs.addedGameStoredAppId(context, it.path) }
.map(com.droiddeck.launcher.stores.epic.EpicClient::gameId)
.toSet()
}
private fun listedFolders(context: Context, removed: Set<String>): List<String> {
val out = ArrayList<String>()
val entries = entryFolders(context)
@@ -46,8 +46,8 @@ object GameFileSync {
check(libraryReadable(File(previousStorage))) { context.getString(R.string.game_sync_err_previous_sd) }
}
storage?.let { check(libraryReadable(File(it.path))) { context.getString(R.string.game_sync_err_game_storage) } }
AddedGames.roots(context).forEach { check(it.host.listFiles() != null) { context.getString(R.string.game_sync_err_added_games) } }
GameFiles.sync(context, folder, Library.launchableGames(context, strictRead = true))
val games = Library.launchableGames(context, strictRead = true)
GameFiles.sync(context, folder, games, keep = AddedGames.unmountedShortcuts(context, games))
prefs(context).edit().putString("storageSetting", storageSetting).putString("storagePath", storage?.path).apply()
}
@@ -144,7 +144,7 @@ object GameFiles {
if (!target.exists()) AtomicFile(target).writeBytes(art.readBytes())
}
@Synchronized fun sync(context: Context, folder: File, games: List<Library.SteamGame>) {
@Synchronized fun sync(context: Context, folder: File, games: List<Library.SteamGame>, keep: Set<String> = emptySet()) {
require(folder.isDirectory) { context.getString(R.string.gfiles_folder_unavailable) }
val inventory = child(context, folder, INVENTORY)
val previous = if (inventory.exists()) {
@@ -168,13 +168,15 @@ object GameFiles {
if (!existed || owned) next.put(file.name, game.gameIdString)
file
}
val kept = keep - unique.map { it.gameIdString }.toSet()
for (name in previous.keys()) {
val id = previous.getString(name)
if (!next.has(name) && ours(name) && GameLaunchLink.validId(id)) {
val file = child(context, folder, name)
if (matches(file, contents(id))) {
val retained = exports.any { java.nio.file.Files.isSameFile(it.toPath(), file.toPath()) }
if (!retained) check(file.delete()) { context.getString(R.string.gfiles_remove_failed, name) }
if (!retained && id in kept) next.put(name, id)
else if (!retained) check(file.delete()) { context.getString(R.string.gfiles_remove_failed, name) }
}
}
}
-1
View File
@@ -1890,7 +1890,6 @@
<string name="game_sync_err_steam_library">مكتبة Steam غير متاحة</string>
<string name="game_sync_err_previous_sd">مكتبة SD السابقة غير متاحة</string>
<string name="game_sync_err_game_storage">مساحة تخزين الألعاب غير متاحة</string>
<string name="game_sync_err_added_games">مجلد الألعاب المضافة غير متاح</string>
<string name="game_sync_err_manifests">ملفات البيان في Steam غير متاحة</string>
<string name="content_system_many">أنظمة متعددة</string>
<string name="fm_drive_internal">التخزين الداخلي</string>
@@ -1903,7 +1903,6 @@
<string name="game_sync_err_steam_library">La biblioteca de Steam no está disponible</string>
<string name="game_sync_err_previous_sd">La biblioteca anterior de la SD no está disponible</string>
<string name="game_sync_err_game_storage">El almacenamiento de juegos no está disponible</string>
<string name="game_sync_err_added_games">La carpeta de juegos agregados no está disponible</string>
<string name="game_sync_err_manifests">Los manifiestos de Steam no están disponibles</string>
<string name="content_system_many">Varios sistemas</string>
<string name="fm_drive_internal">Interno</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Библиотеката на Steam не е достъпна</string>
<string name="game_sync_err_previous_sd">Предишната SD библиотека не е достъпна</string>
<string name="game_sync_err_game_storage">Хранилището за игри не е достъпно</string>
<string name="game_sync_err_added_games">Папката с добавени игри не е достъпна</string>
<string name="game_sync_err_manifests">Манифестите на Steam не са достъпни</string>
<string name="content_system_many">Много системи</string>
<string name="fm_drive_internal">Вътрешна</string>
-1
View File
@@ -1852,7 +1852,6 @@
<string name="game_sync_err_steam_library">Knihovna Steamu není dostupná</string>
<string name="game_sync_err_previous_sd">Předchozí knihovna na SD kartě není dostupná</string>
<string name="game_sync_err_game_storage">Úložiště her není dostupné</string>
<string name="game_sync_err_added_games">Složka přidaných her není dostupná</string>
<string name="game_sync_err_manifests">Manifesty Steamu nejsou dostupné</string>
<string name="content_system_many">Mnoho systémů</string>
<string name="fm_drive_internal">Interní</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam-biblioteket er ikke tilgængeligt</string>
<string name="game_sync_err_previous_sd">Det tidligere SD-bibliotek er ikke tilgængeligt</string>
<string name="game_sync_err_game_storage">Spillagring er ikke tilgængelig</string>
<string name="game_sync_err_added_games">Mappen med tilføjede spil er ikke tilgængelig</string>
<string name="game_sync_err_manifests">Steam-manifester er ikke tilgængelige</string>
<string name="content_system_many">Mange systemer</string>
<string name="fm_drive_internal">Intern</string>
-1
View File
@@ -1806,7 +1806,6 @@
<string name="game_sync_err_steam_library">Steam-Bibliothek ist nicht verfügbar</string>
<string name="game_sync_err_previous_sd">Vorherige SD-Bibliothek ist nicht verfügbar</string>
<string name="game_sync_err_game_storage">Spielspeicher ist nicht verfügbar</string>
<string name="game_sync_err_added_games">Ordner für hinzugefügte Spiele ist nicht verfügbar</string>
<string name="game_sync_err_manifests">Steam-Manifeste sind nicht verfügbar</string>
<string name="content_system_many">Viele Systeme</string>
<string name="fm_drive_internal">Intern</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Η βιβλιοθήκη Steam δεν είναι διαθέσιμη</string>
<string name="game_sync_err_previous_sd">Η προηγούμενη βιβλιοθήκη SD δεν είναι διαθέσιμη</string>
<string name="game_sync_err_game_storage">Ο χώρος αποθήκευσης παιχνιδιών δεν είναι διαθέσιμος</string>
<string name="game_sync_err_added_games">Ο φάκελος προστιθέμενων παιχνιδιών δεν είναι διαθέσιμος</string>
<string name="game_sync_err_manifests">Τα manifest του Steam δεν είναι διαθέσιμα</string>
<string name="content_system_many">Πολλά συστήματα</string>
<string name="fm_drive_internal">Εσωτερική</string>
-1
View File
@@ -1833,7 +1833,6 @@
<string name="game_sync_err_steam_library">La biblioteca de Steam no está disponible</string>
<string name="game_sync_err_previous_sd">La biblioteca anterior de la SD no está disponible</string>
<string name="game_sync_err_game_storage">El almacenamiento de juegos no está disponible</string>
<string name="game_sync_err_added_games">La carpeta de juegos añadidos no está disponible</string>
<string name="game_sync_err_manifests">Los manifiestos de Steam no están disponibles</string>
<string name="content_system_many">Varios sistemas</string>
<string name="fm_drive_internal">Interno</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam-kirjasto ei ole käytettävissä</string>
<string name="game_sync_err_previous_sd">Aiempi SD-kirjasto ei ole käytettävissä</string>
<string name="game_sync_err_game_storage">Pelien tallennustila ei ole käytettävissä</string>
<string name="game_sync_err_added_games">Lisättyjen pelien kansio ei ole käytettävissä</string>
<string name="game_sync_err_manifests">Steam-manifestit eivät ole käytettävissä</string>
<string name="content_system_many">Useita järjestelmiä</string>
<string name="fm_drive_internal">Sisäinen</string>
-1
View File
@@ -1832,7 +1832,6 @@
<string name="game_sync_err_steam_library">La bibliothèque Steam n\'est pas disponible</string>
<string name="game_sync_err_previous_sd">L\'ancienne bibliothèque SD n\'est pas disponible</string>
<string name="game_sync_err_game_storage">Le stockage des jeux n\'est pas disponible</string>
<string name="game_sync_err_added_games">Le dossier des jeux ajoutés n\'est pas disponible</string>
<string name="game_sync_err_manifests">Les manifestes Steam ne sont pas disponibles</string>
<string name="content_system_many">Nombreux systèmes</string>
<string name="fm_drive_internal">Interne</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam लाइब्रेरी उपलब्ध नहीं है</string>
<string name="game_sync_err_previous_sd">पिछली SD लाइब्रेरी उपलब्ध नहीं है</string>
<string name="game_sync_err_game_storage">गेम स्टोरेज उपलब्ध नहीं है</string>
<string name="game_sync_err_added_games">जोड़े गए गेम का फ़ोल्डर उपलब्ध नहीं है</string>
<string name="game_sync_err_manifests">Steam मेनिफ़ेस्ट उपलब्ध नहीं हैं</string>
<string name="content_system_many">कई सिस्टम</string>
<string name="fm_drive_internal">इंटरनल</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">A Steam-könyvtár nem elérhető</string>
<string name="game_sync_err_previous_sd">A korábbi SD-könyvtár nem elérhető</string>
<string name="game_sync_err_game_storage">A játéktárhely nem elérhető</string>
<string name="game_sync_err_added_games">A hozzáadott játékok mappája nem elérhető</string>
<string name="game_sync_err_manifests">A Steam-manifesztek nem elérhetők</string>
<string name="content_system_many">Sok rendszer</string>
<string name="fm_drive_internal">Belső</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">Pustaka Steam tidak tersedia</string>
<string name="game_sync_err_previous_sd">Pustaka SD sebelumnya tidak tersedia</string>
<string name="game_sync_err_game_storage">Penyimpanan gim tidak tersedia</string>
<string name="game_sync_err_added_games">Folder gim yang ditambahkan tidak tersedia</string>
<string name="game_sync_err_manifests">Manifes Steam tidak tersedia</string>
<string name="content_system_many">Banyak sistem</string>
<string name="fm_drive_internal">Internal</string>
-1
View File
@@ -1824,7 +1824,6 @@
<string name="game_sync_err_steam_library">La libreria di Steam non è disponibile</string>
<string name="game_sync_err_previous_sd">La libreria SD precedente non è disponibile</string>
<string name="game_sync_err_game_storage">L\'archivio dei giochi non è disponibile</string>
<string name="game_sync_err_added_games">La cartella dei giochi aggiunti non è disponibile</string>
<string name="game_sync_err_manifests">I manifest di Steam non sono disponibili</string>
<string name="content_system_many">Molti sistemi</string>
<string name="fm_drive_internal">Interna</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">Steamライブラリを利用できません</string>
<string name="game_sync_err_previous_sd">以前のSDライブラリを利用できません</string>
<string name="game_sync_err_game_storage">ゲームストレージを利用できません</string>
<string name="game_sync_err_added_games">追加したゲームのフォルダを利用できません</string>
<string name="game_sync_err_manifests">Steamのマニフェストを利用できません</string>
<string name="content_system_many">多数のシステム</string>
<string name="fm_drive_internal">内部</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">Steam 라이브러리를 사용할 수 없습니다</string>
<string name="game_sync_err_previous_sd">이전 SD 라이브러리를 사용할 수 없습니다</string>
<string name="game_sync_err_game_storage">게임 저장 공간을 사용할 수 없습니다</string>
<string name="game_sync_err_added_games">추가된 게임 폴더를 사용할 수 없습니다</string>
<string name="game_sync_err_manifests">Steam 매니페스트를 사용할 수 없습니다</string>
<string name="content_system_many">다양한 기종</string>
<string name="fm_drive_internal">내부</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">Pustaka Steam tidak tersedia</string>
<string name="game_sync_err_previous_sd">Pustaka SD terdahulu tidak tersedia</string>
<string name="game_sync_err_game_storage">Storan permainan tidak tersedia</string>
<string name="game_sync_err_added_games">Folder permainan yang ditambah tidak tersedia</string>
<string name="game_sync_err_manifests">Manifest Steam tidak tersedia</string>
<string name="content_system_many">Banyak sistem</string>
<string name="fm_drive_internal">Dalaman</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam-biblioteket er ikke tilgjengelig</string>
<string name="game_sync_err_previous_sd">Det forrige SD-biblioteket er ikke tilgjengelig</string>
<string name="game_sync_err_game_storage">Spillagringen er ikke tilgjengelig</string>
<string name="game_sync_err_added_games">Mappen for tillagte spill er ikke tilgjengelig</string>
<string name="game_sync_err_manifests">Steam-manifestene er ikke tilgjengelige</string>
<string name="content_system_many">Mange systemer</string>
<string name="fm_drive_internal">Intern</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam-bibliotheek is niet beschikbaar</string>
<string name="game_sync_err_previous_sd">Vorige SD-bibliotheek is niet beschikbaar</string>
<string name="game_sync_err_game_storage">Gameopslag is niet beschikbaar</string>
<string name="game_sync_err_added_games">Map met toegevoegde games is niet beschikbaar</string>
<string name="game_sync_err_manifests">Steam-manifesten zijn niet beschikbaar</string>
<string name="content_system_many">Veel systemen</string>
<string name="fm_drive_internal">Intern</string>
-1
View File
@@ -1852,7 +1852,6 @@
<string name="game_sync_err_steam_library">Biblioteka Steam jest niedostępna</string>
<string name="game_sync_err_previous_sd">Poprzednia biblioteka na karcie SD jest niedostępna</string>
<string name="game_sync_err_game_storage">Miejsce na gry jest niedostępne</string>
<string name="game_sync_err_added_games">Folder dodanych gier jest niedostępny</string>
<string name="game_sync_err_manifests">Manifesty Steam są niedostępne</string>
<string name="content_system_many">Wiele systemów</string>
<string name="fm_drive_internal">Wewnętrzna</string>
@@ -1838,7 +1838,6 @@
<string name="game_sync_err_steam_library">A biblioteca do Steam não está disponível</string>
<string name="game_sync_err_previous_sd">A biblioteca anterior do cartão SD não está disponível</string>
<string name="game_sync_err_game_storage">O armazenamento de jogos não está disponível</string>
<string name="game_sync_err_added_games">A pasta de jogos adicionados não está disponível</string>
<string name="game_sync_err_manifests">Os manifestos do Steam não estão disponíveis</string>
<string name="content_system_many">Vários sistemas</string>
<string name="fm_drive_internal">Interno</string>
-1
View File
@@ -1846,7 +1846,6 @@
<string name="game_sync_err_steam_library">A biblioteca do Steam não está disponível</string>
<string name="game_sync_err_previous_sd">A biblioteca anterior no cartão SD não está disponível</string>
<string name="game_sync_err_game_storage">O armazenamento de jogos não está disponível</string>
<string name="game_sync_err_added_games">A pasta de jogos adicionados não está disponível</string>
<string name="game_sync_err_manifests">Os manifestos do Steam não estão disponíveis</string>
<string name="content_system_many">Vários sistemas</string>
<string name="fm_drive_internal">Interno</string>
-1
View File
@@ -1833,7 +1833,6 @@
<string name="game_sync_err_steam_library">Biblioteca Steam nu este disponibilă</string>
<string name="game_sync_err_previous_sd">Biblioteca SD anterioară nu este disponibilă</string>
<string name="game_sync_err_game_storage">Stocarea jocurilor nu este disponibilă</string>
<string name="game_sync_err_added_games">Folderul de jocuri adăugate nu este disponibil</string>
<string name="game_sync_err_manifests">Manifestele Steam nu sunt disponibile</string>
<string name="content_system_many">Multe sisteme</string>
<string name="fm_drive_internal">Internă</string>
-1
View File
@@ -1853,7 +1853,6 @@
<string name="game_sync_err_steam_library">Библиотека Steam недоступна</string>
<string name="game_sync_err_previous_sd">Предыдущая библиотека на SD-карте недоступна</string>
<string name="game_sync_err_game_storage">Хранилище игр недоступно</string>
<string name="game_sync_err_added_games">Папка добавленных игр недоступна</string>
<string name="game_sync_err_manifests">Манифесты Steam недоступны</string>
<string name="content_system_many">Множество систем</string>
<string name="fm_drive_internal">Внутреннее хранилище</string>
-1
View File
@@ -1814,7 +1814,6 @@
<string name="game_sync_err_steam_library">Steam-biblioteket är inte tillgängligt</string>
<string name="game_sync_err_previous_sd">Det tidigare SD-biblioteket är inte tillgängligt</string>
<string name="game_sync_err_game_storage">Spellagringen är inte tillgänglig</string>
<string name="game_sync_err_added_games">Mappen för tillagda spel är inte tillgänglig</string>
<string name="game_sync_err_manifests">Steam-manifesten är inte tillgängliga</string>
<string name="content_system_many">Många system</string>
<string name="fm_drive_internal">Internt</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">ไลบรารี Steam ไม่พร้อมใช้งาน</string>
<string name="game_sync_err_previous_sd">ไลบรารี SD ก่อนหน้าไม่พร้อมใช้งาน</string>
<string name="game_sync_err_game_storage">พื้นที่จัดเก็บเกมไม่พร้อมใช้งาน</string>
<string name="game_sync_err_added_games">โฟลเดอร์เกมที่เพิ่มไม่พร้อมใช้งาน</string>
<string name="game_sync_err_manifests">ไฟล์ manifest ของ Steam ไม่พร้อมใช้งาน</string>
<string name="content_system_many">หลายระบบ</string>
<string name="fm_drive_internal">ภายใน</string>
-1
View File
@@ -1806,7 +1806,6 @@
<string name="game_sync_err_steam_library">Steam kütüphanesi kullanılamıyor</string>
<string name="game_sync_err_previous_sd">Önceki SD kütüphanesi kullanılamıyor</string>
<string name="game_sync_err_game_storage">Oyun depolama alanı kullanılamıyor</string>
<string name="game_sync_err_added_games">Eklenen oyunlar klasörü kullanılamıyor</string>
<string name="game_sync_err_manifests">Steam manifest dosyaları kullanılamıyor</string>
<string name="content_system_many">Birçok sistem</string>
<string name="fm_drive_internal">Dahili</string>
-1
View File
@@ -1852,7 +1852,6 @@
<string name="game_sync_err_steam_library">Бібліотека Steam недоступна</string>
<string name="game_sync_err_previous_sd">Попередня бібліотека на SD-карті недоступна</string>
<string name="game_sync_err_game_storage">Сховище ігор недоступне</string>
<string name="game_sync_err_added_games">Папка доданих ігор недоступна</string>
<string name="game_sync_err_manifests">Маніфести Steam недоступні</string>
<string name="content_system_many">Багато систем</string>
<string name="fm_drive_internal">Внутрішня пам’ять</string>
-1
View File
@@ -1796,7 +1796,6 @@
<string name="game_sync_err_steam_library">Thư viện Steam không khả dụng</string>
<string name="game_sync_err_previous_sd">Thư viện SD trước đó không khả dụng</string>
<string name="game_sync_err_game_storage">Lưu trữ game không khả dụng</string>
<string name="game_sync_err_added_games">Thư mục game đã thêm không khả dụng</string>
<string name="game_sync_err_manifests">Manifest của Steam không khả dụng</string>
<string name="content_system_many">Nhiều hệ máy</string>
<string name="fm_drive_internal">Nội bộ</string>
@@ -1873,7 +1873,6 @@
<string name="game_sync_err_steam_library">Steam 库不可用</string>
<string name="game_sync_err_previous_sd">之前的 SD 卡库不可用</string>
<string name="game_sync_err_game_storage">游戏存储不可用</string>
<string name="game_sync_err_added_games">已添加游戏的文件夹不可用</string>
<string name="game_sync_err_manifests">Steam 清单文件不可用</string>
<string name="content_system_many">多种平台</string>
<string name="fm_drive_internal">内部存储</string>
@@ -1795,7 +1795,6 @@
<string name="game_sync_err_steam_library">無法使用 Steam 收藏庫</string>
<string name="game_sync_err_previous_sd">無法使用先前的 SD 卡收藏庫</string>
<string name="game_sync_err_game_storage">無法使用遊戲儲存位置</string>
<string name="game_sync_err_added_games">無法使用已新增遊戲的資料夾</string>
<string name="game_sync_err_manifests">無法使用 Steam 清單檔案</string>
<string name="content_system_many">多個系統</string>
<string name="fm_drive_internal">內部</string>
@@ -1795,7 +1795,6 @@
<string name="game_sync_err_steam_library">無法使用 Steam 收藏庫</string>
<string name="game_sync_err_previous_sd">無法使用先前的 SD 卡收藏庫</string>
<string name="game_sync_err_game_storage">無法使用遊戲儲存空間</string>
<string name="game_sync_err_added_games">無法使用已新增遊戲的資料夾</string>
<string name="game_sync_err_manifests">無法使用 Steam 資訊清單</string>
<string name="content_system_many">多種主機</string>
<string name="fm_drive_internal">內部</string>
-1
View File
@@ -2054,7 +2054,6 @@
<string name="game_sync_err_steam_library">Steam library is unavailable</string>
<string name="game_sync_err_previous_sd">Previous SD library is unavailable</string>
<string name="game_sync_err_game_storage">Game storage is unavailable</string>
<string name="game_sync_err_added_games">Added games folder is unavailable</string>
<string name="game_sync_err_manifests">Steam manifests are unavailable</string>
<string name="content_system_many">Many systems</string>
<string name="fm_drive_internal">Internal</string>
@@ -72,6 +72,61 @@ class GameFileSyncTest {
GameFileSync.disable(context)
}
@Test fun unmountedAddedGamesKeepTheirFilesWithoutStoppingTheSync() {
val context = RuntimeEnvironment.getApplication()
val root = LinuxRuntime.rootDir(context)
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/")).forEach { path ->
File(root, path).apply { parentFile!!.mkdirs(); writeText("") }
}
AddonPack.PROOT.file(context, AddonPack.COMPLETE).apply { parentFile!!.mkdirs(); writeText("") }
SessionPrefs.setGameStorage(context, SessionPrefs.GAME_STORAGE_OFF, "")
SessionPrefs.setAddedGamesDirs(context, emptyList())
val steamapps = File(root, "root/.local/share/Steam/steamapps").apply { mkdirs() }
val manifest = File(steamapps, "appmanifest_8400.acf").apply {
writeText("\"AppState\"\n{\n\"name\" \"Geometry Wars\"\n\"StateFlags\" \"4\"\n}")
}
val card = File(context.filesDir, "old-card/Games")
val solo = File(context.filesDir, "old-card/Solo")
SessionPrefs.setGameFolderBinds(context, listOf(card.path to "${AddedGames.GUEST_DIR}/Games", solo.path to "${AddedGames.GUEST_DIR}/Solo"))
val shortcuts = listOf("Card Game" to 0xC0FFEE01L, "Card Removed" to 0xC0FFEE02L, "Card Copy" to 0xC0FFEE03L, "Solo" to 0xC0FFEE04L).map { (name, appId) ->
val dir = if (name == "Solo") solo else File(card, name)
AddedExes.put(context, AddedExes.Entry(dir.path, File(dir, "game.exe").path))
SessionPrefs.addedGameAppId(context, dir.path, appId)
Library.SteamGame(0, name, null, Library.ADDED, (appId shl 32) or 0x02000000L, gameFiles = dir)
}
val (kept, removed, copied, single) = shortcuts
val folder = File(context.filesDir, "exports-added").apply { mkdirs() }
GameFileSync.enable(context, folder)
assertEquals(folder.path, GameFileSync.folder(context))
assertEquals("8400", File(folder, "Geometry Wars.steam").readText())
GameFiles.sync(context, folder, Library.launchableGames(context, strictRead = true) + shortcuts)
shortcuts.forEach { assertEquals(it.gameIdString, File(folder, "${it.name}.steam").readText()) }
SessionPrefs.setAddedGameRemoved(context, removed.gameFiles!!.path, true)
assertTrue(manifest.delete())
File(steamapps, "appmanifest_620.acf").writeText("\"AppState\"\n{\n\"name\" \"Portal 2\"\n\"StateFlags\" \"4\"\n}")
GameFileSync.syncConfigured(context)
assertEquals("620", File(folder, "Portal 2.steam").readText())
assertFalse(File(folder, "Geometry Wars.steam").exists())
assertEquals(kept.gameIdString, File(folder, "Card Game.steam").readText())
assertEquals(copied.gameIdString, File(folder, "Card Copy.steam").readText())
assertEquals(single.gameIdString, File(folder, "Solo.steam").readText())
assertFalse(File(folder, "Card Removed.steam").exists())
val copy = Library.SteamGame(0, "Card Copy", null, Library.ADDED, (0xBEEF0003L shl 32) or 0x02000000L,
gameFiles = File(context.filesDir, "new-card/Games/Card Copy"))
val steamCopy = Library.SteamGame(8400, "Card Game", null, "internal", gameFiles = File(context.filesDir, "steam/Card Game"))
assertEquals(setOf(kept.gameIdString, single.gameIdString), AddedGames.unmountedShortcuts(context, listOf(copy, steamCopy)))
assertTrue(card.mkdirs())
assertEquals(setOf(single.gameIdString), AddedGames.unmountedShortcuts(context, emptyList()))
assertTrue(solo.mkdirs())
assertEquals(emptySet<String>(), AddedGames.unmountedShortcuts(context, emptyList()))
GameFileSync.syncConfigured(context)
shortcuts.forEach { assertFalse(File(folder, "${it.name}.steam").exists()) }
assertTrue(File(folder, "Portal 2.steam").isFile)
GameFileSync.disable(context)
shortcuts.forEach { AddedExes.drop(context, it.gameFiles!!.path) }
SessionPrefs.setGameFolderBinds(context, emptyList())
}
@Test fun libraryReadableOnlyWhenListableOrNotCreatedOnPresentParent() {
val base = File(RuntimeEnvironment.getApplication().filesDir, "readable").apply { mkdirs() }
assertTrue(GameFileSync.libraryReadable(File(base, "dir").apply { mkdirs() }))
@@ -142,6 +142,35 @@ class GameFilesTest {
assertEquals("user edit", modified.readText())
}
@Test fun syncKeepsOnlyVanishedGamesItIsAskedToKeep() {
val folder = tmp.newFolder()
val steam = game()
val second = game("620", "Portal 2")
val shortcut = game(java.lang.Long.toUnsignedString((0xC0FFEE01L shl 32) or 0x02000000L), "Card Game")
val dropped = game(java.lang.Long.toUnsignedString((0xC0FFEE03L shl 32) or 0x02000000L), "Card Removed")
val moved = game(java.lang.Long.toUnsignedString((0xC0FFEE02L shl 32) or 0x02000000L), "Card Tool")
GameFiles.sync(app, folder, listOf(steam, second, shortcut, dropped, moved))
val renamed = game("620", "Portal 2 Remastered")
val third = game("1", "New install")
val movedRenamed = game(moved.gameIdString, "Card Tool Deluxe")
val keep = setOf(steam.gameIdString, shortcut.gameIdString, moved.gameIdString)
GameFiles.sync(app, folder, listOf(renamed, third, movedRenamed), keep = keep)
assertEquals("8400", File(folder, GameFiles.filename(steam)).readText())
assertEquals(shortcut.gameIdString, File(folder, GameFiles.filename(shortcut)).readText())
assertFalse(File(folder, GameFiles.filename(dropped)).exists())
assertFalse(File(folder, GameFiles.filename(second)).exists())
assertFalse(File(folder, GameFiles.filename(moved)).exists())
assertEquals("620", File(folder, GameFiles.filename(renamed)).readText())
assertEquals("1", File(folder, GameFiles.filename(third)).readText())
assertEquals(moved.gameIdString, File(folder, GameFiles.filename(movedRenamed)).readText())
GameFiles.sync(app, folder, listOf(renamed, third, movedRenamed))
assertFalse(File(folder, GameFiles.filename(steam)).exists())
assertFalse(File(folder, GameFiles.filename(shortcut)).exists())
assertTrue(File(folder, GameFiles.filename(renamed)).isFile)
assertTrue(File(folder, GameFiles.filename(third)).isFile)
assertTrue(File(folder, GameFiles.filename(movedRenamed)).isFile)
}
@Test fun failedExportDoesNotPruneOldInventoryAndNeverOverwritesCollisions() {
val folder = tmp.newFolder()
val first = game()
+19
View File
@@ -425,3 +425,22 @@ at a pointer that never left the top-left corner. Steam picks Disabled for some
cursor followed the mouse while every click landed at (0,0). In Disabled the nested pointer now warps the X pointer as
in the other modes; real fingers are still ignored. `tools/tests/test_gamescope_disabled_touch_mouse.py` compiles the
branch from this patch.
## 0142 Steam is entered at the corner it is reset to
When Steam's window takes focus with `bResetToCorner`, gamescope parks the pointer in its bottom-right corner so
nothing in Big Picture is hovered and the controller owns the UI. Upstream fe7f21c (3.16.24) moved
`wlserver_mousefocus` ahead of that reset, so the window is first entered under the current pointer, then warped to
its centre (`wlserver_mousewarp`, synthetic), then moved to the corner. SteamOS's 3.16.23 still resets before focus,
so its motions reach no window and the X pointer stays at (0,0). On upstream 3.16.29 they reach Steam: on a Steam Deck
the pointer is at (1279,799) right after focus. The Deck shows no hover because Big Picture's page exists about 1 s
before the reset. On a Retroid Pocket Duo the page is created at the same moment, Chromium keeps the centre position
as its hover, and the second library tile stayed highlighted on every start (4 of 4).
Steam is now entered at the corner. The centre is still stored in `mouse_surface_cursorx/y`, so the gamepad cursor
starts there as before, but no motion is sent for it. The fake pointer position stays in the corner. Only the
`bResetToCorner` path changes. Other windows are entered under the pointer as upstream does.
With the patch, the Duo starts with only the bottom bar under the parked pointer hovered and controller focus on the
first tile (4 of 4 starts), and returns from a game the same way (3 of 3). Making 0100 ignore the X server's initial
pointer instead was tried and rejected: the centre motion still arrived, and the header or search bar ended up hovered.
@@ -0,0 +1,31 @@
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -5790,7 +5790,16 @@
if ( win_surface(pFocus->inputFocusWindow) != nullptr && pFocus->cursor )
{
- wlserver_mousefocus( pFocus->inputFocusWindow->main_surface(), pFocus->cursor->x(), pFocus->cursor->y() );
+ int nEnterX = pFocus->cursor->x();
+ int nEnterY = pFocus->cursor->y();
+ // A window reset to the corner below must not first be entered under the cursor:
+ // a page that loads during the reset keeps that position as its hover.
+ if ( pFocus->inputFocusWindow->GetFocus()->bResetToCorner )
+ {
+ nEnterX = pFocus->inputFocusWindow->GetGeometry().nWidth - 1;
+ nEnterY = pFocus->inputFocusWindow->GetGeometry().nHeight - 1;
+ }
+ wlserver_mousefocus( pFocus->inputFocusWindow->main_surface(), nEnterX, nEnterY );
focus_log.debugf( "Setting mouse focus to: %s (%x)", pFocus->inputFocusWindow->debug_name(), pFocus->inputFocusWindow->id() );
}
@@ -5813,7 +5822,8 @@
if ( pFocus->inputFocusWindow->GetFocus()->bResetToCorner )
{
wlserver_lock();
- wlserver_mousewarp( pFocus->inputFocusWindow->GetGeometry().nWidth / 2, pFocus->inputFocusWindow->GetGeometry().nHeight / 2, 0, true );
+ wlserver.mouse_surface_cursorx = pFocus->inputFocusWindow->GetGeometry().nWidth / 2;
+ wlserver.mouse_surface_cursory = pFocus->inputFocusWindow->GetGeometry().nHeight / 2;
wlserver_fake_mouse_pos( pFocus->inputFocusWindow->GetGeometry().nWidth - 1, pFocus->inputFocusWindow->GetGeometry().nHeight - 1 );
wlserver_unlock();
}