Compare commits

...

2 commits

Author SHA1 Message Date
lizzie
c5b519380c
[externals] update renderdoc to 1.7.0 (#3751)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3751
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2026-03-22 04:00:57 +01:00
xbzk
5ebdb29afd
[android,ui] feat fullscreen app setting (#3676)
why not? i like it a lot on both phone and TV.
toggle in app settings. disabled by default so no hassle.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3676
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: xbzk <xbzk@eden-emu.dev>
Co-committed-by: xbzk <xbzk@eden-emu.dev>
2026-03-22 02:06:45 +01:00
14 changed files with 377 additions and 27 deletions

View file

@ -7,7 +7,7 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2025 Baldur Karlsson
* Copyright (c) 2015-2026 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -72,6 +72,10 @@ extern "C" {
// truncated version when only a uint64_t is available (e.g. Vulkan tags):
#define RENDERDOC_ShaderDebugMagicValue_truncated 0x48656670eab25520ULL
// this is a magic value for vulkan user tags to indicate which dispatchable API objects are which
// for object annotations
#define RENDERDOC_APIObjectAnnotationHelper 0xfbb3b337b664d0adULL
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc capture options
//
@ -564,6 +568,128 @@ typedef uint32_t(RENDERDOC_CC *pRENDERDOC_DiscardFrameCapture)(RENDERDOC_DeviceP
// multiple times only the last title will be used.
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title);
// Annotations API:
//
// These functions allow you to specify annotations either on a per-command level, or a per-object
// level.
//
// Basic types of annotations are supported, as well as vector versions and references to API objects.
//
// The annotations are stored as keys, with the key being a dot-separated path allowing arbitrary
// nesting and user organisation. The keys are sorted in human order so `foo.2.bar` will be displayed
// before `foo.10.bar` to allow creation of arrays if desired.
//
// Deleting an annotation can be done by assigning an empty value to it.
// the type of an annotation value, or Empty to delete an annotation
typedef enum RENDERDOC_AnnotationType
{
eRENDERDOC_Empty,
eRENDERDOC_Bool,
eRENDERDOC_Int32,
eRENDERDOC_UInt32,
eRENDERDOC_Int64,
eRENDERDOC_UInt64,
eRENDERDOC_Float,
eRENDERDOC_Double,
eRENDERDOC_String,
eRENDERDOC_APIObject,
eRENDERDOC_AnnotationMax = 0x7FFFFFFF,
} RENDERDOC_AnnotationType;
// a union with vector annotation value data
typedef union RENDERDOC_AnnotationVectorValue
{
bool boolean[4];
int32_t int32[4];
int64_t int64[4];
uint32_t uint32[4];
uint64_t uint64[4];
float float32[4];
double float64[4];
} RENDERDOC_AnnotationVectorValue;
// a union with scalar annotation value data
typedef union RENDERDOC_AnnotationValue
{
bool boolean;
int32_t int32;
int64_t int64;
uint32_t uint32;
uint64_t uint64;
float float32;
double float64;
RENDERDOC_AnnotationVectorValue vector;
const char *string;
void *apiObject;
} RENDERDOC_AnnotationValue;
// a struct for specifying a GL object, as we don't have pointers we can use so instead we specify a
// pointer to this struct giving both the type and the name
typedef struct RENDERDOC_GLResourceReference
{
// this is the same GLenum identifier as passed to glObjectLabel
uint32_t identifier;
uint32_t name;
} GLResourceReference;
// simple C++ helpers to avoid the need for a temporary objects for value passing and GL object specification
#ifdef __cplusplus
struct RDGLObjectHelper
{
RENDERDOC_GLResourceReference gl;
RDGLObjectHelper(uint32_t identifier, uint32_t name)
{
gl.identifier = identifier;
gl.name = name;
}
operator RENDERDOC_GLResourceReference *() { return &gl; }
};
struct RDAnnotationHelper
{
RENDERDOC_AnnotationValue val;
RDAnnotationHelper(bool b) { val.boolean = b; }
RDAnnotationHelper(int32_t i) { val.int32 = i; }
RDAnnotationHelper(int64_t i) { val.int64 = i; }
RDAnnotationHelper(uint32_t i) { val.uint32 = i; }
RDAnnotationHelper(uint64_t i) { val.uint64 = i; }
RDAnnotationHelper(float f) { val.float32 = f; }
RDAnnotationHelper(double d) { val.float64 = d; }
RDAnnotationHelper(const char *s) { val.string = s; }
operator RENDERDOC_AnnotationValue *() { return &val; }
};
#endif
// The device is specified in the same way as other API calls that take a RENDERDOC_DevicePointer
// to specify the device.
//
// The object or queue/commandbuffer will depend on the graphics API in question.
//
// Return value:
// 0 - The annotation was applied successfully.
// 1 - The device is unknown/invalid
// 2 - The device is valid but the annotation is not supported for API-specific reasons, such as an
// unrecognised or invalid object or queue/commandbuffer
// 3 - The call is ill-formed or invalid e.g. empty is specified with a value pointer, or non-empty
// is specified with a NULL value pointer
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_SetObjectAnnotation)(RENDERDOC_DevicePointer device,
void *object, const char *key,
RENDERDOC_AnnotationType valueType,
uint32_t valueVectorWidth,
const RENDERDOC_AnnotationValue *value);
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_SetCommandAnnotation)(
RENDERDOC_DevicePointer device, void *queueOrCommandBuffer, const char *key,
RENDERDOC_AnnotationType valueType, uint32_t valueVectorWidth,
const RENDERDOC_AnnotationValue *value);
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API versions
//
@ -592,6 +718,7 @@ typedef enum RENDERDOC_Version
eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02
eRENDERDOC_API_Version_1_5_0 = 10500, // RENDERDOC_API_1_5_0 = 1 05 00
eRENDERDOC_API_Version_1_6_0 = 10600, // RENDERDOC_API_1_6_0 = 1 06 00
eRENDERDOC_API_Version_1_7_0 = 10700, // RENDERDOC_API_1_7_0 = 1 07 00
} RENDERDOC_Version;
// API version changelog:
@ -622,8 +749,10 @@ typedef enum RENDERDOC_Version
// 1.5.0 - Added feature: ShowReplayUI() to request that the replay UI show itself if connected
// 1.6.0 - Added feature: SetCaptureTitle() which can be used to set a title for a
// capture made with StartFrameCapture() or EndFrameCapture()
// 1.7.0 - Added feature: SetObjectAnnotation() / SetCommandAnnotation() for adding rich
// annotations to objects and command streams
typedef struct RENDERDOC_API_1_6_0
typedef struct RENDERDOC_API_1_7_0
{
pRENDERDOC_GetAPIVersion GetAPIVersion;
@ -701,20 +830,25 @@ typedef struct RENDERDOC_API_1_6_0
// new function in 1.6.0
pRENDERDOC_SetCaptureTitle SetCaptureTitle;
} RENDERDOC_API_1_6_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_2_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_3_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_5_0;
// new functions in 1.7.0
pRENDERDOC_SetObjectAnnotation SetObjectAnnotation;
pRENDERDOC_SetCommandAnnotation SetCommandAnnotation;
} RENDERDOC_API_1_7_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_0_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_0_1;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_0_2;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_1_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_1_1;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_1_2;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_2_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_3_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_4_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_4_1;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_4_2;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_5_0;
typedef RENDERDOC_API_1_7_0 RENDERDOC_API_1_6_0;
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API entry point

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.dialogs
@ -20,6 +20,8 @@ import org.yuzu.yuzu_emu.databinding.DialogChatBinding
import org.yuzu.yuzu_emu.databinding.ItemChatMessageBinding
import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.network.NetPlayManager
import org.yuzu.yuzu_emu.utils.CompatUtils
import org.yuzu.yuzu_emu.utils.FullscreenHelper
import java.text.SimpleDateFormat
import java.util.*
@ -34,6 +36,13 @@ class ChatDialog(context: Context) : BottomSheetDialog(context) {
private lateinit var binding: DialogChatBinding
private lateinit var chatAdapter: ChatAdapter
private val handler = Handler(Looper.getMainLooper())
private val hideSystemBars: Boolean by lazy {
runCatching {
FullscreenHelper.shouldHideSystemBars(CompatUtils.findActivity(context))
}.getOrElse {
FullscreenHelper.isFullscreenEnabled(context)
}
}
// TODO(alekpop, crueter): Top drawer for message notifications, perhaps use system notifs?
// TODO(alekpop, crueter): Context menu actions for chat users
@ -41,6 +50,7 @@ class ChatDialog(context: Context) : BottomSheetDialog(context) {
@SuppressLint("NotifyDataSetChanged")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setOnShowListener { applyFullscreenMode() }
binding = DialogChatBinding.inflate(LayoutInflater.from(context))
setContentView(binding.root)
@ -75,6 +85,11 @@ class ChatDialog(context: Context) : BottomSheetDialog(context) {
}
}
override fun onStart() {
super.onStart()
applyFullscreenMode()
}
override fun dismiss() {
NetPlayManager.setChatOpen(false)
super.dismiss()
@ -108,6 +123,12 @@ class ChatDialog(context: Context) : BottomSheetDialog(context) {
private fun scrollToBottom() {
binding.chatRecyclerView.scrollToPosition(chatAdapter.itemCount - 1)
}
private fun applyFullscreenMode() {
window?.let { window ->
FullscreenHelper.applyToWindow(window, hideSystemBars)
}
}
}
class ChatAdapter(private val messages: List<ChatMessage>) :

View file

@ -31,15 +31,25 @@ import org.yuzu.yuzu_emu.databinding.DialogLobbyBrowserBinding
import org.yuzu.yuzu_emu.databinding.ItemLobbyRoomBinding
import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.network.NetPlayManager
import org.yuzu.yuzu_emu.utils.CompatUtils
import org.yuzu.yuzu_emu.utils.FullscreenHelper
import java.util.Locale
class LobbyBrowser(context: Context) : BottomSheetDialog(context) {
private lateinit var binding: DialogLobbyBrowserBinding
private lateinit var adapter: LobbyRoomAdapter
private val handler = Handler(Looper.getMainLooper())
private val hideSystemBars: Boolean by lazy {
runCatching {
FullscreenHelper.shouldHideSystemBars(CompatUtils.findActivity(context))
}.getOrElse {
FullscreenHelper.isFullscreenEnabled(context)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setOnShowListener { applyFullscreenMode() }
behavior.state = BottomSheetBehavior.STATE_EXPANDED
behavior.skipCollapsed =
@ -81,6 +91,7 @@ class LobbyBrowser(context: Context) : BottomSheetDialog(context) {
behavior.expandedOffset = 0
behavior.skipCollapsed = true
behavior.state = BottomSheetBehavior.STATE_EXPANDED
applyFullscreenMode()
}
private fun setupRecyclerView() {
@ -274,4 +285,10 @@ class LobbyBrowser(context: Context) : BottomSheetDialog(context) {
}
private inner class ScoreItem(val score: Double, val item: NetPlayManager.RoomInfo)
private fun applyFullscreenMode() {
window?.let { window ->
FullscreenHelper.applyToWindow(window, hideSystemBars)
}
}
}

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.dialogs
@ -36,6 +36,7 @@ import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.network.NetDataValidators
import org.yuzu.yuzu_emu.network.NetPlayManager
import org.yuzu.yuzu_emu.utils.CompatUtils
import org.yuzu.yuzu_emu.utils.FullscreenHelper
import org.yuzu.yuzu_emu.utils.GameHelper
class NetPlayDialog(context: Context) : BottomSheetDialog(context) {
@ -43,9 +44,17 @@ class NetPlayDialog(context: Context) : BottomSheetDialog(context) {
private val gameNameList: MutableList<Array<String>> = mutableListOf()
private val gameIdList: MutableList<Array<Long>> = mutableListOf()
private val hideSystemBars: Boolean by lazy {
runCatching {
FullscreenHelper.shouldHideSystemBars(CompatUtils.findActivity(context))
}.getOrElse {
FullscreenHelper.isFullscreenEnabled(context)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setOnShowListener { applyFullscreenMode() }
behavior.state = BottomSheetBehavior.STATE_EXPANDED
behavior.state = BottomSheetBehavior.STATE_EXPANDED
@ -118,6 +127,11 @@ class NetPlayDialog(context: Context) : BottomSheetDialog(context) {
}
}
override fun onStart() {
super.onStart()
applyFullscreenMode()
}
data class NetPlayItems(
val option: Int,
val name: String,
@ -352,6 +366,11 @@ class NetPlayDialog(context: Context) : BottomSheetDialog(context) {
TextValidatorWatcher.validStates.clear()
val activity = CompatUtils.findActivity(context)
val dialog = BottomSheetDialog(activity)
dialog.setOnShowListener {
dialog.window?.let { window ->
FullscreenHelper.applyToWindow(window, hideSystemBars)
}
}
dialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
dialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
@ -582,6 +601,12 @@ class NetPlayDialog(context: Context) : BottomSheetDialog(context) {
dialog.show()
}
private fun applyFullscreenMode() {
window?.let { window ->
FullscreenHelper.applyToWindow(window, hideSystemBars)
}
}
private fun showModerationDialog() {
val activity = CompatUtils.findActivity(context)
val dialog = MaterialAlertDialogBuilder(activity)

View file

@ -104,6 +104,8 @@ object Settings {
const val PREF_THEME_MODE = "ThemeMode"
const val PREF_BLACK_BACKGROUNDS = "BlackBackgrounds"
const val PREF_STATIC_THEME_COLOR = "StaticThemeColor"
const val PREF_APP_FULLSCREEN = "AppFullscreen"
const val APP_FULLSCREEN_DEFAULT = false
enum class EmulationOrientation(val int: Int) {
Unspecified(0),

View file

@ -103,6 +103,7 @@ class SettingsActivity : AppCompatActivity() {
)
setInsets()
applyFullscreenPreference()
}
fun navigateBack() {
@ -122,6 +123,18 @@ class SettingsActivity : AppCompatActivity() {
}
}
override fun onResume() {
super.onResume()
applyFullscreenPreference()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
applyFullscreenPreference()
}
}
override fun onStop() {
super.onStop()
Log.info("[SettingsActivity] Settings activity stopping. Saving settings to INI...")
@ -188,4 +201,8 @@ class SettingsActivity : AppCompatActivity() {
windowInsets
}
}
private fun applyFullscreenPreference() {
FullscreenHelper.applyToActivity(this)
}
}

View file

@ -29,6 +29,8 @@ import org.yuzu.yuzu_emu.features.settings.model.view.*
import org.yuzu.yuzu_emu.utils.InputHandler
import org.yuzu.yuzu_emu.utils.NativeConfig
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.FullscreenHelper
import androidx.core.content.edit
import androidx.fragment.app.FragmentActivity
import org.yuzu.yuzu_emu.fragments.MessageDialogFragment
@ -1187,6 +1189,39 @@ class SettingsFragmentPresenter(
)
)
val fullscreenSetting: AbstractBooleanSetting = object : AbstractBooleanSetting {
override fun getBoolean(needsGlobal: Boolean): Boolean =
FullscreenHelper.isFullscreenEnabled(context)
override fun setBoolean(value: Boolean) {
FullscreenHelper.setFullscreenEnabled(context, value)
settingsViewModel.setShouldRecreate(true)
}
override val key: String = Settings.PREF_APP_FULLSCREEN
override val isRuntimeModifiable: Boolean = true
override val pairedSettingKey: String = ""
override val isSwitchable: Boolean = false
override var global: Boolean = true
override val isSaveable: Boolean = true
override val defaultValue: Boolean = Settings.APP_FULLSCREEN_DEFAULT
override fun getValueAsString(needsGlobal: Boolean): String =
getBoolean(needsGlobal).toString()
override fun reset() {
setBoolean(defaultValue)
}
}
add(
SwitchSetting(
fullscreenSetting,
titleId = R.string.fullscreen_mode,
descriptionId = R.string.fullscreen_mode_description
)
)
add(HeaderSetting(R.string.buttons))
add(BooleanSetting.ENABLE_FOLDER_BUTTON.key)
add(BooleanSetting.ENABLE_QLAUNCH_BUTTON.key)

View file

@ -20,6 +20,7 @@ import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.YuzuApplication
import org.yuzu.yuzu_emu.databinding.ActivitySettingsBinding
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.FullscreenHelper
import org.yuzu.yuzu_emu.utils.InsetsHelper
import org.yuzu.yuzu_emu.utils.ThemeHelper
@ -89,6 +90,7 @@ class SettingsSubscreenActivity : AppCompatActivity() {
)
setInsets()
applyFullscreenPreference()
}
override fun onStart() {
@ -98,6 +100,18 @@ class SettingsSubscreenActivity : AppCompatActivity() {
}
}
override fun onResume() {
super.onResume()
applyFullscreenPreference()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
applyFullscreenPreference()
}
}
fun navigateBack() {
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.fragment_container) as NavHostFragment
@ -149,4 +163,8 @@ class SettingsSubscreenActivity : AppCompatActivity() {
windowInsets
}
}
private fun applyFullscreenPreference() {
FullscreenHelper.applyToActivity(this)
}
}

View file

@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
@ -22,6 +23,7 @@ import org.yuzu.yuzu_emu.databinding.FragmentProfileManagerBinding
import org.yuzu.yuzu_emu.model.HomeViewModel
import org.yuzu.yuzu_emu.model.UserProfile
import org.yuzu.yuzu_emu.utils.NativeConfig
import org.yuzu.yuzu_emu.utils.ViewUtils.updateMargins
class ProfileManagerFragment : Fragment() {
private var _binding: FragmentProfileManagerBinding? = null
@ -172,11 +174,19 @@ class ProfileManagerFragment : Fragment() {
val leftInsets = barInsets.left + cutoutInsets.left
val rightInsets = barInsets.right + cutoutInsets.right
val fabLayoutParams = binding.buttonAddUser.layoutParams as ViewGroup.MarginLayoutParams
fabLayoutParams.leftMargin = leftInsets + 24
fabLayoutParams.rightMargin = rightInsets + 24
fabLayoutParams.bottomMargin = barInsets.bottom + 24
binding.buttonAddUser.layoutParams = fabLayoutParams
binding.toolbarProfiles.updateMargins(left = leftInsets, right = rightInsets)
binding.listProfiles.updateMargins(left = leftInsets, right = rightInsets)
binding.listProfiles.updatePadding(
bottom = barInsets.bottom +
resources.getDimensionPixelSize(R.dimen.spacing_bottom_list_fab)
)
val fabSpacing = resources.getDimensionPixelSize(R.dimen.spacing_fab)
binding.buttonAddUser.updateMargins(
left = leftInsets + fabSpacing,
right = rightInsets + fabSpacing,
bottom = barInsets.bottom + fabSpacing
)
windowInsets
}

View file

@ -169,6 +169,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
checkForUpdates()
}
setInsets()
applyFullscreenPreference()
}
private fun checkForUpdates() {
@ -345,6 +346,14 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
override fun onResume() {
ThemeHelper.setCorrectTheme(this)
super.onResume()
applyFullscreenPreference()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
applyFullscreenPreference()
}
}
private fun setInsets() = ViewCompat.setOnApplyWindowInsetsListener(
@ -364,6 +373,10 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
windowInsets
}
private fun applyFullscreenPreference() {
FullscreenHelper.applyToActivity(this)
}
override fun setTheme(resId: Int) {
super.setTheme(resId)
themeId = resId

View file

@ -0,0 +1,52 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.utils
import android.app.Activity
import android.content.Context
import android.view.Window
import androidx.core.content.edit
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.preference.PreferenceManager
import org.yuzu.yuzu_emu.features.settings.model.Settings
object FullscreenHelper {
fun isFullscreenEnabled(context: Context): Boolean {
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(
Settings.PREF_APP_FULLSCREEN,
Settings.APP_FULLSCREEN_DEFAULT
)
}
fun setFullscreenEnabled(context: Context, enabled: Boolean) {
PreferenceManager.getDefaultSharedPreferences(context).edit {
putBoolean(Settings.PREF_APP_FULLSCREEN, enabled)
}
}
fun shouldHideSystemBars(activity: Activity): Boolean {
val rootInsets = ViewCompat.getRootWindowInsets(activity.window.decorView)
val barsCurrentlyHidden =
rootInsets?.isVisible(WindowInsetsCompat.Type.systemBars())?.not() ?: false
return isFullscreenEnabled(activity) || barsCurrentlyHidden
}
fun applyToWindow(window: Window, hideSystemBars: Boolean) {
val controller = WindowInsetsControllerCompat(window, window.decorView)
if (hideSystemBars) {
controller.hide(WindowInsetsCompat.Type.systemBars())
controller.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
} else {
controller.show(WindowInsetsCompat.Type.systemBars())
}
}
fun applyToActivity(activity: Activity) {
applyToWindow(activity.window, isFullscreenEnabled(activity))
}
}

View file

@ -5,21 +5,22 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:fitsSystemWindows="true">
android:background="?attr/colorSurface">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
style="@style/Widget.Eden.TransparentTopAppBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:touchscreenBlocksFocus="false">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_profiles"
style="@style/Widget.Eden.TransparentTopToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:title="@string/profile_manager"
app:navigationIcon="@drawable/ic_back"
app:titleCentered="false" />

View file

@ -1160,6 +1160,8 @@
<string name="theme_material_you">Material You</string>
<string name="app_settings">App Settings</string>
<string name="theme_and_color">Theme And Color</string>
<string name="fullscreen_mode">Fullscreen mode</string>
<string name="fullscreen_mode_description">Hide Android system bars across app screens. Swipe from an edge to reveal them temporarily.</string>
<!-- Theme Modes -->
<string name="change_theme_mode">Change theme mode</string>

View file

@ -1,9 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
struct RENDERDOC_API_1_6_0;
struct RENDERDOC_API_1_7_0;
namespace Tools {
@ -15,7 +18,7 @@ public:
void ToggleCapture();
private:
RENDERDOC_API_1_6_0* rdoc_api{};
RENDERDOC_API_1_7_0* rdoc_api{};
bool is_capturing{false};
};